a li
Lok
esh M
Q 1.
Q 1. W
What
h a t iiss J
JavaScript?
avaScript?
ANS: JavaScript is a lightweight, interpreted
programming language used to create dynamic
and interactive web pages.
Q 2.
Q 2. IIss JJavaScript
a v a S c r i p t ssynchronous orr
ynchronous o
asynchronous?
a synchronous?
ANS: JavaScript is single-threaded and synchronous,
but it supports asynchronous behavior using
callbacks, promises, and async/await.
Q 3.
Q 3. W
What are
hat a data
re d a t a ttypes
y p e s iin JavaScript?
n J avaScript?
ANS: Primitive: string, number, boolean, undefined,
null, symbol, bigint
Non-primitive: object, array, function
Q 4.
Q 4. DDifference between
ifference b var,
etween v a r , llet, and
et, a nd
const?
c onst?
ANS: var: function-scoped
let: block-scoped
const: block-scoped, cannot be reassigned 1
a li
Lok
esh M
Q 5.
Q 5. W
What
h a t iiss h
hoisting?
oisting?
ANS: Hoisting is JavaScript’s behavior of moving
declarations to the top of the scope before
execution.
Q 6.
Q 6. W
What
h a t iiss c
closure?
losure?
ANS: A closure is a function that remembers variables
from its outer scope even after the outer
function has executed.
Q 7.
Q 7. W
What
h a t iiss tthis keyword?
his k eyword?
ANS: this refers to the object that is currently
calling the function.
Q 8.
Q 8. W
What
h a t iiss a
ann aarrow
r r o w ffunction?
unction?
ANS: Arrow functions are shorter syntax
functions and do not have their own this.
Q 9.
Q 9. DDifference between
ifference b === aand
etween = ===?
nd = ==?
ANS: == checks value only, === checks value and
type.
2