Explore key concepts and features of asynchronous programming in…
Start QuizExplore underrated JavaScript libraries that offer powerful solutions for…
Start QuizExplore how pnpm 10 enhances package installation security and…
Start QuizExplore how JavaScript classes relate to prototypes, constructor functions,…
Start QuizDiscover the proven patterns and practical habits that distinguish…
Start QuizAssess your understanding of JavaScript modules, including import/export syntax,…
Start QuizChallenge your understanding of JavaScript function definitions, syntax, and…
Start QuizSharpen your understanding of JavaScript objects with these easy…
Start QuizExplore the basics of JavaScript loops with these straightforward…
Start QuizExplore easy questions covering fundamental JavaScript concepts, suitable for…
Start QuizExplore the basics of the JavaScript Event Loop, including…
Start QuizChallenge your JavaScript fundamentals with 15 essential interview questions…
Start QuizExplore essential concepts for handling dependencies across multi-package JavaScript…
Start QuizChallenge your understanding of fundamental JavaScript concepts with these…
Start QuizExplore the history and evolution of JavaScript, from its…
Start QuizEnhance your understanding of JavaScript with this beginner-friendly quiz…
Start QuizTest your understanding of common internet troubleshooting scenarios and…
Start QuizTest your knowledge of ES6 (ECMAScript 2015) features with…
Start QuizTest your understanding of key JavaScript topics with these…
Start QuizTest your knowledge with these commonly asked JavaScript interview…
Start QuizTest your knowledge of Observables in JavaScript, including their…
Start QuizTest your knowledge of essential JavaScript developer tips and…
Start QuizTest your knowledge of JavaScript ES6 features with this…
Start QuizTest your understanding of core JavaScript concepts relevant to…
Start QuizThis quiz contains 16 questions. Below is a complete reference of all questions, answer choices, and correct answers. You can use this section to review after taking the interactive quiz above.
Which of the following is the correct way to define an object literal representing a car with properties 'make' and 'model'?
Correct answer: let car = { make: 'Toyota', model: 'Camry' };
Given the object let person = { name: 'Anna', age: 22 }, how can you access the value of 'age'?
Correct answer: person.age
How can you add a property 'city' with the value 'London' to an existing object called user?
Correct answer: user.city = 'London';
What is the correct way to define a method called greet inside an object?
Correct answer: greet: function() { console.log('Hello'); }
In an object method, what does the 'this' keyword refer to?
Correct answer: The current object calling the method
What does prototypal inheritance in JavaScript allow an object to do?
Correct answer: Inherit properties and methods from another object
If you use the map() method on an array [1, 2, 3] with a function that multiplies each value by 2, what is the resulting array?
Correct answer: [2, 4, 6]
What will [5, 8, 12, 3].filter(x => x > 6) return?
Correct answer: [8, 12]
What does the array method reduce() typically output when called on [1, 2, 3] with (acc, val) => acc + val as the callback?
Correct answer: 6
Which statement correctly describes what forEach() does to an array?
Correct answer: It calls a provided function once for each array element
Given let arr = [10, 25, 30]; what does arr.find(x => x > 20) return?
Correct answer: 25
Which syntax correctly accesses a property with a key stored in the variable 'prop' from an object 'obj'?
Correct answer: obj[prop]
How do you use array destructuring to extract the first two values from [7, 8, 9] into variables a and b?
Correct answer: let [a, b] = [7, 8, 9];
Given const person = { name: 'Kai', age: 30 }, what is the correct way to extract the name property into a variable?
Correct answer: const { name } = person;
What is the recommended way to check if an object obj has its own property 'id'?
Correct answer: obj.hasOwnProperty('id')
Which statement correctly adds a method speak() to the prototype of a constructor function Animal?
Correct answer: Animal.prototype.speak = function() { console.log('Hi'); };