Depends on the JSVM. V8 and Chakra use a JIT compiler. Others, like SpiderMonkey, have a mix of interpreters and JIT compilers, and I am very sure that there are pure interpreters, too.
It does not matter if JS is compiled or interpreted. Both variants tokenize the code into an AST (abstract syntax tree) before execution, so they can understand scopes, variable declarations, etc. before further processing.