Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Hoisting
- let someFunc = function() {
- // var b = undefined;
- // TEMPORAL DEADZONE let a, name, printName;
- // If we try to use variables (a, name ,printName) Reference Error!
- let a = 5;
- let name = 'Ivan';
- let printName = (param) => { };
- // If we try to use b here it will be undefined
- var b = 10;
- };
- f();
- function f() { };
- let f2 = () => { };
- // Reference Type passing
- let person = {name:'Ivan'};
- let person2 = person;
- person2.name = 'Gosho';
- console.log(person); // {name:'Gosho'};
- console.log(person2); // {nane:'Gosho'};
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement