
Javascript
Quiz by Hardik Vedikin
Feel free to use or edit a copy
includes Teacher and Student dashboards
Measure skillsfrom any curriculum
Measure skills
from any curriculum
Tag the questions with any skills you have. Your dashboard will track each student's mastery of each skill.
With a free account, teachers can
- edit the questions
- save a copy for later
- start a class game
- automatically assign follow-up activities based on students’ scores
- assign as homework
- share a link with colleagues
- print as a bubble sheet
48 questions
Show answers
- Q1Which keyword is used to declare a variable in JavaScript?functionvarconstlet30s
- Q2What is the purpose of the 'typeof' operator in JavaScript?To loop through an arrayTo validate user inputTo determine the type of a variableTo convert a variable to a string30s
- Q3What is the syntax for creating a function in JavaScript?function {} functionName()functionName => {}function functionName() {}function = functionName() {}30s
- Q4What is the purpose of the 'querySelector()' method in JavaScript?To add a new HTML elementTo validate a form inputTo select and return the first element that matches a specified CSS selectorTo define a new CSS style30s
- Q5How do you add a comment in JavaScript?// This is a comment/* This is a comment */' This is a comment30s
- Q6What is the purpose of the 'addEventListener()' method in JavaScript?To create a new HTML elementTo attach an event handler function to an elementTo add a CSS class to an elementTo fetch data from an API30s
- Q7What is the result of the following code snippet? var x = 10; var y = '5'; var result = x + y;105015105NaN30s
- Q8What does the 'NaN' acronym stand for in JavaScript?No Available NumberNot a NumberNull and NoneNotable Array Name30s
- Q9What is the purpose of the 'push()' method in JavaScript?To check if an element exists in an arrayTo remove the last element from an arrayTo sort the elements of an array alphabeticallyTo add one or more elements to the end of an array and return the new length30s
- Q10What is the purpose of the 'slice()' method in JavaScript?To check if a value exists in an arrayTo convert an array to a stringTo reverse the order of elements in an arrayTo extract a section of an array and return a new array30s
- Q11Which keyword is used to declare a function in JavaScript?varletclassfunction30s
- Q12Which method is used to add an element to the end of an array in JavaScript?popshiftunshiftpush30s
- Q13Which operator is used for strict equality comparison in JavaScript?===!=====30s
- Q14Which method is used to remove the last element from an array in JavaScript?unshiftpushpopshift30s
- Q15Which global function is used to convert a string to an integer in JavaScript?toFixedtoStringparseFloatparseInt30s