Académique Documents
Professionnel Documents
Culture Documents
1. Numerical Data
2. Text Data
3. Boolean Data
Two values:
true for yes and
False for no
With myVariable99
99variables myPercent_Variable
My%Variable the_Good_and_the_Bad
theGood&theBad
myFirstVariable = "Hello";
alert(myFirstVariable); //Hello
myFirstVariable = 54321;
alert(myFirstVariable); //54321
</script>
</body>
</html>
alert(string1);//Hello
alert(string2); //Goodbye
string2 = string1;
alert(string1);//Hello
alert(string2); //Hello
alert(15 / 10);//1.5
</script>
</body>
</html> Faculty of Information Science 12
Operator
• Common operators
alert(degCent); //10
</script>
</body>
</html>
<script type="text/javascript">
myVar1 = isNaN(“Hello”);//true
myVar2 = isNaN(“34”);//false
myArray[1] = "Mike";
document.write("myArray[1] changed to " + myArray[1]); //myArray[1] changed to Mike
</script>
</body>
</html>