// a=10
// b=20
// const temp = a;
https://github.com/sudheerj/reactjs-interview-questions
// a = b;
// b = temp;//10
// a = a + b; //30
// b = a - b; //10
// a = a - b;//20
// [a, b] = [b, a];
// console.log(a,b)
console.log(a,b)
//life cycle method in react -->class based component
//render props
//hoc
//automatic batching
//what is call stack, how does the call stack
//how the virtual dom is working
//how the call stack is working
//what is fiber algo
//what is reconciliation
Please go through these topics
Call stack
VIrtual Dom
FIber Algorithm
https://codesandbox.io/p/sandbox/clever-diffie-nqhck7
factory function
fiber vs old reconciliation
const length = 4;
const numbers = [];
for (var i = 0; i < length; i++); {
numbers.push(i + 1);
}
console.log(numbers);
es6
const scores = [22, 33]const [math = 50, sci = 50, arts = 50] = scores pROMISE
const data = [
{
id: 1,
title: "Essence Mascara Lash Princess",
reviews: [
{
rating: 2,
comment: "Very unhappy with my purchase!",
date: "2024-05-23T08:56:21.618Z",
reviewerName: "John Doe",
reviewerEmail: "john.doe@x.dummyjson.com",
},
{
rating: 2,
comment: "Not as described!",
date: "2024-05-23T08:56:21.618Z",
reviewerName: "Nolan Gonzalez",
reviewerEmail: "nolan.gonzalez@x.dummyjson.com",
},
{
rating: 5,
comment: "Very satisfied!",
date: "2024-05-23T08:56:21.618Z",
reviewerName: "Scarlett Wright",
reviewerEmail: "scarlett.wright@x.dummyjson.com",
},
],
},
];
const p = new Promise((res,rej)=>{
setTimeout(function() {
res(data)
}, 1000);
})
p.then((data)=>console.log(data[0].title))
//use async and await as well
async function fetchData(){
const data= await fetch('https://dummyjson.com/docs/products')
const jsonFormat = data.json()
console.log(jsonFormat)
}
fetchData()
// use custom hook to fetch the data
Comments
Post a Comment