100% tevredenheidsgarantie Direct beschikbaar na je betaling Lees online óf als PDF Geen vaste maandelijkse kosten 4,6 TrustPilot
logo-home
Overig

100 JavaScript Questions and Answers for Exam Preparation

Beoordeling
-
Verkocht
-
Pagina's
16
Geüpload op
10-02-2025
Geschreven 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.

Meer zien Lees minder
Instelling
Vak

Voorbeeld van de inhoud

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?

Geschreven voor

Instelling
Vak

Documentinformatie

Geüpload op
10 februari 2025
Aantal pagina's
16
Geschreven in
2024/2025
Type
OVERIG
Persoon
Onbekend

Onderwerpen

€6,46
Krijg toegang tot het volledige document:

100% tevredenheidsgarantie
Direct beschikbaar na je betaling
Lees online óf als PDF
Geen vaste maandelijkse kosten

Maak kennis met de verkoper
Seller avatar
rileyclover179

Ook beschikbaar in voordeelbundel

Maak kennis met de verkoper

Seller avatar
rileyclover179 US
Volgen Je moet ingelogd zijn om studenten of vakken te kunnen volgen
Verkocht
-
Lid sinds
1 jaar
Aantal volgers
0
Documenten
252
Laatst verkocht
-

0,0

0 beoordelingen

5
0
4
0
3
0
2
0
1
0

Populaire documenten

Recent door jou bekeken

Waarom studenten kiezen voor Stuvia

Gemaakt door medestudenten, geverifieerd door reviews

Kwaliteit die je kunt vertrouwen: geschreven door studenten die slaagden en beoordeeld door anderen die dit document gebruikten.

Niet tevreden? Kies een ander document

Geen zorgen! Je kunt voor hetzelfde geld direct een ander document kiezen dat beter past bij wat je zoekt.

Betaal zoals je wilt, start meteen met leren

Geen abonnement, geen verplichtingen. Betaal zoals je gewend bent via Bancontact, iDeal of creditcard en download je PDF-document meteen.

Student with book image

“Gekocht, gedownload en geslaagd. Zo eenvoudig kan het zijn.”

Alisha Student

Veelgestelde vragen