0% found this document useful (0 votes)
11 views2 pages

Js Ques

Uploaded by

sates63656
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views2 pages

Js Ques

Uploaded by

sates63656
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

Based on experince and questions answered, the scenarios and no.

of questions can
be increased or decreased, also each question can be deep dived for better clarity

1)what will be the ouptut of undefined==null


2)what will be the output of typeof(typeof null)
3)arrow function vs es5 function(traditional function) //give some example to test
if they have clairty like below:
const person = {
name: 'Jack',
hobbies: ['Music', 'Cricket', 'Travelling'],

showHobbies() {
this.hobbies.forEach(function (hobby) {
console.log(`${this.name} likes ${hobby}`);
});
},
};

person.showHobbies();
4)Hoisting //give some examples to test:
a)
a = 5;
console.log(a);
let a;

b)test with changing scenarios like output for below and in case if var b from
function dummy is removed

var b = 4;

function dummy() {
b = 'hello';
console.log(b);
var b;
}

dummy();
console.log(b);

c)
function test(){
setTimeout(()=>{
console.log(x);
console.log(y);
},3000);

var x = 2;
let y = 12;
}
test();
5)combination of closure/higher order function/function currying, something like
below: //tweak it to analyze more in different ways,
Write a function test that would allow you to achieve these results.

var addSix = test(6);


addSix(10); // returns 16
addSix(21); // returns 27
6)How do you remove a specific item from an array?
7)How do you check if a value is a number?
8)How do you deep clone an object?
9)Debouncing with example? // tweak the ques based on their ans
10)Throttling with example? // tweak the ques based on their ans
11)questions on callbacks/promises/async-await, scenarios based on parallel and
sequential execution...
How the behavior of async/await can be mimicked using Promises? Provide an example
where you convert an async function into a Promise-based function, discuss the
similarities and differences in handling asynchronous operations between the
approaches?
12)Event loop? //tweak the ques basedon their ans
basic example to test something like below:

let a=true;

setTimeout(()=>{
a=false;
},2000)

while(a){
console.log('Welcome')
}
13)Difference between localstorage, sessionstorage, cookie // tweak the ques based
on their ans like what if browser is closed / a new tab has been opened / a
duplicate tab has been created

You might also like