alert("Hello World");
msgBox("Hello World");
alertBox("Hello World");
msg("Hello World");
function:myFunction()
function myFunction()
function = myFunction()
function.myFunction()
if (i == 5)
if i == 5 then
if i = 5
if i = 5 then
if (i <> 5)
if (i != 5)
if i =! 5 then
if i <> 5
<!--This is a comment-->
//This is a comment
'This is a comment
#This is a comment
var colors = 1 = ("red"), 2 = ("green"), 3 = ("blue")
var colors = (1:"red", 2:"green", 3:"blue")
var colors = "red", "green", "blue"
var colors = ["red", "green", "blue"]
round(7.25)
Math.rnd(7.25)
rnd(7.25)
Math.round(7.25)
ceil(x, y)
Math.max(x, y)
top(x, y)
Math.ceil(x, y)
variable carName;
var carName;
vari carName;
dim carName;
=
x
==
*
TRUE
FALSE
JavaScript interpreter processes programs written in Java.
JavaScript interpreter processes commands in a script written in JavaScript.
Java and JavaScript are almost similar
JavaScript cannot be embedded in HTML.
<script href="xxx.js">
<script src="xxx.js">
<script name="xxx.js">
<script id="xxx.js">
alert("Hello World")
alertBox("Hello World")
msgBox("Hello World")
msg("Hello World")
onclick
onmousescroller
onmouseover
onmousemove
<script src=" test.js"'></script>
<script href=" test.js"></script>
<import src=" test.js"></import>
<script link=" test.js"></script>
Which of the following code is most efficient?
Code 1 for(var number-10;number>=1;number--) { document.writeln(number); } Code 2 var number=10; while(number>=1) { document.writeln(number); number++ }
Code 1
Code 2
Both Code 1 and Code 2
Cannot Compare
var defines a variable while let defines a constant.
There is no such major difference between them.
The value of a variable declared with var can be changed while the value of a variable declared with let cannot be changed.
var defined function scoped variable while let define block scoped variable.
What will be the output of the following JavaScript code ?
<p id="demo"></p> <script> var js = 5; js*=10; document.getElementByld("demo").innerHTML = js; </script>
10
15
5
50
Division by zero
Missing of semicolons
Syntax error
Both A and B