You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: index.html
+9Lines changed: 9 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -92,6 +92,15 @@ <h3>Selector</h3>
92
92
</ul>
93
93
</section>
94
94
95
+
<section>
96
+
<h2>Literals and Constructors Patterns</h2>
97
+
<ul>
98
+
<li><ahref="https://github.com/shichuan/javascript-patterns/blob/master/literals-and-constructors/object-literal.html" target="_blank">Object literal</a> - use the simpler and reliable object literal instead of new Object();</li>
99
+
<li><ahref="https://github.com/shichuan/javascript-patterns/blob/master/literals-and-constructors/enforcing-new.html" target="_blank">Enforcing new</a> - when you forget `new`, `this` inside the constructor will point to the global object</li>
100
+
<li><ahref="https://github.com/shichuan/javascript-patterns/blob/master/literals-and-constructors/array-literal.html" target="_blank">Array literal</a> - use array literal notation to avoid potential errors when creating dynamic arrays at runtime</li>
0 commit comments