WorksheetsJavascript
Total questions: 10
Worksheet time: 6mins
Which type of JavaScript language is
Object-oriented
Assembly-language
High-level
Object-based
Which of the following is the correct output for the following JavaScript code:
<script>
x = 10;
y = 5;
z = x / y;
document.getElementById("demo").innerHTML = "The value of z is: " + z;
</script>
2
0
5
Error
In JavaScript, what is a block of statement?
Conditional block
block that contains a single statement
block that combines a number of statements into a single compound statement
both conditional block and a single statement
What will happen, if the following JavaScript code is executed?
<script>
alert(5 + 6);
</script>
An error is displayed
The values of count variable are logged or stored in a particular location or storage
Pop up box appear with the value
An exception is thrown
The following is true about Javascript Objects, excepts
Containers for data values
Can be written with or without decimals
can be assigned with multiple values
Which of the following is the syntax for declaring Javascript array?
var pet = [ "cat", "dog", "bird"]
var pet = [ cat, dog, bird]
var pet = { cat, dog, bird}
var pet = ( cat, dog, bird)
Which of the following is the getElementsByTagName() method ?
return the element by given id value
return the element by given class name
return the element by given tag name
return the element by given name value
What is JavaScript?
JavaScript is a scripting language used to make the website interactive
JavaScript is an assembly language used to make the website interactive
JavaScript is a compiled language used to make the website interactive
None of the mentioned
What is the output of the following JavaScript code snippet?
<p id="demo"> </p>
var txt1 = " Happy";
var txt2 = " Birthday";
document.getElementById("demo").innerHTML = txt2 + txt1;
Happy
Birthday
Happy Birthday
Birthday Happy
Arrays in JavaScript are defined by which of the following statements?
It is an ordered list of objects
It is an ordered list of values
It is an ordered list of string
It is an ordered list of functions
