JavaScript: Language Fundamentals & Modern Features
JavaScript: Language Fundamentals & Modern Features
Up to 20 questions, shuffled on every run
Welcome to the JavaScript Basics Quiz! This quiz is designed to test your understanding of fundamental JavaScript concepts, syntax, and modern programming best practices. Each question is multiple-choice, and you’ll find hints to help you along the way. Good luck!
Answer key and explanations20 questions
The quiz above draws 20 questions at random from these 30, so a second attempt will not be the same run. Everything in the pool is listed here.
Which keyword is used to declare a block-scoped variable that can be reassigned?
Answer`let`
What is the result of "5" + 2 in JavaScript?
Answer`"52"`
How do you create a function using the arrow syntax?
Answer`const my_func = () => {}`
What does "===" check that "==" does not?
AnswerBoth the value and the type
Which method is used to write text directly into the browser console?
Answer`console.log()`
What is the purpose of "document.querySelector()"
AnswerSelecting an element by CSS
Which of these is NOT a valid way to declare a variable in modern JS?
Answer`set`
What is a "Promise" in JavaScript?
AnswerAn object for async task state
Which array method creates a new array by performing a function on every element?
Answer`map()`
What does the "this" keyword refer to in a standard object method?
AnswerThe object owning the method
How do you convert a JSON string into a JavaScript object?
Answer`JSON.parse()`
What is "Hoisting" in JavaScript?
AnswerMoving declarations to the top
Which operator is used to spread the elements of an array into another array?
Answer`...`
What is an "anonymous function"?
AnswerA function without a name
Which of these is a "falsy" value in JavaScript?
Answer`0`
What is the purpose of the "async" keyword?
AnswerTo return a Promise object
How do you check the length of an array "myArr"?
Answer`myArr.length`
What does "DOM" stand for?
AnswerDocument Object Model
Which keyword is used to stop a loop immediately?
Answer`break`
What is the "event bubble"?
AnswerEvent propagation upwards
Which symbol is used for template literals?
Answer`Backticks (` `)`
What is the purpose of "use strict"?
AnswerTo enforce cleaner code
What is "null" in JavaScript?
AnswerIntentional empty value
Which method adds an item to the BEGINNING of an array?
Answer`unshift()`
What does "NaN" stand for?
AnswerNot a Number
Which function is used to execute a block of code after a specified delay?
Answer`setTimeout()`
How do you check if an object has a specific property?
Answer`key in object`
What is a "Closure"?
AnswerPersistent scope access
Which keyword is used to inherit from another class?
Answer`extends`
What is the default return value of a function that doesn't return anything?
Answer`undefined`








