Clash Royale CLAN TAG #URR8PPP <!-- main_leaderboard, all: [728,90][970,90][320,50][468,60] --> JavaScript Let ❮ Previous Next ❯ ECMAScript 2015 ES2015 introduced two important new JavaScript keywords: let and const . These two keywords provide Block Scope variables (and constants) in JavaScript. Before ES2015, JavaScript had only two types of scope: Global Scope and Function Scope . Global Scope Variables declared Globally (outside any function) have Global Scope . Example var carName = "Volvo"; // code here can use carName function myFunction() // code here can also use carName Try it Yourself » Global variables can be accessed from anywhere in a JavaScript program. Function Scope Variables declared Locally (inside a function) have Function Scope . Example // code here can NOT use carName function myFunction() var carName = "Volvo"; // code here CAN use carName // code here can NOT ...