Changes

Jump to: navigation, search

JavaScript Variable Types

580 bytes added, 20:25, 11 April 2007
no edit summary
</pre>
== The JavaScript ''typeof'' method Operator == the flexible nature of JavaScript variable types can lead to confusion as to the particualr type of a variable at any given time in a script. To address this concern JavaScript provides the ''typeof'' operator. The ''typeof'' operator returns the current variable type of the specified variable. For example the following script: <pre>var myVariable = 10;document.writeln ( "myVariable = " + typeof myVariable );myVariable = "Hello";document.writeln ( "myVariable = " + typeof myVariable );</pre> displays the following output: myVariable = numbermyVariable = string

Navigation menu