{"id":2475,"date":"2024-04-22T08:11:00","date_gmt":"2024-04-22T08:11:00","guid":{"rendered":"https:\/\/www.hirist.tech\/blog\/?p=2475"},"modified":"2025-02-07T07:17:27","modified_gmt":"2025-02-07T07:17:27","slug":"top-40-javascript-interview-questions-answers-2024-hirist","status":"publish","type":"post","link":"https:\/\/www.hirist.tech\/blog\/top-40-javascript-interview-questions-answers-2024-hirist\/","title":{"rendered":"Top 60+ JavaScript Interview Questions and Answers"},"content":{"rendered":"\n<p>Research shows that JavaScript is used in&nbsp;12%&nbsp;of all technical interviews. However, only&nbsp;42%&nbsp;of candidates pass these interviews. That&#8217;s why it is important to prepare in advance. And this is where our guide can help you. We&#8217;ve put together a comprehensive list of the top 60+&nbsp;<strong>JavaScript interview questions<\/strong>&nbsp;with clear and straightforward answers.<\/p>\n\n\n\n<p>Whether you&#8217;re an experienced developer or a fresher ready for your first interview, these questions cover basic and advanced JavaScript topics.<\/p>\n\n\n\n<p>So, let&#8217;s get started!<\/p>\n\n\n\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_65 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title \" >Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/www.hirist.tech\/blog\/top-40-javascript-interview-questions-answers-2024-hirist\/#About_JavaScript\" title=\"About JavaScript\">About JavaScript<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/www.hirist.tech\/blog\/top-40-javascript-interview-questions-answers-2024-hirist\/#JavaScript_Interview_Questions_for_Freshers\" title=\"JavaScript Interview Questions for Freshers\">JavaScript Interview Questions for Freshers<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/www.hirist.tech\/blog\/top-40-javascript-interview-questions-answers-2024-hirist\/#JavaScript_Interview_Questions_for_Experienced\" title=\"JavaScript Interview Questions for Experienced\">JavaScript Interview Questions for Experienced<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/www.hirist.tech\/blog\/top-40-javascript-interview-questions-answers-2024-hirist\/#JavaScript_Interview_Questions_for_2_Year_Experience\" title=\"JavaScript Interview Questions for 2 Year Experience\">JavaScript Interview Questions for 2 Year Experience<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/www.hirist.tech\/blog\/top-40-javascript-interview-questions-answers-2024-hirist\/#JavaScript_Interview_Questions_for_3_Year_Experience\" title=\"JavaScript Interview Questions for 3 Year Experience\">JavaScript Interview Questions for 3 Year Experience<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/www.hirist.tech\/blog\/top-40-javascript-interview-questions-answers-2024-hirist\/#JavaScript_Interview_Questions_for_5_Years_Experienced\" title=\"JavaScript Interview Questions for 5 Years Experienced\">JavaScript Interview Questions for 5 Years Experienced<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/www.hirist.tech\/blog\/top-40-javascript-interview-questions-answers-2024-hirist\/#JavaScript_Interview_Questions_for_8_Years_Experienced\" title=\"JavaScript Interview Questions for 8 Years Experienced\">JavaScript Interview Questions for 8 Years Experienced<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/www.hirist.tech\/blog\/top-40-javascript-interview-questions-answers-2024-hirist\/#JavaScript_Interview_Questions_for_10_Years_Experienced\" title=\"JavaScript Interview Questions for 10 Years Experienced\">JavaScript Interview Questions for 10 Years Experienced<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/www.hirist.tech\/blog\/top-40-javascript-interview-questions-answers-2024-hirist\/#Advanced_JavaScript_Interview_Questions\" title=\"Advanced JavaScript Interview Questions\">Advanced JavaScript Interview Questions<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-10\" href=\"https:\/\/www.hirist.tech\/blog\/top-40-javascript-interview-questions-answers-2024-hirist\/#JavaScript_Design_Pattern_Interview_Questions\" title=\"JavaScript Design Pattern Interview Questions\">JavaScript Design Pattern Interview Questions<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-11\" href=\"https:\/\/www.hirist.tech\/blog\/top-40-javascript-interview-questions-answers-2024-hirist\/#JavaScript_Closure_Interview_Question\" title=\"JavaScript Closure Interview Question\">JavaScript Closure Interview Question<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-12\" href=\"https:\/\/www.hirist.tech\/blog\/top-40-javascript-interview-questions-answers-2024-hirist\/#this_Keyword_in_JavaScript_Interview_Questions\" title=\"this Keyword in JavaScript Interview Questions\">this Keyword in JavaScript Interview Questions<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-13\" href=\"https:\/\/www.hirist.tech\/blog\/top-40-javascript-interview-questions-answers-2024-hirist\/#JavaScript_Console_Log_Interview_Questions\" title=\"JavaScript Console Log Interview Questions\">JavaScript Console Log Interview Questions<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-14\" href=\"https:\/\/www.hirist.tech\/blog\/top-40-javascript-interview-questions-answers-2024-hirist\/#DOM_Manipulation_Interview_Questions\" title=\"DOM Manipulation Interview Questions\">DOM Manipulation Interview Questions<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-15\" href=\"https:\/\/www.hirist.tech\/blog\/top-40-javascript-interview-questions-answers-2024-hirist\/#JavaScript_Problem_Solving_Questions\" title=\"JavaScript Problem Solving Questions\">JavaScript Problem Solving Questions<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-16\" href=\"https:\/\/www.hirist.tech\/blog\/top-40-javascript-interview-questions-answers-2024-hirist\/#JavaScript_Logical_Questions\" title=\"JavaScript Logical Questions\">JavaScript Logical Questions<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-17\" href=\"https:\/\/www.hirist.tech\/blog\/top-40-javascript-interview-questions-answers-2024-hirist\/#JavaScript_Object_Oriented_Programming_Interview_Questions\" title=\"JavaScript Object Oriented Programming Interview Questions\">JavaScript Object Oriented Programming Interview Questions<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-18\" href=\"https:\/\/www.hirist.tech\/blog\/top-40-javascript-interview-questions-answers-2024-hirist\/#Object_Oriented_JavaScript_Interview_Questions_and_Answers_for_Experienced\" title=\"Object Oriented JavaScript Interview Questions and Answers for Experienced\">Object Oriented JavaScript Interview Questions and Answers for Experienced<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-19\" href=\"https:\/\/www.hirist.tech\/blog\/top-40-javascript-interview-questions-answers-2024-hirist\/#JavaScript_Output_Based_Questions\" title=\"JavaScript Output Based Questions\">JavaScript Output Based Questions<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-20\" href=\"https:\/\/www.hirist.tech\/blog\/top-40-javascript-interview-questions-answers-2024-hirist\/#JavaScript_Programs_for_Interview\" title=\"JavaScript Programs for Interview\">JavaScript Programs for Interview<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-21\" href=\"https:\/\/www.hirist.tech\/blog\/top-40-javascript-interview-questions-answers-2024-hirist\/#JavaScript_Coding_Interview_Questions\" title=\"JavaScript Coding Interview Questions\">JavaScript Coding Interview Questions<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-22\" href=\"https:\/\/www.hirist.tech\/blog\/top-40-javascript-interview-questions-answers-2024-hirist\/#JavaScript_MCQ_Question_and_Answer\" title=\"JavaScript MCQ Question and Answer\">JavaScript MCQ Question and Answer<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-23\" href=\"https:\/\/www.hirist.tech\/blog\/top-40-javascript-interview-questions-answers-2024-hirist\/#Wrapping_Up\" title=\"Wrapping Up\">Wrapping Up<\/a><\/li><\/ul><\/nav><\/div>\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"About_JavaScript\"><\/span>About JavaScript<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>JavaScript&nbsp;is a programming language used in web development to make websites interactive.&nbsp;<\/p>\n\n\n\n<p>It adds behaviour to websites, letting them respond to user actions like form validation, animation, and data fetching without reloading the page.&nbsp;<\/p>\n\n\n\n<p>JavaScript works on both front-end and <a href=\"https:\/\/www.hirist.tech\/c\/backend-developer-jobs.html?ref=blog\" target=\"_blank\" rel=\"noreferrer noopener\">back-end development<\/a>, making it versatile for creating responsive and engaging web applications.<\/p>\n\n\n\n<p>According to&nbsp;Statista, JavaScript is the top choice for web development, with about 63.61% of developers worldwide preferring it.&nbsp;<\/p>\n\n\n\n<p>JavaScript is also in high demand in India&#8217;s tech industry due to its crucial role in web development and the rise of digital initiatives.<\/p>\n\n\n\n<p>To find the perfect <a href=\"https:\/\/www.hirist.tech\/k\/javascript-jobs.html?ref=blog\" target=\"_blank\" rel=\"noreferrer noopener\">JavaScript job<\/a>, use&nbsp;Hirist, India&#8217;s top IT job portal. Here, you can search for JavaScript jobs, choose your preferred location and experience level, and easily apply for jobs that fit your skills.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"JavaScript_Interview_Questions_for_Freshers\"><\/span>JavaScript Interview Questions for Freshers<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Here are some commonly asked <strong>basic interview questions on JavaScript<\/strong>, along with their answers.<\/p>\n\n\n\n<ol>\n<li>What is JavaScript?&nbsp;<\/li>\n<\/ol>\n\n\n\n<p>JavaScript is a <a href=\"https:\/\/www.hirist.tech\/blog\/top-10-most-popular-programming-languages-of-the-future\/\" target=\"_blank\" rel=\"noreferrer noopener\">programming language<\/a> used to create interactive elements on websites. It runs in web browsers and can manipulate webpage content, respond to user actions, and interact with servers.<\/p>\n\n\n\n<ol start=\"2\">\n<li>What are variables in JavaScript?&nbsp;<\/li>\n<\/ol>\n\n\n\n<p>Variables are used to store data values in JavaScript. They can hold different types of data like numbers, strings (text), and boolean (true\/false) values.<\/p>\n\n\n\n<ol start=\"3\">\n<li>What are the different data types in JavaScript?&nbsp;<\/li>\n<\/ol>\n\n\n\n<p>JavaScript has several data types, including,&nbsp;<\/p>\n\n\n\n<ul>\n<li><strong>Number:<\/strong> Represents both integer and decimal (floating-point) numbers.<\/li>\n\n\n\n<li><strong>String:<\/strong> Represents sequences of characters or alphanumeric values.<\/li>\n\n\n\n<li><strong>Boolean:<\/strong> Represents true or false values.<\/li>\n\n\n\n<li><strong>Object:<\/strong> Represents collections of properties and complex values.<\/li>\n\n\n\n<li><strong>Null:<\/strong> Represents values that are intentionally empty or unknown.<\/li>\n\n\n\n<li><strong>Undefined:<\/strong> Indicates variables that have been declared but not assigned a value.<\/li>\n\n\n\n<li><strong>Symbols:<\/strong> Provides unique identifiers for objects and supports special use cases.<\/li>\n<\/ul>\n\n\n\n<ol start=\"4\">\n<li>How do you declare a variable in JavaScript?&nbsp;<\/li>\n<\/ol>\n\n\n\n<p>You can declare a variable using the var, let, or const keywords followed by the variable name.&nbsp;<\/p>\n\n\n\n<p><strong>For example:<\/strong><\/p>\n\n\n\n<p>var myNumber = 10;<\/p>\n\n\n\n<p>let myName = \u201cRahul\u201d;<\/p>\n\n\n\n<p>const PI = 3.14;<\/p>\n\n\n\n<ol start=\"5\">\n<li>What is an event in JavaScript?&nbsp;<\/li>\n<\/ol>\n\n\n\n<p>An event is an action that occurs on a webpage, such as clicking a button or submitting a form. JavaScript can respond to these events by executing specific functions.<\/p>\n\n\n\n<ol start=\"6\">\n<li>How do you create a function in JavaScript?&nbsp;<\/li>\n<\/ol>\n\n\n\n<p>You can create a function using the function keyword followed by the function name and parameters.&nbsp;<\/p>\n\n\n\n<p><strong>For example:<\/strong><\/p>\n\n\n\n<p>function greet(name) {<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;return \u201cHello, \u201d + name + \u201c!\u201d;<\/p>\n\n\n\n<p>}<\/p>\n\n\n\n<ol start=\"7\">\n<li>How do you add an event listener in JavaScript?&nbsp;<\/li>\n<\/ol>\n\n\n\n<p>You can add an event listener to an HTML element using the addEventListener method.&nbsp;<\/p>\n\n\n\n<p><strong>For example:<\/strong><\/p>\n\n\n\n<p>document.getElementById(\u201cmyButton\u201d).addEventListener(\u201cclick\u201d, function() {<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;alert(\u201cButton clicked!\u201d);<\/p>\n\n\n\n<p>});<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"JavaScript_Interview_Questions_for_Experienced\"><\/span>JavaScript Interview Questions for Experienced<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>We have categorized the commonly asked <strong>JS programming interview questions<\/strong> and answers based on candidates\u2019 experience levels.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"JavaScript_Interview_Questions_for_2_Year_Experience\"><\/span>JavaScript Interview Questions for 2 Year Experience<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>Here are some common <strong>JS interview questions<\/strong> and answers for candidates with 2 years of experience.&nbsp;<\/p>\n\n\n\n<ol start=\"8\">\n<li>What are closures in JavaScript?<\/li>\n<\/ol>\n\n\n\n<p>A closure is a feature in JavaScript that allows a function to remember and access its lexical scope even when it\u2019s executed outside that scope. It helps in maintaining private variables and creating modular code.<\/p>\n\n\n\n<ol start=\"9\">\n<li>Explain the difference between let, const, and var.<\/li>\n<\/ol>\n\n\n\n<p>var is used to declare variables with function scope, while let and const have block scope (limited to the nearest curly braces). Variables declared with const cannot be changed after assignment, but variables declared with let can.<\/p>\n\n\n\n<ol start=\"10\">\n<li>What is the difference between synchronous and asynchronous code in JavaScript?<\/li>\n<\/ol>\n\n\n\n<p>Synchronous code runs line by line and blocks further execution until each line finishes. Asynchronous code allows tasks to run in the background and doesn\u2019t wait for them to complete before moving on.<\/p>\n\n\n\n<ol start=\"11\">\n<li>How does prototypal inheritance work in JavaScript?<\/li>\n<\/ol>\n\n\n\n<p>JavaScript uses prototypal inheritance, where objects can inherit properties and methods from other objects. Each object has a prototype object from which it inherits properties.<\/p>\n\n\n\n<ol start=\"12\">\n<li>Explain the concept of event bubbling and event delegation.<\/li>\n<\/ol>\n\n\n\n<p>Event bubbling refers to the propagation of an event from the innermost element to the outermost element in the DOM hierarchy. Event delegation is a technique where a parent element handles events triggered by its child elements.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"JavaScript_Interview_Questions_for_3_Year_Experience\"><\/span>JavaScript Interview Questions for 3 Year Experience<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>Here are some important <strong>JS interview questions<\/strong> for candidates with 3 years of experience.&nbsp;<\/p>\n\n\n\n<ol start=\"13\">\n<li>What are Promises in JavaScript?<\/li>\n<\/ol>\n\n\n\n<p>Promises are used for asynchronous programming in JavaScript. They represent the eventual completion or failure of an asynchronous operation, allowing you to handle the result or error once it\u2019s available.<\/p>\n\n\n\n<ol start=\"14\">\n<li>Explain the concept of higher-order functions.<\/li>\n<\/ol>\n\n\n\n<p>Higher-order functions are functions that can take other functions as arguments or return functions as their results. They enable functional programming paradigms like map, filter, and reduce.<\/p>\n\n\n\n<ol start=\"15\">\n<li>Explain the concept of the \u201cthis\u201d keyword in JavaScript.<\/li>\n<\/ol>\n\n\n\n<p>It is one of the most commonly asked <strong>JavaScript this interview questions<\/strong>.&nbsp;<\/p>\n\n\n\n<p>In JavaScript, the \u201cthis\u201d keyword refers to the current execution context or the \u201cowner\u201d of the function being executed. The value of \u201cthis\u201d is determined by how a function is called. It is not fixed and can change based on the invocation context.<\/p>\n\n\n\n<ol start=\"16\">\n<li>What is the event loop in JavaScript, and how does it work?<\/li>\n<\/ol>\n\n\n\n<p>The event loop is a mechanism that handles asynchronous operations in JavaScript. It continuously checks the call stack and task queue, moving tasks from the queue to the stack for execution when the stack is empty.<\/p>\n\n\n\n<ol start=\"17\">\n<li>What is the difference between == and === in JavaScript?<\/li>\n<\/ol>\n\n\n\n<p>== is used for loose equality comparison and performs type coercion if needed, while === is used for strict equality comparison (checking both value and type) without type coercion.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"JavaScript_Interview_Questions_for_5_Years_Experienced\"><\/span>JavaScript Interview Questions for 5 Years Experienced<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>Here are some important <strong>JS interview questions<\/strong> for candidates with 5 years of experience.&nbsp;<\/p>\n\n\n\n<ol start=\"18\">\n<li>What are generators in JavaScript, and how are they used?<\/li>\n<\/ol>\n\n\n\n<p>Generators are functions that can be paused and resumed at certain points using the yield keyword. They allow for asynchronous-like behaviour in synchronous code and are often used for iterative algorithms and handling streams of data. Generators also allow you to take advantage of WeakRef and FinalizationRegistry to handle objects in memory more efficiently.<\/p>\n\n\n\n<ol start=\"19\">\n<li>Explain the concept of ES6 modules in JavaScript.<\/li>\n<\/ol>\n\n\n\n<p>ES6 modules provide a way to organize and structure code into reusable components. They use import and export statements to define dependencies between modules, allowing for better code organization and maintainability.<\/p>\n\n\n\n<ol start=\"20\">\n<li>How does JavaScript handle memory management and garbage collection?<\/li>\n<\/ol>\n\n\n\n<p>JavaScript uses automatic memory management through garbage collection. It allocates memory when objects are created and automatically frees up memory when objects are no longer in use or unreachable by the program.&nbsp;<\/p>\n\n\n\n<p>Common garbage collection algorithms include reference counting and mark-and-sweep.<\/p>\n\n\n\n<ol start=\"21\">\n<li>What is the difference between function declaration and function expression?<\/li>\n<\/ol>\n\n\n\n<p>Function declarations are hoisted and can be called before they are defined in the code, while function expressions are not hoisted and must be defined before they are called. Function expressions can also be anonymous (no function name).<\/p>\n\n\n\n<ol start=\"22\">\n<li>What are some best practices for optimizing JavaScript performance?&nbsp;<\/li>\n<\/ol>\n\n\n\n<p>Some best practices include,<\/p>\n\n\n\n<ul>\n<li>Minimizing DOM manipulation<\/li>\n\n\n\n<li>Using efficient data structures like arrays and objects<\/li>\n\n\n\n<li>Reducing unnecessary function calls<\/li>\n\n\n\n<li>Caching variables for reuse<\/li>\n\n\n\n<li>Using browser developer tools to profile and optimize code<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"JavaScript_Interview_Questions_for_8_Years_Experienced\"><\/span>JavaScript Interview Questions for 8 Years Experienced<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>If you have around 8 years of work experience, you might come across such JavaScript interview questions.<\/p>\n\n\n\n<ol start=\"23\">\n<li>How does WeakMap differ from Map?<\/li>\n<\/ol>\n\n\n\n<p>WeakMap keys must be objects, and they are weakly held, meaning they can be garbage collected.<\/p>\n\n\n\n<ol start=\"24\">\n<li>What is tail call optimization in JavaScript?<\/li>\n<\/ol>\n\n\n\n<p>Tail call optimization allows functions to reuse stack frames when making recursive calls in tail position, improving performance.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"JavaScript_Interview_Questions_for_10_Years_Experienced\"><\/span>JavaScript Interview Questions for 10 Years Experienced<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>Here are some important <strong>JavaScript interview questions<\/strong> for candidates with 10 years of experience.&nbsp;<\/p>\n\n\n\n<ol start=\"25\">\n<li>What are the differences between classical inheritance and prototypal inheritance in JavaScript?<\/li>\n<\/ol>\n\n\n\n<p>Classical inheritance involves defining classes and creating instances of those classes using constructors and inheritance hierarchies.&nbsp;<\/p>\n\n\n\n<p>Prototypal inheritance, on the other hand, uses prototypes to share behaviour between objects, allowing for more flexible and dynamic object creation.<\/p>\n\n\n\n<ol start=\"26\">\n<li>What are the advantages and disadvantages of using closures in JavaScript?<\/li>\n<\/ol>\n\n\n\n<p>Closures in JavaScript allow functions to retain access to variables from their parent scopes, enabling encapsulation and private data.&nbsp;<\/p>\n\n\n\n<p>However, excessive use of closures can lead to memory leaks if not managed properly, as they maintain references to outer scope variables.<\/p>\n\n\n\n<ol start=\"27\">\n<li>What are some common design patterns used in JavaScript development?<\/li>\n<\/ol>\n\n\n\n<p>Common design patterns in JavaScript include the Singleton pattern, Factory pattern, Module pattern, Observer pattern, and Promises pattern.&nbsp;<\/p>\n\n\n\n<p>These patterns help in structuring and organizing code to promote reusability, maintainability, and scalability.<\/p>\n\n\n\n<ol start=\"28\">\n<li>How does JavaScript handle error handling, and what are the best practices for managing errors in production code?<\/li>\n<\/ol>\n\n\n\n<p>JavaScript uses try-catch blocks to handle synchronous errors and .catch() methods for handling Promise rejections in asynchronous code.&nbsp;<\/p>\n\n\n\n<p>Best practices for managing errors include,<\/p>\n\n\n\n<ul>\n<li>Logging errors with relevant information<\/li>\n\n\n\n<li>Implementing graceful error recovery strategies<\/li>\n\n\n\n<li>Using tools like error monitoring services to track and analyze production errors.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Advanced_JavaScript_Interview_Questions\"><\/span>Advanced JavaScript Interview Questions<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Take a look at these advanced <strong>JavaScript programming questions and answers<\/strong>.<\/p>\n\n\n\n<ol start=\"29\">\n<li>Explain the concept of lexical scoping in JavaScript.<\/li>\n<\/ol>\n\n\n\n<p>Lexical scoping in JavaScript means that the scope of a variable is determined by its position within the source code\u2019s lexical structure. Inner functions have access to variables declared in their outer function\u2019s scope.<\/p>\n\n\n\n<ol start=\"30\">\n<li>What is the NaN property in JavaScript?<\/li>\n<\/ol>\n\n\n\n<p>The NaN property in JavaScript represents a value that is \u201cNot-a-Number.\u201d It indicates that a value is not a valid number. If a calculation or operation results in a value that is not a number, it will return NaN.&nbsp;<\/p>\n\n\n\n<p>To check if a value is NaN, you can use the Number.isNaN() function, which is more reliable than isNaN().<\/p>\n\n\n\n<ol start=\"31\">\n<li>What are the various types of errors in JavaScript?<\/li>\n<\/ol>\n\n\n\n<p>JavaScript errors can be categorized into three types:<\/p>\n\n\n\n<ul>\n<li><strong>Load time errors<\/strong>: These errors occur while a web page is loading. They include syntax errors that are identified dynamically during the loading process.<\/li>\n\n\n\n<li><strong>Runtime errors<\/strong>: These errors happen when a command is used incorrectly in HTML.<\/li>\n\n\n\n<li><strong>Logical errors<\/strong>: These errors result from flawed logic within a function, leading to unexpected outcomes or incorrect behaviour during execution.<\/li>\n<\/ul>\n\n\n\n<ol start=\"32\">\n<li>How is DOM used in JavaScript?<\/li>\n<\/ol>\n\n\n\n<p>The DOM (Document Object Model) in JavaScript controls how different elements in a web page interact with each other.&nbsp;<\/p>\n\n\n\n<p>It allows developers to manipulate objects like links and paragraphs on a web page, enabling actions such as adding or removing them dynamically. Using the DOM API simplifies web development compared to other models.&nbsp;<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"JavaScript_Design_Pattern_Interview_Questions\"><\/span>JavaScript Design Pattern Interview Questions<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Here are a few important JavaScript interview questions on design pattern.<\/p>\n\n\n\n<ol start=\"33\">\n<li>What is the Singleton Pattern, and when would you use it in JavaScript?<\/li>\n<\/ol>\n\n\n\n<p>The Singleton pattern ensures that a class has only one instance and provides a global point of access to it. In JavaScript, it&#8217;s often used for managing global states or shared resources across an application.<\/p>\n\n\n\n<p>Example:<\/p>\n\n\n\n<p>class Singleton {<\/p>\n\n\n\n<p>&nbsp;&nbsp;constructor() {<\/p>\n\n\n\n<p>if (!Singleton.instance) {<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Singleton.instance = this;<\/p>\n\n\n\n<p>}<\/p>\n\n\n\n<p>return Singleton.instance;<\/p>\n\n\n\n<p>&nbsp;&nbsp;}<\/p>\n\n\n\n<p>}<\/p>\n\n\n\n<ol start=\"34\">\n<li>Explain the Module Pattern in JavaScript.<\/li>\n<\/ol>\n\n\n\n<p>The Module pattern is a design pattern used to organize and encapsulate code, making it more maintainable. It uses closures to create private variables and expose only the necessary methods. It&#8217;s commonly used for creating reusable components in JavaScript.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"JavaScript_Closure_Interview_Question\"><\/span>JavaScript Closure Interview Question<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Let\u2019s take a look at some JavaScript interview questions and answers on Closure.<\/p>\n\n\n\n<ol start=\"35\">\n<li>How do closures help in creating private variables in JavaScript?<\/li>\n<\/ol>\n\n\n\n<p>Closures allow a function to access variables from its outer scope even after the outer function has finished executing. This enables the creation of private variables, which can&#8217;t be accessed directly from outside the function, ensuring data encapsulation.<\/p>\n\n\n\n<ol start=\"36\">\n<li>What happens when a closure retains references to its parent scope variables?<\/li>\n<\/ol>\n\n\n\n<p>A closure retains references to variables in its parent scope, even after the parent function has executed. This allows the closure to keep the variables alive and access them when needed. However, improper use of closures can lead to memory leaks, especially when the references are not cleaned up.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"this_Keyword_in_JavaScript_Interview_Questions\"><\/span>this Keyword in JavaScript Interview Questions<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Here are some important JavaScript interview questions about this keyword.<\/p>\n\n\n\n<ol start=\"37\">\n<li>How does the value of this change inside an arrow function?<\/li>\n<\/ol>\n\n\n\n<p>Arrow functions do not have their own this. They inherit this from the surrounding lexical scope.<\/p>\n\n\n\n<ol start=\"38\">\n<li>What happens when this is used inside a constructor function?<\/li>\n<\/ol>\n\n\n\n<p>Inside a constructor, this refers to the newly created object. It allows properties and methods to be assigned to it.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"JavaScript_Console_Log_Interview_Questions\"><\/span>JavaScript Console Log Interview Questions<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>These are some common JavaScript interview questions on Console Log.<\/p>\n\n\n\n<ol start=\"39\">\n<li>What will be logged in the console?<\/li>\n<\/ol>\n\n\n\n<p>console.log(0.1 + 0.2 === 0.3);<\/p>\n\n\n\n<p><strong>Output:<\/strong> false (Floating-point precision issue in JavaScript.)<\/p>\n\n\n\n<ol start=\"40\">\n<li>What happens if you call console.log(a) before declaring a with let?<\/li>\n<\/ol>\n\n\n\n<p>It throws a ReferenceError because let variables are not hoisted like var.<\/p>\n\n\n\n<p><strong>JavaScript Data Structures Interview Questions<\/strong><\/p>\n\n\n\n<p>Here are JavaScript interview questions related to data structures and their answers.<\/p>\n\n\n\n<ol start=\"41\">\n<li>What is the difference between a queue and a stack?<\/li>\n<\/ol>\n\n\n\n<p>A stack follows <strong>LIFO<\/strong> (Last In, First Out), while a queue follows <strong>FIFO<\/strong> (First In, First Out).<\/p>\n\n\n\n<ol start=\"42\">\n<li>How can you implement a set using an object in JavaScript?<\/li>\n<\/ol>\n\n\n\n<p>Use an object where keys represent unique values.<\/p>\n\n\n\n<p>let mySet = {};<\/p>\n\n\n\n<p>mySet[5] = true;<\/p>\n\n\n\n<p>mySet[&#8220;hello&#8221;] = true;<\/p>\n\n\n\n<p>console.log(Object.keys(mySet)); \/\/ [&#8220;5&#8221;, &#8220;hello&#8221;]<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"DOM_Manipulation_Interview_Questions\"><\/span>DOM Manipulation Interview Questions<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<ol start=\"43\">\n<li>How do you dynamically create an HTML element using JavaScript?<\/li>\n<\/ol>\n\n\n\n<p>Use document.createElement(), then append it to the DOM.<\/p>\n\n\n\n<p>let div = document.createElement(&#8220;div&#8221;);<\/p>\n\n\n\n<p>div.textContent = &#8220;Hello&#8221;;<\/p>\n\n\n\n<p>document.body.appendChild(div);<\/p>\n\n\n\n<ol start=\"44\">\n<li>How do you remove an element from the DOM using JavaScript?<\/li>\n<\/ol>\n\n\n\n<p>Use removeChild() or remove().<\/p>\n\n\n\n<p>document.getElementById(&#8220;myElement&#8221;).remove();<\/p>\n\n\n\n<pre class=\"wp-block-verse\"><strong>Also Read - <a href=\"https:\/\/www.hirist.tech\/blog\/top-25-html-css-javascript-interview-questions-and-answers\/\" target=\"_blank\" rel=\"noreferrer noopener\">Top 40+ HTML CSS JavaScript Interview Questions and Answers<\/a><\/strong><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"JavaScript_Problem_Solving_Questions\"><\/span>JavaScript Problem Solving Questions<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>These are some important problem-solving <strong>JavaScript interview questions and answers<\/strong>.&nbsp;<\/p>\n\n\n\n<ol start=\"45\">\n<li>Find the maximum element in an array.<\/li>\n<\/ol>\n\n\n\n<p>function findMaxElement(arr) {<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;if (arr.length === 0) {<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return null; \/\/ Return null for empty array<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;}<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;let max = arr[0]; \/\/ Initialize max with the first element<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;for (let i = 1; i &lt; arr.length; i++) {<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (arr[i] &gt; max) {<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;max = arr[i]; \/\/ Update max if current element is greater<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;}<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;return max; \/\/ Return the maximum element&nbsp;<\/p>\n\n\n\n<p>}<\/p>\n\n\n\n<p>\/\/ Example usage:<\/p>\n\n\n\n<p>let numbers = [10, 5, 8, 15, 3];<\/p>\n\n\n\n<p>console.log(findMaxElement(numbers)); \/\/ Output: 15<\/p>\n\n\n\n<ol start=\"46\">\n<li>Count the number of vowels in a given string.<\/li>\n<\/ol>\n\n\n\n<p>function countVowels(str) {<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;const vowels = \u2018aeiouAEIOU\u2019;<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;let count = 0;<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;for (let char of str) {<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (vowels.includes(char)) {<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;count++;<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;}<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;return count;<\/p>\n\n\n\n<p>}<\/p>\n\n\n\n<p>\/\/ Example usage:<\/p>\n\n\n\n<p>let text = \u201cHello World\u201d;<\/p>\n\n\n\n<p>console.log(countVowels(text)); \/\/ Output: 3 (e, o, o)<\/p>\n\n\n\n<ol start=\"47\">\n<li>Calculate the Fibonacci sequence up to n numbers using recursion.<\/li>\n<\/ol>\n\n\n\n<p>function fibonacci(n) {<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;if (n &lt;= 0) {<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return [];<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;}<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;if (n === 1) {<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return [0];<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;}<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;const sequence = [0, 1];<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;for (let i = 2; i &lt; n; i++) {<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;sequence.push(sequence[i \u2013 1] + sequence[i \u2013 2]);<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;}<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;return sequence;<\/p>\n\n\n\n<p>}<\/p>\n\n\n\n<p>\/\/ Example usage:<\/p>\n\n\n\n<p>let count = 8;<\/p>\n\n\n\n<p>console.log(fibonacci(count)); \/\/ Output: [0, 1, 1, 2, 3, 5, 8, 13]<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"JavaScript_Logical_Questions\"><\/span>JavaScript Logical Questions<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>You might also come across logical JavaScript interview questions like these.<\/p>\n\n\n\n<ol start=\"48\">\n<li>What will the following code output, and why?<\/li>\n<\/ol>\n\n\n\n<p>console.log([] == []);<\/p>\n\n\n\n<p><strong>Answer:<\/strong> false<\/p>\n\n\n\n<p><strong>Explanation: <\/strong>In JavaScript, arrays are reference types, so two distinct array instances are not considered equal, even if they contain the same elements.<\/p>\n\n\n\n<ol start=\"49\">\n<li>What is the result of the following expression, and why?<\/li>\n<\/ol>\n\n\n\n<p>console.log(&#8216;5&#8217; + 3);<\/p>\n\n\n\n<p><strong>Answer:<\/strong> &#8220;53&#8221;<\/p>\n\n\n\n<p><strong>Explanation:<\/strong> The + operator in JavaScript performs string concatenation when one of the operands is a string. Here, the string &#8216;5&#8217; is concatenated with the number 3, resulting in the string &#8217;53&#8217;.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"JavaScript_Object_Oriented_Programming_Interview_Questions\"><\/span>JavaScript Object Oriented Programming Interview Questions<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Here are some important <strong>JavaScript OOP interview questions<\/strong> and answers.<\/p>\n\n\n\n<ol start=\"50\">\n<li>What is Object-Oriented Programming (OOP)?<\/li>\n<\/ol>\n\n\n\n<p>Object-Oriented Programming (OOP) is a way of writing programs that use objects to structure and handle data. This approach emphasizes reusing code and breaking down complex tasks into simpler parts.<\/p>\n\n\n\n<ol start=\"51\">\n<li>What are some benefits of using OOP in JavaScript?<\/li>\n<\/ol>\n\n\n\n<p>Using Object-Oriented Programming (OOP) in JavaScript offers several advantages. It enhances code organization, promotes code reuse, and facilitates easier maintenance.&nbsp;<\/p>\n\n\n\n<p>Additionally, OOP allows developers to model real-world objects and concepts more naturally within their codebase.<\/p>\n\n\n\n<ol start=\"52\">\n<li>What is encapsulation in JavaScript?<\/li>\n<\/ol>\n\n\n\n<p>Encapsulation is the bundling of data (attributes) and methods (functions) that operate on the data into a single unit called an object. It allows objects to control access to their internal state and hide implementation details from the outside world.<\/p>\n\n\n\n<ol start=\"53\">\n<li>What is polymorphism in JavaScript?<\/li>\n<\/ol>\n\n\n\n<p>Polymorphism allows objects of different classes to be treated as objects of a common superclass.&nbsp;<\/p>\n\n\n\n<p>This means that different classes can implement the same method name but behave differently based on the specific class instance. Polymorphism enhances code reusability and flexibility in OOP.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Object_Oriented_JavaScript_Interview_Questions_and_Answers_for_Experienced\"><\/span>Object Oriented JavaScript Interview Questions and Answers for Experienced<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Here are a few JavaScript OOPS interview questions and answers for experienced.<\/p>\n\n\n\n<ol start=\"54\">\n<li>What is the difference between a class and an object in JavaScript?<\/li>\n<\/ol>\n\n\n\n<p>In JavaScript, a class is a blueprint for creating objects with shared properties and methods. An object, on the other hand, is an instance of a class, created using the new keyword. Classes define the structure, while objects hold the actual data.<\/p>\n\n\n\n<ol start=\"55\">\n<li>How do you implement inheritance in JavaScript using classes?<\/li>\n<\/ol>\n\n\n\n<p>In JavaScript, inheritance is implemented using the extends keyword in class declarations. A subclass inherits methods and properties from a superclass, allowing code reuse. For example:<\/p>\n\n\n\n<p>class Animal {<\/p>\n\n\n\n<p>&nbsp;&nbsp;speak() {<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;console.log(&#8220;Animal speaks&#8221;);<\/p>\n\n\n\n<p>&nbsp;&nbsp;}<\/p>\n\n\n\n<p>}<\/p>\n\n\n\n<p>class Dog extends Animal {<\/p>\n\n\n\n<p>&nbsp;&nbsp;speak() {<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;console.log(&#8220;Dog barks&#8221;);<\/p>\n\n\n\n<p>&nbsp;&nbsp;}<\/p>\n\n\n\n<p>}<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"JavaScript_Output_Based_Questions\"><\/span>JavaScript Output Based Questions<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Let\u2019s take a look at some output based JavaScript interview questions and answers.<\/p>\n\n\n\n<ol start=\"56\">\n<li>What will be the output of the following code?<\/li>\n<\/ol>\n\n\n\n<p>let obj = {<\/p>\n\n\n\n<p>&nbsp;&nbsp;value: 10,<\/p>\n\n\n\n<p>&nbsp;&nbsp;getValue: function() {<\/p>\n\n\n\n<p>return this.value;<\/p>\n\n\n\n<p>&nbsp;&nbsp;}<\/p>\n\n\n\n<p>};<\/p>\n\n\n\n<p>console.log(obj.getValue());<\/p>\n\n\n\n<p><strong>Output:<\/strong> 10 (The function is called on obj, so this refers to obj.)<\/p>\n\n\n\n<ol start=\"57\">\n<li>What will be the output of this code?<\/li>\n<\/ol>\n\n\n\n<p>console.log(typeof null);<\/p>\n\n\n\n<p><strong>Output: <\/strong>&#8220;object&#8221; (This is a known JavaScript quirk.)<\/p>\n\n\n\n<ol start=\"58\">\n<li>What will be the output of the following code : var a = -10.2256; console.log( typeof(a));<\/li>\n<\/ol>\n\n\n\n<p><strong>Output:<\/strong> number<\/p>\n\n\n\n<p><strong>Explanation:<\/strong><\/p>\n\n\n\n<p>In JavaScript, all numbers (integers and floating-point) have the type number. The typeof operator confirms this.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"JavaScript_Programs_for_Interview\"><\/span>JavaScript Programs for Interview<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<ol start=\"59\">\n<li>Write a function to reverse a string without using .reverse().<\/li>\n<\/ol>\n\n\n\n<p>function reverseString(str) {<\/p>\n\n\n\n<p>&nbsp;&nbsp;let reversed = &#8220;&#8221;;<\/p>\n\n\n\n<p>&nbsp;&nbsp;for (let char of str) {<\/p>\n\n\n\n<p>reversed = char + reversed;<\/p>\n\n\n\n<p>&nbsp;&nbsp;}<\/p>\n\n\n\n<p>&nbsp;&nbsp;return reversed;<\/p>\n\n\n\n<p>}<\/p>\n\n\n\n<ol start=\"60\">\n<li>Write a function to find the second largest number in an array.<\/li>\n<\/ol>\n\n\n\n<p>function secondLargest(arr) {<\/p>\n\n\n\n<p>&nbsp;&nbsp;let uniqueSorted = [&#8230;new Set(arr)].sort((a, b) =&gt; b &#8211; a);<\/p>\n\n\n\n<p>&nbsp;&nbsp;return uniqueSorted[1] || null;<\/p>\n\n\n\n<p>}<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"JavaScript_Coding_Interview_Questions\"><\/span>JavaScript Coding Interview Questions<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Here are commonly asked coding-related <strong>JavaScript practical questions<\/strong> and answers.<\/p>\n\n\n\n<ol start=\"61\">\n<li>Write a function to check if a given string is a palindrome (reads the same backward as forward).<\/li>\n<\/ol>\n\n\n\n<p>function isPalindrome(str) {<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;return str === str.split(\u201d).reverse().join(\u201d);<\/p>\n\n\n\n<p>}<\/p>\n\n\n\n<p>\/\/ Example usage:<\/p>\n\n\n\n<p>let text1 = \u201cracecar\u201d;<\/p>\n\n\n\n<p>let text2 = \u201chello\u201d;<\/p>\n\n\n\n<p>console.log(isPalindrome(text1)); \/\/ Output: true<\/p>\n\n\n\n<p>console.log(isPalindrome(text2)); \/\/ Output: false<\/p>\n\n\n\n<ol start=\"62\">\n<li>Write a function to find the factorial of a number.<\/li>\n<\/ol>\n\n\n\n<p>function factorial(n) {<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;if (n === 0 || n === 1) {<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return 1;<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;}<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;let result = 1;<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;for (let i = 2; i &lt;= n; i++) {<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;result *= i;<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;}<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;return result;<\/p>\n\n\n\n<p>}<\/p>\n\n\n\n<p>\/\/ Example usage:<\/p>\n\n\n\n<p>let num = 5;<\/p>\n\n\n\n<p>console.log(factorial(num)); \/\/ Output: 120 (5! = 5 * 4 * 3 * 2 * 1)<\/p>\n\n\n\n<ol start=\"63\">\n<li>Write a function to remove duplicate elements from an array.<\/li>\n<\/ol>\n\n\n\n<p>function removeDuplicates(arr) {<\/p>\n\n\n\n<p>return [&#8230;new Set(arr)];<\/p>\n\n\n\n<p>}<\/p>\n\n\n\n<p>The new Set(arr) creates a set from the array, which automatically removes duplicates.<\/p>\n\n\n\n<p>The [&#8230;new Set(arr)] syntax converts the set back into an array.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"JavaScript_MCQ_Question_and_Answer\"><\/span>JavaScript MCQ Question and Answer<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Here are some important <strong>JavaScript logical questions<\/strong> and answers.<\/p>\n\n\n\n<ol start=\"64\">\n<li>What will the following code output?<\/li>\n<\/ol>\n\n\n\n<p>console.log(typeof NaN);<\/p>\n\n\n\n<p>A) \u201cnumber\u201d<\/p>\n\n\n\n<p>&nbsp;B) \u201cNaN\u201d<\/p>\n\n\n\n<p>&nbsp;C) \u201cundefined\u201d<\/p>\n\n\n\n<p>&nbsp;D) \u201cstring\u201d<\/p>\n\n\n\n<p>&nbsp;<strong>Answer: A) \u201cnumber\u201d<\/strong><\/p>\n\n\n\n<ol start=\"65\">\n<li>Which keyword is used to declare a constant variable in JavaScript?&nbsp;<\/li>\n<\/ol>\n\n\n\n<p>A) var<\/p>\n\n\n\n<p>&nbsp;B) let<\/p>\n\n\n\n<p>&nbsp;C) const<\/p>\n\n\n\n<p>&nbsp;D) final<\/p>\n\n\n\n<p><strong>Answer: C) const<\/strong><\/p>\n\n\n\n<ol start=\"66\">\n<li>What does the setTimeout() function do in JavaScript?&nbsp;<\/li>\n<\/ol>\n\n\n\n<p>A) Pauses the execution of the script<\/p>\n\n\n\n<p>&nbsp;B) Sets a timer to execute a function after a specified delay<\/p>\n\n\n\n<p>&nbsp;C) Executes a function immediately<\/p>\n\n\n\n<p>&nbsp;D) Stops the execution of a function<\/p>\n\n\n\n<p>&nbsp;<strong>Answer: B) Sets a timer to execute a function after a specified delay<\/strong><\/p>\n\n\n\n<ol start=\"67\">\n<li>Which of the following is NOT a valid JavaScript data type?&nbsp;<\/li>\n<\/ol>\n\n\n\n<p>A) number<\/p>\n\n\n\n<p>&nbsp;B) boolean<\/p>\n\n\n\n<p>&nbsp;C) undefined<\/p>\n\n\n\n<p>&nbsp;D) decimal<\/p>\n\n\n\n<p><strong>Answer: D) decimal<\/strong><\/p>\n\n\n\n<ol start=\"68\">\n<li>Question: What will the following code output?<\/li>\n<\/ol>\n\n\n\n<p>console.log(2 + \u201c2\u201d);&nbsp;<\/p>\n\n\n\n<p>A) 4<\/p>\n\n\n\n<p>&nbsp;B) \u201c22\u201d<\/p>\n\n\n\n<p>&nbsp;C) \u201c4\u201d<\/p>\n\n\n\n<p>&nbsp;D) NaN<\/p>\n\n\n\n<p><strong>Answer: B) \u201c22\u201d<\/strong><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Wrapping_Up\"><\/span>Wrapping Up<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>So, these are the top 60+ <strong>JavaScript interview questions and answers<\/strong> that cover essential concepts and topics for JavaScript developers. Learning these questions will boost your confidence and help you <a href=\"https:\/\/www.hirist.tech\/blog\/category\/inverview-advice\/\" target=\"_blank\" rel=\"noreferrer noopener\">impress the interviewers<\/a>. And if you are looking for the latest JavaScript job opportunities, visit <a href=\"https:\/\/www.hirist.tech\/?ref=blog\" target=\"_blank\" rel=\"noreferrer noopener\">Hirist<\/a>, the leading IT job portal in India.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Research shows that JavaScript is used in&nbsp;12%&nbsp;of all technical interviews. However, only&nbsp;42%&nbsp;of candidates pass these&hellip;<\/p>\n","protected":false},"author":1,"featured_media":2494,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[21,29,19],"tags":[32,34,56,33],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v22.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Top 60+ JavaScript Interview Questions and Answers - Hirist Blog<\/title>\n<meta name=\"description\" content=\"Top 40+ commonly asked JavaScript interview questions and answers. Get ready for upcoming JavaScript interview with our expert guide.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.hirist.tech\/blog\/top-40-javascript-interview-questions-answers-2024-hirist\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Top 60+ JavaScript Interview Questions and Answers - Hirist Blog\" \/>\n<meta property=\"og:description\" content=\"Top 40+ commonly asked JavaScript interview questions and answers. Get ready for upcoming JavaScript interview with our expert guide.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.hirist.tech\/blog\/top-40-javascript-interview-questions-answers-2024-hirist\/\" \/>\n<meta property=\"og:site_name\" content=\"Hirist Blog\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/hirist.jobs\" \/>\n<meta property=\"article:published_time\" content=\"2024-04-22T08:11:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-02-07T07:17:27+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.hirist.tech\/blog\/wp-content\/uploads\/2024\/04\/javascript-interview-questions.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"2000\" \/>\n\t<meta property=\"og:image:height\" content=\"1333\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"hiristBlog\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"hiristBlog\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"16 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.hirist.tech\/blog\/top-40-javascript-interview-questions-answers-2024-hirist\/\",\"url\":\"https:\/\/www.hirist.tech\/blog\/top-40-javascript-interview-questions-answers-2024-hirist\/\",\"name\":\"Top 60+ JavaScript Interview Questions and Answers - Hirist Blog\",\"isPartOf\":{\"@id\":\"https:\/\/www.hirist.tech\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.hirist.tech\/blog\/top-40-javascript-interview-questions-answers-2024-hirist\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.hirist.tech\/blog\/top-40-javascript-interview-questions-answers-2024-hirist\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.hirist.tech\/blog\/wp-content\/uploads\/2024\/04\/javascript-interview-questions.jpg\",\"datePublished\":\"2024-04-22T08:11:00+00:00\",\"dateModified\":\"2025-02-07T07:17:27+00:00\",\"author\":{\"@id\":\"https:\/\/www.hirist.tech\/blog\/#\/schema\/person\/f40a5a435d73195ec4e424a307b0c26b\"},\"description\":\"Top 40+ commonly asked JavaScript interview questions and answers. Get ready for upcoming JavaScript interview with our expert guide.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.hirist.tech\/blog\/top-40-javascript-interview-questions-answers-2024-hirist\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.hirist.tech\/blog\/top-40-javascript-interview-questions-answers-2024-hirist\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.hirist.tech\/blog\/top-40-javascript-interview-questions-answers-2024-hirist\/#primaryimage\",\"url\":\"https:\/\/www.hirist.tech\/blog\/wp-content\/uploads\/2024\/04\/javascript-interview-questions.jpg\",\"contentUrl\":\"https:\/\/www.hirist.tech\/blog\/wp-content\/uploads\/2024\/04\/javascript-interview-questions.jpg\",\"width\":2000,\"height\":1333,\"caption\":\"javascript interview questions\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.hirist.tech\/blog\/top-40-javascript-interview-questions-answers-2024-hirist\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.hirist.tech\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Top 60+ JavaScript Interview Questions and Answers\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.hirist.tech\/blog\/#website\",\"url\":\"https:\/\/www.hirist.tech\/blog\/\",\"name\":\"Hirist Blog\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.hirist.tech\/blog\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.hirist.tech\/blog\/#\/schema\/person\/f40a5a435d73195ec4e424a307b0c26b\",\"name\":\"hiristBlog\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.hirist.tech\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/1d0fb418cc48cd31b61160060c199240?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/1d0fb418cc48cd31b61160060c199240?s=96&d=mm&r=g\",\"caption\":\"hiristBlog\"},\"sameAs\":[\"https:\/\/www.hirist.tech\/blog\"],\"url\":\"https:\/\/www.hirist.tech\/blog\/author\/hiristblog\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Top 60+ JavaScript Interview Questions and Answers - Hirist Blog","description":"Top 40+ commonly asked JavaScript interview questions and answers. Get ready for upcoming JavaScript interview with our expert guide.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.hirist.tech\/blog\/top-40-javascript-interview-questions-answers-2024-hirist\/","og_locale":"en_US","og_type":"article","og_title":"Top 60+ JavaScript Interview Questions and Answers - Hirist Blog","og_description":"Top 40+ commonly asked JavaScript interview questions and answers. Get ready for upcoming JavaScript interview with our expert guide.","og_url":"https:\/\/www.hirist.tech\/blog\/top-40-javascript-interview-questions-answers-2024-hirist\/","og_site_name":"Hirist Blog","article_publisher":"https:\/\/www.facebook.com\/hirist.jobs","article_published_time":"2024-04-22T08:11:00+00:00","article_modified_time":"2025-02-07T07:17:27+00:00","og_image":[{"width":2000,"height":1333,"url":"https:\/\/www.hirist.tech\/blog\/wp-content\/uploads\/2024\/04\/javascript-interview-questions.jpg","type":"image\/jpeg"}],"author":"hiristBlog","twitter_card":"summary_large_image","twitter_misc":{"Written by":"hiristBlog","Est. reading time":"16 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.hirist.tech\/blog\/top-40-javascript-interview-questions-answers-2024-hirist\/","url":"https:\/\/www.hirist.tech\/blog\/top-40-javascript-interview-questions-answers-2024-hirist\/","name":"Top 60+ JavaScript Interview Questions and Answers - Hirist Blog","isPartOf":{"@id":"https:\/\/www.hirist.tech\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.hirist.tech\/blog\/top-40-javascript-interview-questions-answers-2024-hirist\/#primaryimage"},"image":{"@id":"https:\/\/www.hirist.tech\/blog\/top-40-javascript-interview-questions-answers-2024-hirist\/#primaryimage"},"thumbnailUrl":"https:\/\/www.hirist.tech\/blog\/wp-content\/uploads\/2024\/04\/javascript-interview-questions.jpg","datePublished":"2024-04-22T08:11:00+00:00","dateModified":"2025-02-07T07:17:27+00:00","author":{"@id":"https:\/\/www.hirist.tech\/blog\/#\/schema\/person\/f40a5a435d73195ec4e424a307b0c26b"},"description":"Top 40+ commonly asked JavaScript interview questions and answers. Get ready for upcoming JavaScript interview with our expert guide.","breadcrumb":{"@id":"https:\/\/www.hirist.tech\/blog\/top-40-javascript-interview-questions-answers-2024-hirist\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.hirist.tech\/blog\/top-40-javascript-interview-questions-answers-2024-hirist\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.hirist.tech\/blog\/top-40-javascript-interview-questions-answers-2024-hirist\/#primaryimage","url":"https:\/\/www.hirist.tech\/blog\/wp-content\/uploads\/2024\/04\/javascript-interview-questions.jpg","contentUrl":"https:\/\/www.hirist.tech\/blog\/wp-content\/uploads\/2024\/04\/javascript-interview-questions.jpg","width":2000,"height":1333,"caption":"javascript interview questions"},{"@type":"BreadcrumbList","@id":"https:\/\/www.hirist.tech\/blog\/top-40-javascript-interview-questions-answers-2024-hirist\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.hirist.tech\/blog\/"},{"@type":"ListItem","position":2,"name":"Top 60+ JavaScript Interview Questions and Answers"}]},{"@type":"WebSite","@id":"https:\/\/www.hirist.tech\/blog\/#website","url":"https:\/\/www.hirist.tech\/blog\/","name":"Hirist Blog","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.hirist.tech\/blog\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.hirist.tech\/blog\/#\/schema\/person\/f40a5a435d73195ec4e424a307b0c26b","name":"hiristBlog","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.hirist.tech\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/1d0fb418cc48cd31b61160060c199240?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/1d0fb418cc48cd31b61160060c199240?s=96&d=mm&r=g","caption":"hiristBlog"},"sameAs":["https:\/\/www.hirist.tech\/blog"],"url":"https:\/\/www.hirist.tech\/blog\/author\/hiristblog\/"}]}},"_links":{"self":[{"href":"https:\/\/www.hirist.tech\/blog\/wp-json\/wp\/v2\/posts\/2475"}],"collection":[{"href":"https:\/\/www.hirist.tech\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hirist.tech\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hirist.tech\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hirist.tech\/blog\/wp-json\/wp\/v2\/comments?post=2475"}],"version-history":[{"count":28,"href":"https:\/\/www.hirist.tech\/blog\/wp-json\/wp\/v2\/posts\/2475\/revisions"}],"predecessor-version":[{"id":5302,"href":"https:\/\/www.hirist.tech\/blog\/wp-json\/wp\/v2\/posts\/2475\/revisions\/5302"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.hirist.tech\/blog\/wp-json\/wp\/v2\/media\/2494"}],"wp:attachment":[{"href":"https:\/\/www.hirist.tech\/blog\/wp-json\/wp\/v2\/media?parent=2475"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hirist.tech\/blog\/wp-json\/wp\/v2\/categories?post=2475"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hirist.tech\/blog\/wp-json\/wp\/v2\/tags?post=2475"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}