Callback functions are passed as arguments of other functions and they are normally executed at the end of the parent function.
For an example check this
Cross-Origin Resource Sharing or CORS is a mechanism that uses additional HTTP headers to grant a browser permission to access resources from a server at an origin different from the website
An example of a cross-origin request is a web application served from
http://myowndomain.com that uses AJAX to make a request for
It evaluates to
0.1 + 0.2 //OUTPUT //0.30000000000000004
Lexical scoping or Static scoping refers to when the location of a function's definition determines which variables you have access to. On the other hand, dynamic scoping uses the location of the function's invocation to determine which variables are available.
For better source code we often use Lexical scoping.
The major difference -
null is explicit while
undefined is implicit. Let's say we have a variable and we don't have a value associated with that, so that makes it undefined but
null is set as the value to explicitly indicate “no value”.
undefined is used when the nothing is "not" known, and
null is used when the nothing is known.
Pass by value always.However, with objects, the value is a reference to the object.
const a = [0, 1, 2] const b = [0, 1, 2] const c = "0,1,2" console.log(a == c) console.log(a == b)
TRUE - automatic type conversion
FALSE - Arrays are compared by reference
If you don't use semicolons, tools like Prettier will insert semicolons for you in the places where they are required to save in a text editor to prevent errors.
typeof typeof 0
It evaluates to "string".
typeof 0 evaluates to number
typeof "number" evalutes to string