DEV Community

Discussion on: Do's and Don'ts for Javascript Newbies

Collapse
 
clintongallagher profile image
Clinton Gallagher

Consistency is also a Best Practice. When authoring an article and suggesting that Javascript developers use:

const container = document.getElementById("someElementId");

And then later in that same article the author uses:

let container = document.getElementById("someElementId");

It can elicit the pernicious WTF response followed by an emoji :-)

Collapse
 
enscripter profile image
Isaiah Griego

Like the article says the let syntax indicates that the value is to be changed which happens in the code snippet.