Scope is the accessibility of variables, functions, and objects in some particular part of your code during runtime. In other words, scope determines the visibility of variables and other resources in areas of your code.(1)
We could be able to declare a variable inside the function, the code would be running same. Below example shows same result.
Now, from here when we do console.log(exampleVariable), we will get an ReferenceError. We no longer available to exampleVarible outside of function. Because we declare that variable inside the function and it is visible inside the function. Below picture shows the result.