In a Javascript L1 & L2 round the following questions can be asked from interviewer. 1. What is the difference between 'Pass by Value' and 'Pass by Reference'? 2. What is the difference between map and filter ? 3. What is the difference between map() and forEach() 4. What is the difference between Pure and Impure functions? 5. What is the difference between for-in and for-of ? 6. What are the differences between call(), apply() and bind() ? 7. List out some key features of ES6 ? 8. What’s the spread operator in javascript ? 9. What is rest operator in javascript ? 10. What are DRY, KISS, YAGNI, SOLID Principles ? 11. What is temporal dead zone ? 12. Different ways to create object in javascript ? 13. Whats the difference between Object.keys,values and entries 14. Whats the difference between Object.freeze() vs Object.seal() 15. What is a polyfill in javascript ? 16. What is generator function in javascript ? 17. What is prototype in javascript ? 18. What is IIFE ? 19. What is CORS ? 20. What are the different datatypes in javascript ? 21. What are the difference between typescript and javascript ? 22. What is authentication vs authorization ? 23. Difference between null and undefined ? 24. What is the output of 3+2+”7” ? 25. Slice vs Splice in javascript ? 26. What is destructuring ? 27. What is setTimeOut in javascript ? 28. What is setInterval in javascript ? 29. What are Promises in javascript ? 30. What is a callstack in javascript ? 31. What is a closure ? 32. What are callbacks in javascript ? 33. What are Higher Order Functions in javascript ? 34. What is the difference between == and === in javascript ? 35. Is javascript a dynamically typed language or a statically typed language 36. What is the difference between Indexeddb and sessionstorage ? 37. What are Interceptors ? 38. What is Hoisting ? 39. What are the differences let, var and const ? 41. Differences between Promise.all, allSettled, any, race ? 42. What are limitations of arrow functions? 43. What is difference between find vs findIndex ? 44. What is tree shaking in javascrip 45. What is the main difference between Local Storage and Session storage 46. What is eval() 47. What is the difference between Shallow copy and deep copy 48. What are the difference between undeclared and undefined variables 49. What is event bubbling 50. What is event capturing 51. What are cookies 52. typeOf operator 53. What is this in javascript and How it behaves in various scenarios 54. How do you optimize the performance of application 55. What is meant by debouncing and throttling 𝐠𝐞𝐭 𝐞𝐛𝐨𝐨𝐤 𝐰𝐢𝐭𝐡 (detailed 232 ques = 90+ frequently asked Javascript interview questions and answers, 90+ Reactjs Frequent Ques & Answers, 50+ Output based ques & ans, 23+ Coding Questions & ans, 2 Machine coding ques & ans) 𝐄𝐛𝐨𝐨𝐤 𝐋𝐢𝐧𝐤: https://lnkd.in/gJMmH-PF Follow on Instagram : https://lnkd.in/gXTrcaKP #javascriptdeveloper #reactjs #reactnative #vuejsdeveloper #angular #angulardeveloper
Javascript Interview Questions and Answers
More Relevant Posts
-
In a Javascript L1 & L2 round the following questions can be asked from interviewer. 1. What is the difference between 'Pass by Value' and 'Pass by Reference'? 2. What is the difference between map and filter ? 3. What is the difference between map() and forEach() 4. What is the difference between Pure and Impure functions? 5. What is the difference between for-in and for-of ? 6. What are the differences between call(), apply() and bind() ? 7. List out some key features of ES6 ? 8. What’s the spread operator in javascript ? 9. What is rest operator in javascript ? 10. What are DRY, KISS, YAGNI, SOLID Principles ? 11. What is temporal dead zone ? 12. Different ways to create object in javascript ? 13. Whats the difference between Object.keys,values and entries 14. Whats the difference between Object.freeze() vs Object.seal() 15. What is a polyfill in javascript ? 16. What is generator function in javascript ? 17. What is prototype in javascript ? 18. What is IIFE ? 19. What is CORS ? 20. What are the different datatypes in javascript ? 21. What are the difference between typescript and javascript ? 22. What is authentication vs authorization ? 23. Difference between null and undefined ? 24. What is the output of 3+2+”7” ? 25. Slice vs Splice in javascript ? 26. What is destructuring ? 27. What is setTimeOut in javascript ? 28. What is setInterval in javascript ? 29. What are Promises in javascript ? 30. What is a callstack in javascript ? 31. What is a closure ? 32. What are callbacks in javascript ? 33. What are Higher Order Functions in javascript ? 34. What is the difference between == and === in javascript ? 35. Is javascript a dynamically typed language or a statically typed language 36. What is the difference between Indexeddb and sessionstorage ? 37. What are Interceptors ? 38. What is Hoisting ? 39. What are the differences let, var and const ? 41. Differences between Promise.all, allSettled, any, race ? 42. What are limitations of arrow functions? 43. What is difference between find vs findIndex ? 44. What is tree shaking in javascrip 45. What is the main difference between Local Storage and Session storage 46. What is eval() 47. What is the difference between Shallow copy and deep copy 48. What are the difference between undeclared and undefined variables 49. What is event bubbling 50. What is event capturing 51. What are cookies 52. typeOf operator 53. What is this in javascript and How it behaves in various scenarios 54. How do you optimize the performance of application 55. What is meant by debouncing and throttling #interviewPrep #Learnings #CareerGrowth #TechDepth #javascriptdeveloper #reactjs #reactnative #vuejsdeveloper #angular #angulardeveloper #DSA #LeetCode
To view or add a comment, sign in
-
In a Javascript L1 & L2 round the following questions can be asked from interviewer. 1. What is the difference between 'Pass by Value' and 'Pass by Reference'? 2. What is the difference between map and filter ? 3. What is the difference between map() and forEach() 4. What is the difference between Pure and Impure functions? 5. What is the difference between for-in and for-of ? 6. What are the differences between call(), apply() and bind() ? 7. List out some key features of ES6 ? 8. What’s the spread operator in javascript ? 9. What is rest operator in javascript ? 10. What are DRY, KISS, YAGNI, SOLID Principles ? 11. What is temporal dead zone ? 12. Different ways to create object in javascript ? 13. Whats the difference between Object.keys,values and entries 14. Whats the difference between Object.freeze() vs Object.seal() 15. What is a polyfill in javascript ? 16. What is generator function in javascript ? 17. What is prototype in javascript ? 18. What is IIFE ? 19. What is CORS ? 20. What are the different datatypes in javascript ? 21. What are the difference between typescript and javascript ? 22. What is authentication vs authorization ? 23. Difference between null and undefined ? 24. What is the output of 3+2+”7” ? 25. Slice vs Splice in javascript ? 26. What is destructuring ? 27. What is setTimeOut in javascript ? 28. What is setInterval in javascript ? 29. What are Promises in javascript ? 30. What is a callstack in javascript ? 31. What is a closure ? 32. What are callbacks in javascript ? 33. What are Higher Order Functions in javascript ? 34. What is the difference between == and === in javascript ? 35. Is javascript a dynamically typed language or a statically typed language 36. What is the difference between Indexeddb and sessionstorage ? 37. What are Interceptors ? 38. What is Hoisting ? 39. What are the differences let, var and const ? 41. Differences between Promise.all, allSettled, any, race ? 42. What are limitations of arrow functions? 43. What is difference between find vs findIndex ? 44. What is tree shaking in javascrip 45. What is the main difference between Local Storage and Session storage 46. What is eval() 47. What is the difference between Shallow copy and deep copy 48. What are the difference between undeclared and undefined variables 49. What is event bubbling 50. What is event capturing 51. What are cookies 52. typeOf operator 53. What is this in javascript and How it behaves in various scenarios 54. How do you optimize the performance of application 55. What is meant by debouncing and throttling
To view or add a comment, sign in
-
In a Javascript L1 & L2 round the following questions can be asked from interviewer. 1. What is the difference between 'Pass by Value' and 'Pass by Reference'? 2. What is the difference between map and filter ? 3. What is the difference between map() and forEach() 4. What is the difference between Pure and Impure functions? 5. What is the difference between for-in and for-of ? 6. What are the differences between call(), apply() and bind() ? 7. List out some key features of ES6 ? 8. What’s the spread operator in javascript ? 9. What is rest operator in javascript ? 10. What are DRY, KISS, YAGNI, SOLID Principles ? 11. What is temporal dead zone ? 12. Different ways to create object in javascript ? 13. Whats the difference between Object.keys,values and entries 14. Whats the difference between Object.freeze() vs Object.seal() 15. What is a polyfill in javascript ? 16. What is generator function in javascript ? 17. What is prototype in javascript ? 18. What is IIFE ? 19. What is CORS ? 20. What are the different datatypes in javascript ? 21. What are the difference between typescript and javascript ? 22. What is authentication vs authorization ? 23. Difference between null and undefined ? 24. What is the output of 3+2+”7” ? 25. Slice vs Splice in javascript ? 26. What is destructuring ? 27. What is setTimeOut in javascript ? 28. What is setInterval in javascript ? 29. What are Promises in javascript ? 30. What is a callstack in javascript ? 31. What is a closure ? 32. What are callbacks in javascript ? 33. What are Higher Order Functions in javascript ? 34. What is the difference between == and === in javascript ? 35. Is javascript a dynamically typed language or a statically typed language 36. What is the difference between Indexeddb and sessionstorage ? 37. What are Interceptors ? 38. What is Hoisting ? 39. What are the differences let, var and const ? 41. Differences between Promise.all, allSettled, any, race ? 42. What are limitations of arrow functions? 43. What is difference between find vs findIndex ? 44. What is tree shaking in javascrip 45. What is the main difference between Local Storage and Session storage 46. What is eval() 47. What is the difference between Shallow copy and deep copy 48. What are the difference between undeclared and undefined variables 49. What is event bubbling 50. What is event capturing 51. What are cookies 52. typeOf operator 53. What is this in javascript and How it behaves in various scenarios 54. How do you optimize the performance of application 55. What is meant by debouncing and throttling.
To view or add a comment, sign in
-
In a Javascript L1 & L2 round the following questions can be asked from interviewer. 1. What is the difference between 'Pass by Value' and 'Pass by Reference'? 2. What is the difference between map and filter ? 3. What is the difference between map() and forEach() 4. What is the difference between Pure and Impure functions? 5. What is the difference between for-in and for-of ? 6. What are the differences between call(), apply() and bind() ? 7. List out some key features of ES6 ? 8. What’s the spread operator in javascript ? 9. What is rest operator in javascript ? 10. What are DRY, KISS, YAGNI, SOLID Principles ? 11. What is temporal dead zone ? 12. Different ways to create object in javascript ? 13. Whats the difference between Object.keys,values and entries 14. Whats the difference between Object.freeze() vs Object.seal() 15. What is a polyfill in javascript ? 16. What is generator function in javascript ? 17. What is prototype in javascript ? 18. What is IIFE ? 19. What is CORS ? 20. What are the different datatypes in javascript ? 21. What are the difference between typescript and javascript ? 22. What is authentication vs authorization ? 23. Difference between null and undefined ? 24. What is the output of 3+2+”7” ? 25. Slice vs Splice in javascript ? 26. What is destructuring ? 27. What is setTimeOut in javascript ? 28. What is setInterval in javascript ? 29. What are Promises in javascript ? 30. What is a callstack in javascript ? 31. What is a closure ? 32. What are callbacks in javascript ? 33. What are Higher Order Functions in javascript ? 34. What is the difference between == and === in javascript ? 35. Is javascript a dynamically typed language or a statically typed language 36. What is the difference between Indexeddb and sessionstorage ? 37. What are Interceptors ? 38. What is Hoisting ? 39. What are the differences let, var and const ? 41. Differences between Promise.all, allSettled, any, race ? 42. What are limitations of arrow functions? 43. What is difference between find vs findIndex ? 44. What is tree shaking in javascrip 45. What is the main difference between Local Storage and Session storage 46. What is eval() 47. What is the difference between Shallow copy and deep copy 48. What are the difference between undeclared and undefined variables 49. What is event bubbling 50. What is event capturing 51. What are cookies 52. typeOf operator 53. What is this in javascript and How it behaves in various scenarios 54. How do you optimize the performance of application 55. What is meant by debouncing and throttling #js #javascript #react #next #v8
To view or add a comment, sign in
-
In a Javascript L1 & L2 round the following questions can be asked from interviewer. 1. What is the difference between 'Pass by Value' and 'Pass by Reference'? 2. What is the difference between map and filter ? 3. What is the difference between map() and forEach() 4. What is the difference between Pure and Impure functions? 5. What is the difference between for-in and for-of ? 6. What are the differences between call(), apply() and bind() ? 7. List out some key features of ES6 ? 8. What’s the spread operator in javascript ? 9. What is rest operator in javascript ? 10. What are DRY, KISS, YAGNI, SOLID Principles ? 11. What is temporal dead zone ? 12. Different ways to create object in javascript ? 13. Whats the difference between Object.keys,values and entries 14. Whats the difference between Object.freeze() vs Object.seal() 15. What is a polyfill in javascript ? 16. What is generator function in javascript ? 17. What is prototype in javascript ? 18. What is IIFE ? 19. What is CORS ? 20. What are the different datatypes in javascript ? 21. What are the difference between typescript and javascript ? 22. What is authentication vs authorization ? 23. Difference between null and undefined ? 24. What is the output of 3+2+”7” ? 25. Slice vs Splice in javascript ? 26. What is destructuring ? 27. What is setTimeOut in javascript ? 28. What is setInterval in javascript ? 29. What are Promises in javascript ? 30. What is a callstack in javascript ? 31. What is a closure ? 32. What are callbacks in javascript ? 33. What are Higher Order Functions in javascript ? 34. What is the difference between == and === in javascript ? 35. Is javascript a dynamically typed language or a statically typed language 36. What is the difference between Indexeddb and sessionstorage ? 37. What are Interceptors ? 38. What is Hoisting ? 39. What are the differences let, var and const ? 41. Differences between Promise.all, allSettled, any, race ? 42. What are limitations of arrow functions? 43. What is difference between find vs findIndex ? 44. What is tree shaking in javascrip 45. What is the main difference between Local Storage and Session storage 46. What is eval() 47. What is the difference between Shallow copy and deep copy 48. What are the difference between undeclared and undefined variables 49. What is event bubbling 50. What is event capturing 51. What are cookies 52. typeOf operator 53. What is this in javascript and How it behaves in various scenarios 54. How do you optimize the performance of application 55. What is meant by debouncing and throttling 𝐠𝐞𝐭 𝐞𝐛𝐨𝐨𝐤 𝐰𝐢𝐭𝐡 (detailed 232 ques = 90+ frequently asked Javascript interview questions and answers, 90+ Reactjs Frequent Ques & Answers, 50+ Output based ques & ans, 23+ Coding Questions & ans, 2 Machine coding ques & ans) 𝐄𝐛𝐨𝐨𝐤 𝐋𝐢𝐧𝐤: https://lnkd.in/gJMmH-PF Follow on Instagram : https://lnkd.in/gXTrcaKP #javascriptdeveloper #reactjs #reactnative #vuejsdeveloper #angular #angulardeveloper
To view or add a comment, sign in
-
I have a confession to make. I am not very savvy in JavaScript, its syntax, or structure. Everything I've learned about writing JavaScript I learned from borrowing code from sections of this 15+ year old in-house application. Making things fast has always fallen under the shadow of making things right. Software that is "good enough" wins almost every time, but is "good enough" really good enough? I'm no dummy. My co-workers have provided a few tools and processes to recognize how to locate, 'copy what works', and modify it as needed. This has been successful, but doing so always left me feeling empty and unsure. It was frustrating to know something worked, passed testing, and provided value. As they say, "when all you have is a hammer, everything looks like nails". The daunting task of writing scripts to process front-end UI forms has always been a mystery. This is why I've stuck to the back-end of our application when given the chance. Lately I have been "hitting the books" to better understand how to use JavaScript, what Node.js is, and how AJAX does its job to communicate with the back-end. For example, I have learned that there are two ways to create a JavaScript object; with "object literal notation" or constructor notation. I have also learned there are a million ways to mangle a JS object after the object is created (not cool). Why am I hitting the books when I've glided by for so many years by copy-paste-test? What is so special about JavaScript when there are so many other languages available? Who, in the 21st century, doesn't know how to use jQuery? These are a lot of good questions. First, I want to do a better job at my... job. I'm not lazy. There is so much to do every day. I could continue doing what I'm doing and probably never run into any trouble. So, to answer the first question, hitting the books allows me to exercise this meat on a stick called a "brain". By understanding the language, I can contribute by fixing a lot of the issues I was propagating because now I can recognize how fragile JS is. Second, why JavaScript? Because it pays my bills. It is a viable language to this day. It doesn't seem to be slowing down, and there are more and more languages that borrow from its syntax. I don't think it is a losing proposition to learn as much as I can about JavaScript. Lastly, who doesn't know jQuery? Well, me for one. There is a lot to learn about it. It is apparent that developers only use a handful of the language's built-in functions. For example, the AJAX jQuery methods are super useful. However, most of the jQuery AJAX methods such as .get(), .post(), .getJSON() are overlooked in lieu of the call to .ajax(). This leads to many more lines of code and doesn't' self-document. There's my confession. I'm not willing to keep walking the same path forward. I enjoy what I do and I want to be better at it every day.
To view or add a comment, sign in
-
💛 JavaScript Functions (Part 1) — What They Are & How They Work 🧠 In JavaScript, functions are not just blocks of code. They are first-class citizens, execution units, and one of the most powerful and beautiful features of the language. Let’s start from the foundation 👇 ♦️ What is a Function? A function is: 👉 A reusable block of code designed to perform a specific task. In simple words: Write once, use many times. function greet() { console.log("Hello, JavaScript!"); } ♦️ Why Functions Exist? Functions help you: ✅ Avoid code repetition ✅ Improve readability ✅ Break big problems into smaller pieces ✅ Organize logic clearly ♦️ Function Syntax (Basic) function functionName(parameters) { // function body return value; } ♦️ Parameters vs Arguments (Very Important ⚠️) 🔹 Parameters ▪️Variables listed in function definition ▪️Act like placeholders function square(num) { return num * num; } Here, num is a parameter 🔹 Arguments ▪️Actual values passed when calling a function ▪️square(5); Here, 5 is an argument 📌 Rule: Parameters receive values, arguments send values. ♦️ Calling / Invoking a Function 📞 A function does nothing until it is called. greet(); // function call square(4); // function invocation 👉 Parentheses () trigger execution. ♦️ How Functions Work Internally in JavaScript 🧠⚙️ When a function is invoked: 1️⃣ A new Function Execution Context is created 2️⃣ Memory is allocated for: Parameters and Local variables 3️⃣ Code inside the function executes line by line 4️⃣ Function returns a value (or undefined) 5️⃣ Execution context is removed from the Call Stack ♦️ Execution Flow Example var x = 10; function add(a, b) { var sum = a + b; return sum; } var result = add(2, 3); console.log(result); 🔍 Behind the Scenes Global Execution Context is created add() is called → new Function Execution Context a = 2, b = 3, sum = 5 return sum → execution context destroyed result = 5 ♦️ Functions Always Return Something function test() {} console.log(test()); // undefined 👉 If no return, JavaScript returns undefined by default. 🧠 Key Takeaways ▪️Functions are reusable blocks of logic ▪️Parameters ≠ Arguments ▪️Functions create their own execution context ▪️Function calls are managed by the call stack 📌 This was Part 1 — the foundation. Next parts coming up 🔥 👉 Part 2: Function Expressions, Arrow Functions & First-Class Functions 👉 Part 3: Higher-Order Functions, Callbacks with EventListener If this helped you, drop a 💛 or share 🔁 Learning JavaScript deeply, one concept at a time 🚀 #JavaScript #JSInternals #LearnJavaScript #WebDevelopment #ProgrammingConcepts #WebDevJourney #BuildInPublic
To view or add a comment, sign in
-
-
If I had to start learning #JavaScript again in 2026, with all the noise, tutorials, frameworks, and pressure to “learn React in 7 days” I would first become unshakably good at JavaScript + Browser basics. Here’s exactly how I’d do it step by step. Step 1: Core JavaScript: Not Fancy, Just Solid I’d start with the boring stuff that actually powers everything: Variables (let, const, var) and how scoping really works Data types (primitive vs reference) Objects, arrays, maps, sets Functions (declaration, expression, arrow) this keyword in different contexts Equality (== vs ===) and type coercion Spread / rest operators Destructuring Modules (import / export) Error handling (try/catch/finally, custom errors) Step 2: The JS Mental Model: How the Language Thinks Next, I’d go deeper into how JS actually works under the hood: Execution context Call stack Hoisting Lexical scope Scope chain Closures Prototype & prototype chain How new works internally Step 3: Async JavaScript: The Part That Scares Most People Then I’d attack this head-on: Event loop Call stack vs callback queue vs microtask queue Promises (creation, chaining, error handling) async/await Promise combinators (all, race, any, allSettled) Fetch API + AbortController Timeouts, intervals, and cleanup Step 4: JavaScript in the Browser: Where It Actually Lives JavaScript is not just the language. It’s how it works inside the browser. I’d understand: The DOM Selecting elements and manipulating them Browser events Event bubbling & capturing Event delegation (super important for performance) async, defer, and how scripts load How the browser parses HTML + executes JS Reflow vs repaint basics Web APIs (setTimeout, fetch, localStorage, history, etc.) Storage: localStorage vs sessionStorage vs cookies Step 5: Rebuild Core Utilities Yourself Now I’d intentionally rewrite things from scratch: Custom map, filter, reduce Custom forEach Debounce function Throttle function Deep clone function A simple pub/sub (event emitter) Simple state container Step 6: Build Mini Projects Without React Before frameworks, I’d build small UI features with plain JS: Search filter Tabs Modal Accordion Timer / stopwatch Infinite scroll Basic form with validation This teaches you: DOM control, Events, State handling, Edge cases Step 7: THEN Learn React with a Clear Head Step 8: Move to Next.js Intentionally Most people rush to frameworks. Most people never truly understand browser behavior. That’s exactly why good JS + browser fundamentals are your biggest unfair advantage. If you’re serious about mastering JavaScript properly and want a structured, interview-focused resource: 👉 The JavaScript Bundle https://lnkd.in/dpAnbMrZ It includes: ✅ All core + advanced concepts, 180+ interview style QnAs ✅ 300+ Questions (70% coding + 30% theory) ✅ 60 System design prompts (HLD + LLD) for real-world UI challenges ✅ Detailed explanations with real-world examples & analogies
To view or add a comment, sign in
-
⚡ JavaScript Concepts JavaScript powers interactive experiences, from dynamic updates to full apps. Start with variables: use let for changeable values, const for fixed ones, and var (older style) sparingly. For instance, let score = 0; score++; updates a game score on the fly. Functions are reusable code blocks. Declare them with function add(a, b) { return a + b; } or arrow syntax: const add = (a, b) => a + b;. They handle tasks like validating forms without repeating code. Core JavaScript Concepts Variables and Data Types JavaScript uses dynamic typing. Declare with let, const, or var. Primitives include strings ("hello"), numbers (42), booleans (true), null, undefined, and symbols. Objects and arrays store collections: const arr = [1, 'two', {key: 'value'}];. Functions and Scope Functions encapsulate logic. Example: javascript function greet(name) { return `Hello, ${name}!`; } console.log(greet('World')); // Hello, World! Scope limits variable access—block scope with let/const keeps things tidy. Control Structures Use if/else for decisions, for/while loops for repetition, and switch for multiple cases. javascript for (let i = 0; i < 3; i++) { console.log(i); // 0, 1, 2 } Arrays and Objects Arrays: push(), pop(), map(), filter(). Objects: key-value pairs with dot/bracket notation. Destructuring shines: const {name, age} = user;. DOM Manipulation Access HTML with document.getElementById('id'). Add events: button.addEventListener('click', () => alert('Clicked!'));. ES6+ Features Arrow Functions: Concise callbacks. Promises/Async-Await: Handle async code like fetches. javascript async function fetchData() { const data = await fetch('api/url'); return data.json(); } Modules: export/import for modular code. Practice these in the browser console to build intuition—they form the backbone of modern JS. #JavaScript #JSConcepts #Development #CodingTips #Programming #Skills #JSBook #JavaScriptTutorial #Frontend #ES6 #DOM #Backend #DataStructure
To view or add a comment, sign in
-
10 Unique JavaScript Questions to Challenge Your Understanding 𝟭. 𝗪𝗵𝘆 𝗱𝗼𝗲𝘀 𝟬.𝟭 + 𝟬.𝟮 !== 𝟬.𝟯 𝗶𝗻 𝗝𝗮𝘃𝗮𝗦𝗰𝗿𝗶𝗽𝘁? - JavaScript uses IEEE 754 floating-point arithmetic, which cannot precisely represent certain decimal numbers in binary - This leads to rounding errors. The result of 0.1 + 0.2 is actually 0.30000000000000004. 𝟮. 𝗪𝗵𝗮𝘁 𝗵𝗮𝗽𝗽𝗲𝗻𝘀 𝘄𝗵𝗲𝗻 𝘆𝗼𝘂 𝗰𝗼𝗺𝗽𝗮𝗿𝗲 [] == ![]? - Surprisingly, this evaluates to true. The right side ![] coerces to false, then [] == false causes both sides to convert to numbers - An empty array converts to 0, and false converts to 0, so 0 == 0 is true 𝟯. 𝗘𝘅𝗽𝗹𝗮𝗶𝗻 𝘄𝗵𝘆 𝘁𝘆𝗽𝗲𝗼𝗳 𝗡𝗮𝗡 𝗿𝗲𝘁𝘂𝗿𝗻𝘀 "𝗻𝘂𝗺𝗯𝗲𝗿" - NaN stands for "Not-a-Number" but ironically, its type is "number" because it represents an invalid numeric operation result. - It's the only value in JavaScript that isn't equal to itself: NaN !== NaN is true. 𝟰. 𝗪𝗵𝗮𝘁 𝗶𝘀 𝘁𝗵𝗲 𝘁𝗲𝗺𝗽𝗼𝗿𝗮𝗹 𝗱𝗲𝗮𝗱 𝘇𝗼𝗻𝗲 (𝗧𝗗𝗭)? - The TDZ is the period between entering a scope and the actual declaration being reached for let and const variables. - Accessing these variables during the TDZ throws a ReferenceError, even though they are hoisted. 𝟱. 𝗪𝗵𝘆 𝗰𝗮𝗻 𝘆𝗼𝘂 𝗮𝗱𝗱 𝗽𝗿𝗼𝗽𝗲𝗿𝘁𝗶𝗲𝘀 𝘁𝗼 𝗳𝘂𝗻𝗰𝘁𝗶𝗼𝗻𝘀 𝗶𝗻 𝗝𝗮𝘃𝗮𝗦𝗰𝗿𝗶𝗽𝘁? - Functions in JavaScript are first-class objects, meaning they can have properties and methods just like any other object. - You can attach data or behavior to functions: myFunc.cache = {} or myFunc.count = 0. 𝟲. 𝗪𝗵𝗮𝘁'𝘀 𝘁𝗵𝗲 𝗱𝗶𝗳𝗳𝗲𝗿𝗲𝗻𝗰𝗲 𝗯𝗲𝘁𝘄𝗲𝗲𝗻 𝗺𝗶𝗰𝗿𝗼𝘁𝗮𝘀𝗸𝘀 𝗮𝗻𝗱 𝗺𝗮𝗰𝗿𝗼𝘁𝗮𝘀𝗸𝘀? - Microtasks execute after the current script but before the next macrotask. Macrotasks (setTimeout, setInterval, I/O) execute in the next iteration of the event loop. 𝟳. 𝗘𝘅𝗽𝗹𝗮𝗶𝗻 𝗵𝗼𝘄 𝗻𝗲𝘄 𝗸𝗲𝘆𝘄𝗼𝗿𝗱 𝘄𝗼𝗿𝗸𝘀 𝗶𝗻𝘁𝗲𝗿𝗻𝗮𝗹𝗹𝘆 - When you use new, JavaScript creates an empty object, sets the object's prototype to the constructor's prototype,executes the constructor with this bound to the new object, and returns the object. 𝟴. 𝗪𝗵𝗮𝘁 𝗶𝘀 𝗳𝘂𝗻𝗰𝘁𝗶𝗼𝗻 𝗰𝗼𝗺𝗽𝗼𝘀𝗶𝘁𝗶𝗼𝗻 𝗮𝗻𝗱 𝘄𝗵𝘆 𝗶𝘀 𝗶𝘁 𝘂𝘀𝗲𝗳𝘂𝗹? - Function composition is combining multiple functions where the output of one function becomes the input of another. It promotes code reusability, readability, and follows functional programming principles. 𝟵. 𝗪𝗵𝘆 𝗱𝗼𝗲𝘀 [𝟭, 𝟮, 𝟯].𝗺𝗮𝗽(𝗽𝗮𝗿𝘀𝗲𝗜𝗻𝘁) 𝗻𝗼𝘁 𝘄𝗼𝗿𝗸 𝗮𝘀 𝗲𝘅𝗽𝗲𝗰𝘁𝗲𝗱? - This returns [1, NaN, NaN] because map passes three arguments to the callback. parseInt(string, radix) uses the index as radix, causing parseInt('1', 0), parseInt('2', 1), parseInt('3', 2), where base 1 and base 2 (for '3') are invalid. 𝟭𝟬. 𝗪𝗵𝗮𝘁 𝗮𝗿𝗲 𝘁𝗮𝗴𝗴𝗲𝗱 𝘁𝗲𝗺𝗽𝗹𝗮𝘁𝗲 𝗹𝗶𝘁𝗲𝗿𝗮𝗹𝘀? - Tagged templates allow you to parse template literals with a function. The function receives an array of string values and the interpolated values separately. Follow Sakshi Gawande for more such content 💓
To view or add a comment, sign in
Explore related topics
Explore content categories
- Career
- Productivity
- Finance
- Soft Skills & Emotional Intelligence
- Project Management
- Education
- Technology
- Leadership
- Ecommerce
- User Experience
- Recruitment & HR
- Customer Experience
- Real Estate
- Marketing
- Sales
- Retail & Merchandising
- Science
- Supply Chain Management
- Future Of Work
- Consulting
- Writing
- Economics
- Artificial Intelligence
- Employee Experience
- Workplace Trends
- Fundraising
- Networking
- Corporate Social Responsibility
- Negotiation
- Communication
- Engineering
- Hospitality & Tourism
- Business Strategy
- Change Management
- Organizational Culture
- Design
- Innovation
- Event Planning
- Training & Development