100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached 4.2 TrustPilot
logo-home
Other

100 JavaScript Questions and Answers for Exam Preparation

Rating
-
Sold
-
Pages
16
Uploaded on
10-02-2025
Written in
2024/2025

This document contains 100 carefully curated JavaScript questions and answers, covering both theoretical and practical aspects of JavaScript. It includes multiple-choice questions (MCQs), conceptual questions, and practical coding exercises, making it ideal for exam preparation, coding interviews, and self-study. Topics covered: JavaScript Basics Functions and Scope Arrays and Objects ES6+ Features DOM Manipulation Asynchronous JavaScript (Promises, Async/Await) Debugging and Error Handling JavaScript Algorithms Each question is designed to enhance your JavaScript skills, ensuring a deep understanding of core concepts.

Show more Read less










Whoops! We can’t load your doc right now. Try again or contact support.

Document information

Uploaded on
February 10, 2025
Number of pages
16
Written in
2024/2025
Type
Other
Person
Unknown

Content preview

100 JavaScript Questions & Answers
1. JavaScript Basics
1. What is JavaScript?
o JavaScript is a high-level, interpreted programming language used to
create dynamic web pages. It enables interactivity, such as form
validation, animations, and API calls.
2. How is JavaScript different from Java?
o Java is a compiled, statically-typed language, while JavaScript is
interpreted and dynamically-typed.
o Java is mainly used for backend applications, whereas JavaScript is
mostly used for web development.
3. What are the different ways to declare a variable in JavaScript?
o var (function-scoped)
o let (block-scoped)
o const (block-scoped and immutable)
4. What is the difference between == and === in JavaScript?
o == checks for value equality with type coercion.
o === checks for both value and type equality.
5. What are the different data types in JavaScript?
o Primitive Types: String, Number, Boolean, Undefined, Null, Symbol,
BigInt.
o Reference Types: Objects, Arrays, Functions.




2. Functions & Scope
6. What is a function in JavaScript?
o A function is a block of reusable code that performs a specific task.
7. What are the different types of functions in JavaScript?
o Named Functions: function greet() {}
o Anonymous Functions: const greet = function() {}
o Arrow Functions: const greet = () => {}

, 8. What is the difference between function declaration and function
expression?
o Function Declaration: Defined using function keyword and can be
hoisted.
o Function Expression: Stored in a variable and cannot be hoisted.
9. What is closure in JavaScript?
o A function that remembers variables from its outer scope even after
the outer function has finished executing.
10.What is the difference between global and local scope?

 Global Scope: Variables declared outside any function are accessible
everywhere.
 Local Scope: Variables declared inside a function are accessible only within
that function.



3. Objects & Prototypes
11.What is an object in JavaScript?
o An object is a collection of key-value pairs used to store and manage
data.
12.How do you create an object in JavaScript?
o Using object literals: const obj = { key: 'value' };
o Using the new Object() syntax: const obj = new Object();
13.What is a prototype in JavaScript?
o A prototype is an object from which other objects inherit properties
and methods.
14.What is the difference between prototypal and classical inheritance?
o Classical Inheritance (like Java) uses classes to create objects.
o Prototypal Inheritance (JavaScript) allows objects to inherit directly
from other objects.
15.How do you add a method to a prototype?
o MyObject.prototype.myMethod = function() { return 'Hello'; }

, 4. Asynchronous JavaScript
16.What is asynchronous programming in JavaScript?
o A method of execution that allows the program to continue running
while waiting for operations to complete.
17.What is the difference between synchronous and asynchronous code?
o Synchronous: Executes line by line, waiting for each task to
complete.
o Asynchronous: Allows multiple tasks to run simultaneously.
18.What are callbacks in JavaScript?
o A function passed as an argument to another function that is
executed later.
19.What are Promises in JavaScript?
o Objects that represent the eventual completion (or failure) of an
asynchronous operation.
20.What is async and await in JavaScript?
o async makes a function return a promise.
o await waits for a promise to resolve before continuing execution.




5. ES6+ Features
21.What are some new features introduced in ES6?
o let and const
o Arrow Functions
o Template Literals
o Destructuring Assignment
o Default Parameters
22.What is the spread operator (...) in JavaScript?
o Used to spread elements of an array or object into a new array or
object.
23.What is destructuring in JavaScript?
o A syntax that allows you to unpack values from arrays or properties
from objects into distinct variables.
24.What are template literals in JavaScript?
$6.79
Get access to the full document:

100% satisfaction guarantee
Immediately available after payment
Both online and in PDF
No strings attached

Get to know the seller
Seller avatar
rileyclover179

Also available in package deal

Thumbnail
Package deal
Complete JavaScript Complete Study Bundle with Q&A & Exam Guide (16 documents)
-
16 2025
$ 93.04 More info

Get to know the seller

Seller avatar
rileyclover179 US
View profile
Follow You need to be logged in order to follow users or courses
Sold
0
Member since
11 months
Number of followers
0
Documents
252
Last sold
-

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Frequently asked questions