Font size
WorksheetsJavascript
Total questions: 25
Worksheet time: 24mins
var typeOfApples="Fuji";
How can a developer show a pop-up message to the user?
alert
prompt
console.log
<p> tag
What attribute/value do we use to make a button execute JavaScript when clicked?
onclick="doSomething;"
on-click="doSomething;"
onclick="doSomething();"
onclick=doSomething();
Which of the following platform(s) can be used to run Javascript Code (you can choose more than one answer)
Google Chrome
Firefox
Microsoft Edge
Safari
What is the correct syntax for referring to an external JavaScript script?
<script src="myscript.js"></script>
<script href="myscript.js"></script>
<js href="myscript.js"></js>
<js src="myscript.js"></js>
Which one of the following symbols is used for JavaScript comments?
\\
^
?
//
What type of variable is
Boolean
Number
String
Which message will the user see?
"Hello user"
No message
"Goodbye user"
"message + user"
How do I declare a new variable?
var newVariable = 5
Variable int = new Variable()
var 5 = myVariable
int var = 5
Which of these is a loop?
if(x<10)
while(x<10)
var x=10;
text(x,10;10)
His name is Fred and he is less than 16 years old
Which of the following is the best way to write the above statement?
if (name = "fred" && age < 16 )
if (name == "fred" && age < 16 )
if (name = "fred" || age < 16 )
if (name == "fred" || age < 16 )
A programming language used for webpage functionality such as interactivity, data processing, animation, and development of purpose built apps such as mobile and desktop apps and more.
HTML5
CSS
JS
C#
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
war
var
varia
A store has 20 apples in its inventory. How can you store this information in a JavaScript variable?
var numApples == 20;
20 = numApples;
var numApples = 20;
var num apples = 20;
