I'm trying to understand the scope of variables in javascript when it comes to web-pages. For example, if I have let's say an index.html and I define two scripts
script One
var x = 2
script Two
var y = x
Would this work? Do both scripts work from a global pool of variables or are they each given their own space to work in?