🔥 Hot Interview Questions – Part 3 JavaScript Code, Output & Tricky Questions (UI / React Devs) Let’s test real JavaScript understanding 👇 1️⃣ What will be the output? console.log(typeof null); 2️⃣ Predict the output: let a = 10; function test() { console.log(a); let a = 20; } test(); 3️⃣ Output? for (var i = 0; i < 3; i++) { setTimeout(() => console.log(i), 0); } 4️⃣ What is the difference between: [] == [] {} == {} 5️⃣ What will this return? Promise.resolve(1) .then(x => x + 1) .then(x => { throw x }) .catch(x => x + 10) .then(x => console.log(x)); 💡 If you can explain why, you’re interview-ready. 👉 Save for practice 👉 Share with JS learners #JavaScript #CodeChallenge #FrontendInterview #ReactJS #WebDevelopers
1st object 2nd error 3rd 3,3,3,3 4th false , false 5th 12
1. Object 2. Reference error 3. 3 3 3 4. false false 5. 12
Great thanks 👍
Thanks👍
1) object (due to javascript error because null is primitive datatype) 2) reference error (Due to hoisting let in temporal dead zone) 3) 3 3 3 (because var has functional level scope) 4) false false (because Reference is different) 5) undefined (because throw then not return value)