Published Jul 16 2012
Psssst! The 2023 WEB DEVELOPMENT BOOTCAMP is starting on FEBRUARY 01, 2023! SIGNUPS ARE NOW OPEN to this 10-weeks cohort course. Learn the fundamentals, HTML, CSS, JS, Tailwind, React, Next.js and much more! โจ
new Object()
. Use the object literal syntax {}
instead.[]
over new Array()
.if
, switch
, loops, try
).if
of while
statements condition part==
and !=
. Use ===
and !==
instead.eval
. Why? It has performance issues (it runs the interpreter/compiler), it has security issues (code injection if used with user input), difficulties in debugging.with
, as it modifies the scope chain and can be a source of confusion.setTimeout
and setInterval
Array
as an associative arrays, use Object
instead. The part of the Array
object that provides that functionality is in fact provided by the Object
prototype, so you could really have used a Date
object for that same thing.\
at the end of a string to create a multiline string, itโs not part of ECMAScript. Use string concatenation ' string1 ' + ' string2 '
insteadObject
and Array
. Modify other prototypes of other objects such as Function
with caution as it could lead to bugs hard to debug.