Chapter 3 Final
Chapter 3 Final
Introduction to JavaScript
JavaScript Basics
Variables, Expression, Control Structure,
Array, Function
Event and Exception Handling
<html>
<head>
<script src="xyz.js"> </script>
</head>
<body> A separate file
</body>
</html>
&& Logical and Evaluate to “true” when both 3>2 && 5<2
operands are true
!== Strictly not equal No type conversion before testing nonequality 5 !== “5”
> Greater than “true” if left operand is greater than right operand 2>5
< Less than “true” if left operand is less than right operand 3<5
>= Greater than or “true” if left operand is greater than or equal to the 5 >= 2
equal right operand
<= Less than or “true” if left operand is less than or equal to the 5 <= 2
equal right operand
Internet Programming 34 WU - KIoT- CS
String Operators
▪ JavaScript only supports one string operator for
joining two strings.
Operator Name Description Return value
+ String Joins two strings “HelloWorld”
concatenation
<script language=“JavaScript”>
var myString = “”;
myString = “Hello” + “World”;
alert(myString);
</script>
= Assigns the value of the right operand to the left operand A=2