Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Push into array
- //Name variable is globally accessible
- const name = ["Martina", "Tom"];
- name.push("abc")
- //Map array
- console.log(name.map(res => res))
- //Local Scope
- const test = () => {
- //Name variable is accessible only inside this function (local scope)
- let name = "Rene";
- console.log(name);
- };
- test();
- console.log(name);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement