Primitive vs Reference types in javascript
In Javascript data types can be classified based on how they are passed:
value
Boolean
null
undefined
String
Number
reference
Array
Function
Object
data types which are passed by value are called primitive types
data types which are passed by...
rohitgeddam.hashnode.dev3 min read
Hello,
if (true) { var language1 = "js"; // language1 is of global scope. let language2 = "c"; // language2 is local to this block const language3 = 'c++'; // language3 is local to this block }
console.log(language1); // prints js console.log(language2); // error because language2 is not visible outside the if block console.log(language3); // error because language3 is not visible outside the if block
To clear out the wind Scope and Context are different things We discussed scope in the above section, and Context is used to refer to the value topdatingwebsitesx.com/random-talk topdatingwebsitesx.com/chat-avenue chatrandom.live of this in some particular part of your code. There are functions you can call to change the value of this, we will take about it later ever tried console logging this outside any function. outside any function (in global scope) this is always the Window Object.
thanks alexsunny