JavaScript: Language Fundamentals & Modern Features

20 QuestionsIntermediatePublished:

JavaScript: Language Fundamentals & Modern Features

Up to 20 questions, shuffled on every run

Quiz Configuration
Enterto start

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.

  1. Which keyword is used to declare a block-scoped variable that can be reassigned?

    Answer`let`

  2. What is the result of "5" + 2 in JavaScript?

    Answer`"52"`

  3. How do you create a function using the arrow syntax?

    Answer`const my_func = () => {}`

  4. What does "===" check that "==" does not?

    AnswerBoth the value and the type

  5. Which method is used to write text directly into the browser console?

    Answer`console.log()`

  6. What is the purpose of "document.querySelector()"

    AnswerSelecting an element by CSS

  7. Which of these is NOT a valid way to declare a variable in modern JS?

    Answer`set`

  8. What is a "Promise" in JavaScript?

    AnswerAn object for async task state

  9. Which array method creates a new array by performing a function on every element?

    Answer`map()`

  10. What does the "this" keyword refer to in a standard object method?

    AnswerThe object owning the method

  11. How do you convert a JSON string into a JavaScript object?

    Answer`JSON.parse()`

  12. What is "Hoisting" in JavaScript?

    AnswerMoving declarations to the top

  13. Which operator is used to spread the elements of an array into another array?

    Answer`...`

  14. What is an "anonymous function"?

    AnswerA function without a name

  15. Which of these is a "falsy" value in JavaScript?

    Answer`0`

  16. What is the purpose of the "async" keyword?

    AnswerTo return a Promise object

  17. How do you check the length of an array "myArr"?

    Answer`myArr.length`

  18. What does "DOM" stand for?

    AnswerDocument Object Model

  19. Which keyword is used to stop a loop immediately?

    Answer`break`

  20. What is the "event bubble"?

    AnswerEvent propagation upwards

  21. Which symbol is used for template literals?

    Answer`Backticks (` `)`

  22. What is the purpose of "use strict"?

    AnswerTo enforce cleaner code

  23. What is "null" in JavaScript?

    AnswerIntentional empty value

  24. Which method adds an item to the BEGINNING of an array?

    Answer`unshift()`

  25. What does "NaN" stand for?

    AnswerNot a Number

  26. Which function is used to execute a block of code after a specified delay?

    Answer`setTimeout()`

  27. How do you check if an object has a specific property?

    Answer`key in object`

  28. What is a "Closure"?

    AnswerPersistent scope access

  29. Which keyword is used to inherit from another class?

    Answer`extends`

  30. What is the default return value of a function that doesn't return anything?

    Answer`undefined`

Was this useful?

You might also enjoy

Check out some of our other posts on similar topics

TypeScript: Typed JavaScript Fundamentals

TypeScript: Typed JavaScript Fundamentals

Welcome to the TypeScript Basics Quiz! This quiz covers fundamental TypeScript concepts, static typing, and type-safe programming best practices. Each question is multiple-choice, and you'll find hint

CSS Fundamentals: Selectors, Box Model & Styling

CSS Fundamentals: Selectors, Box Model & Styling

Welcome to the CSS Fundamentals quiz! This quiz will test your knowledge of CSS basics, including selectors, the box model, properties, and layout techniques. Each question is designed to reinforce ke

HTML Semantics & Web Accessibility

HTML Semantics & Web Accessibility

Welcome to the HTML Semantics & Accessibility Quiz! This quiz will test your knowledge of semantic HTML elements and web accessibility best practices. Each question has a hint to help you out, and you

Async JavaScript: Promises, Async/Await, Event Loop

Async JavaScript: Promises, Async/Await, Event Loop

Welcome to the Async JavaScript quiz! Test your knowledge of Promises, async/await, the event loop, and advanced concurrency patterns. Each question has a hint and detailed explanations for all option

React Fundamentals: Components, Hooks & State Management

React Fundamentals: Components, Hooks & State Management

Welcome to the React Fundamentals Quiz! This quiz will test your knowledge of core React concepts, including components, JSX, hooks, state management, props, and event handling. Whether you're new to

Vue.js Fundamentals: Reactive Components & Templates

Vue.js Fundamentals: Reactive Components & Templates

Welcome to the Vue.js Basics Quiz! Vue.js is a progressive JavaScript framework for building user interfaces. Whether you're creating a simple interactive widget or a complex single-page application,

6 related posts