JavaScript misconceptions

Javascript is used for thousands of programers, designers, bloggers and so on, perhaps because it is the language that makes internet be alive, however many programers use the language without really understanding it.

Here is a list of misconceptions that I hope it will make a better use of JavaScript.

1. "use strict";

It was added for compatibility with previous versions; adding this directive in the first line would enable changes on the language.

2. functions are objects

Indeed, functions can be used as any other regular variable, this is very powerful, since functions can be passed as parameters, assigned to a variable, added in a JSON configuration.

let fn = (x,y) => x * y 

Notice that fn does not have braces, if we include braces, then we need to include the return word

3. JSON as configuration file

 

Write a Reply or Comment

Your email address will not be published.