NEW
Font size
WorksheetsBT Final HTML & CSS & JS
Total questions: 25
Worksheet time: 12mins
What is a callback function in JavaScript?
A function that generates random numbers
A function that returns a value
A function that loops through an array
A function that is passed as an argument to another function
When is a callback function executed?
At the same time as the main function
After some specific task is completed
Before the main function
Only on weekends
Which of these is a method?
getElementById( )
style
document
color
What does the 'typeof' operator in JavaScript do?
Returns the data type of a variable
Adds two numbers together
Checks if a variable is defined
Prints a message to the console
What does the 'let' keyword do in JavaScript?
Declares a block-scoped variable
Performs a loop iteration
Defines a function
Prints a message to the console
What is the purpose of the 'querySelector' method in JavaScript?
To select the first element that matches a specified CSS selector
To add a new element to the DOM
To change the CSS style of an element
To remove an event listener
What is the purpose of the 'map' method in JavaScript?
To create a new array with the results of calling a provided function on every element in the array
To remove an element from an array
To change the CSS style of an element
To add a new element to the DOM
How does the 'filter' method work in JavaScript?
It creates a new array with all elements that pass the test implemented by the provided function
It sorts the elements of an array
It reverses the order of elements in an array
It adds a new element to the beginning of an array
Which CSS property is used to change the text color of an element?
colour
font-color
text-color
color
What is the purpose of the 'flex' property in CSS?
To control the layout of elements in a flexible way
To change the font size of an element
To set the background color of an element
To add a border around an element
Which sequence of HTML tags is correct?
<html><head></head><body></body></html>
<html><head><body></body></head></html>
<html><head></body></body></head></html>
<html><<head></head></body></body></html>
What are IFrames?
Buttons that link to other websites
Videos uploaded to your website
The number of views your website has
HTML pages embedded inside of other HTML pages
Which of the following will turn the h1 tag blue as the mouse hovers over it?
hover > h1 {
color: blue;
}
h1:hover {
color: blue;
}
h1; hover {
color: blue;
}
h1, hover {
color: blue;
}
Which of the following defines border thickness so that the top and bottom borders are 10px thick and left and right borders are 5px thick?
border: 5px 10px 5px 10px
border: 5px 5px 10px 10px
border: 10px 10px 5px 5px
border: 10px 5px 10px 5px
const fn = (a) => { a * 2 }
console.log(fn(4))
8
4
undefined
Error
Javascript is _________ language.
Programming
Scripting
Application
applet
What is the value of:
”41” + 1
42
“42”
411
“411”
What is the name of the JavaScript standard?
JavaScript
ECMA Script
JS
PEP
console.log(true+ true + true * 3)
9
3
5
NaN
Which of the following is not a valid JavaScript variable name?
2java
_java_and_ java _names
javaandjava
None of the above
In JavaScript the x===y statement implies that:
Both x and y are equal in value, type and reference address as well.
Both are x and y are equal in value only.
Both are equal in the value and data type.
Both are not same at all
What is the output of the following code?
var city = new Array("delhi", "agra", "akot", "aligarh","palampur");
console.log(city.slice(2));
[“delhi”,”agra”,”akot”]
[“akot”, “aligarh”, “palampur”]
[“delhi”,”agra”,”akot” , “aligarh”,”palampur”
None
What will be printed in the console on execution of the following JS code:
var array = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15];
var myArr= array.filter(v => v % 3 === 0);
console.log(myArr);
[3, 13]
[3, 6, 9, 12, 15]
[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]
[]
var val = "JavaScript String"
console.log(val.split('a'));
[ 'J', 'v', 'Script String' ]
[ 'J' ,'v','Script']
[ 'J', 'a', 'v', 'a', ' S', 'c', 'r', 'i', 'p', 't', 'S', 't', 'r', 'i', 'n', g' ]
[ 'J', 'v', ' S', 'c', 'r', 'i', 'p', 't', 'S', 't', 'r', 'i', 'n', g' ]
Find output of below Javascript addition code
console.log("1 plus 1 is " + 1 + 1);
2
1 plus 1 is 2
1 plus 1 is 11
1 plus 1 is 1 + 1
