Font size
WorksheetsJavaScript_Revision
Total questions: 45
Worksheet time: 26mins
Which of these is a loop?
if(x<10)
while(x<10)
var x=10;
text(x,10;10)
Which of these will increase the value of the variable X?
increment (x)
x++;
x=x;
x+1;
Which of the following will decrease the value of x?
x--;
x-1;
x=x;
x=-x;
His name is Fred and he is less than 16 years old
if (name = "fred" && age < 16 )
if (name === "fred" && age < 16 )
if (name = "fred" || age < 16 )
if (name === "fred" || age < 16 )
Repeat something 10 times
repeat 10
for (var i=0; i<10; i++)
repeat { } until 10;
while (i = 10)
A short form writing the word variable is
rav
VAR
var
varia
The "stroke" command means
color inside shape
color outside shape
color of blocks
border
What does the "fill" command do
put letters in the shape
put pictures in the shape
put color in the shape
put code in the shape
Javascript is _________ language.
Programming
Scripting
Application
applet
JavaScript is designed for following purpose -
To Style HTML Pages
To Perform Server Side Scripting Opertion
To add interactivity to HTML Pages.
To Execute Query Related to DB on Server
JavaScript is can be written -
directly into JS file and included into HTML
directly into HTML pages
directly on the Server Script
None of these
Is this correct syntax to include JS Code inside HTML Page ?
<script type="text/javascript">
...
</script>
Yes
No
Which of these is a method?
getElementById( )
style
document
color
What would this piece of code do?
change the background color of the word demo to red
change the font color of the demo element to red
this is not correct
styles the element with the class demo
What is the correct syntax to transform a string to upper case?
var txt = "Hello!" ;
toUpperCase( txt );
var txt = "Hello!" ;
toUpperCase.txt();
var txt = "Hello!" ;
txt.toUpperCase();
var txt = "Hello!" ;
txt(toUpperCase);
What would this piece of code display?
10
20
30
40
1
2
3
4
10
20
30
40
50
11
22
33
44
What is -- ?
Which of the following are valid keywords for JavaScript?
let
var
const
def
What would alert(6 + '2') show?
8
62
6+'2'
6'2'
Look at the following code:
let attendees = 568;
attendees++
document.write(attendees)
What will print to the browser?
568
570
569
An error message
Look at the following code:
let total_price = 40;
total_price--
--total_price
document.write(total_price)
What will print to the browser?
39
40
38
42
Read the code below:
alert(true || false);
What would the output be?
True
False
Read the code below:
alert(false && true);
What would the output be?
True
False
Read the code below:
alert(!false);
What would the output be?
True
False
Determine what result each expression yields if it is True or False. Given that x= 8 and y= 16.
(x!== 9 && y===16 ) || ( x>10 || y!=16)
False
True
Determine what result each expression yields if it is True or False. Given that x= 8 and y= 16.
( x === 8 || y > 5) && ( x! == 7 && y > "11")
True
False
Determine what result each expression yields if it is True or False. Given that x= 8 and y= 16.
( x > "4" || y<=10) || x === 8|| y>15)
True
False
Determine what result each expression yields if it is True or False. Given that x= 8 and y= 16.
( x > 3 && y ! == 7)&&( x>= 6 && y == 16)
True
False
Determine what result each expression yields if it is True or False. Given that x= 7 and y= 9.
( x >2 && y ! == 9)&&( x>= 6 && y ==9)
True
False
Determine what result each expression yields if it is True or False. Given that x= 5 and y= 3.
( x==2 || y == 3 )||( x<6 && y<9)
True
False
