Advertisement
Guest User

Untitled

a guest
Jul 20th, 2019
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. //Push into array
  2. //Name variable is globally accessible
  3. const name = ["Martina", "Tom"];
  4. name.push("abc")
  5.  
  6. //Map array
  7. console.log(name.map(res => res))
  8.  
  9. //Local Scope
  10. const test = () => {
  11. //Name variable is accessible only inside this function (local scope)
  12. let name = "Rene";
  13. console.log(name);
  14. };
  15. test();
  16.  
  17. console.log(name);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement