Garantie de satisfaction à 100% Disponible immédiatement après paiement En ligne et en PDF Tu n'es attaché à rien 4,6 TrustPilot
logo-home
Autre

100 JavaScript Questions and Answers for Exam Preparation

Note
-
Vendu
-
Pages
16
Publié le
10-02-2025
Écrit en
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.

Montrer plus Lire moins
Établissement
Cours

Aperçu du contenu

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?

École, étude et sujet

Établissement
Cours

Infos sur le Document

Publié le
10 février 2025
Nombre de pages
16
Écrit en
2024/2025
Type
AUTRE
Personne
Inconnu

Sujets

€6,47
Accéder à l'intégralité du document:

Garantie de satisfaction à 100%
Disponible immédiatement après paiement
En ligne et en PDF
Tu n'es attaché à rien

Faites connaissance avec le vendeur
Seller avatar
rileyclover179

Document également disponible en groupe

Faites connaissance avec le vendeur

Seller avatar
rileyclover179 US
S'abonner Vous devez être connecté afin de suivre les étudiants ou les cours
Vendu
-
Membre depuis
1 année
Nombre de followers
0
Documents
252
Dernière vente
-

0,0

0 revues

5
0
4
0
3
0
2
0
1
0

Documents populaires

Récemment consulté par vous

Pourquoi les étudiants choisissent Stuvia

Créé par d'autres étudiants, vérifié par les avis

Une qualité sur laquelle compter : rédigé par des étudiants qui ont réussi et évalué par d'autres qui ont utilisé ce document.

Le document ne convient pas ? Choisis un autre document

Aucun souci ! Tu peux sélectionner directement un autre document qui correspond mieux à ce que tu cherches.

Paye comme tu veux, apprends aussitôt

Aucun abonnement, aucun engagement. Paye selon tes habitudes par carte de crédit et télécharge ton document PDF instantanément.

Student with book image

“Acheté, téléchargé et réussi. C'est aussi simple que ça.”

Alisha Student

Foire aux questions