I am new to JS. I have the following question -
Is it right to say that I can declare variables only in global scope or inside a function/method only in JS and in no other type of Object which is not function/method?
I understand that properties can be defined in any object of Javascript but variables cannot be declared everywhere.
EDIT: I might not have right terminology to explain but in simplest words I need a list of places where i can write var x = ..
in JS code. Please,I am not looking for scope of a variable.