JavaScript/Basics: Difference between revisions
wikademia>Hampshire2004 Clarification on variable typing |
wikademia>Hampshire2004 m Punctuation |
||
| Line 58: | Line 58: | ||
it is fairly obvious to any individual reading the code that x is a number. However, if the statement | it is fairly obvious to any individual reading the code that x is a number. However, if the statement | ||
x = x + "This is text that is probably not a number"; | x = x + "This is text that is probably not a number"; | ||
were to appear later in the code, JavaScript would change the variable to a text variable. This is one of the reasons that JavaScript is referred to as weakly typed; at any particular point in time, it is impossible to tell exactly what type a particular variable is | were to appear later in the code, JavaScript would change the variable to a text variable. This is one of the reasons that JavaScript is referred to as weakly typed; at any particular point in time, it is impossible to tell exactly what type a particular variable is. | ||
====Arrays==== | ====Arrays==== | ||
===Operators=== | ===Operators=== | ||