JavaScript is loose typing, variable data types not declared.
When a variable is first defined
var foo; is undefined
When it is assigned its value or object, that is when we know its type. We can reuse the variable and its true type will change.
That is why it is important in JavaScript that you are carefull on how you code things. I am an old school guy that loves to say strFoo, objFoo and intFoo when I am working with variables of known types. People really hate that notation, but I love it for JavaScript. (I still use isFoo for Booleans)
As you pointed out there are the constructors:
Just remember JavaScript is NOT a compiled language, it is interpreted at runtime. In 2.0 specs they are going to have typed variables, but I do not see that coming into existance for a long time.
Also JVM has nothing to do with JavaScript. Only thing that
Java and JavaScript share is Java. (It is named JavaScript because the Netscape guys that coined it wanted to use the buzz
word that was hot at the time!)
Eric