what do you mean by lexical scope in JS code example
Example: lexical scope javascript
var x = 2;
var add = function() {
var y = 1;
return x + y;
};
var x = 2;
var add = function() {
var y = 1;
return x + y;
};