var x = 1; var x = 4; console.log(x); //4 //can be overwritten in a large codebase. //it's of the global scope. let y = "happy"; let y = "guy"; console.log(y); //SyntaxError: 'y' has already been declared //can't be overwritten unless explicitly. //it's of the local scope in a block of code. ✌KCM
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter