[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-2903":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":15,"stars7d":17,"stars30d":18,"stars90d":16,"forks30d":16,"starsTrendScore":19,"compositeScore":20,"rankGlobal":10,"rankLanguage":10,"license":10,"archived":21,"fork":21,"defaultBranch":22,"hasWiki":23,"hasPages":21,"topics":24,"createdAt":10,"pushedAt":10,"updatedAt":32,"readmeContent":33,"aiSummary":34,"trendingCount":16,"starSnapshotCount":16,"syncStatus":35,"lastSyncTime":36,"discoverSource":37},2903,"javascript-interview-questions","sudheerj\u002Fjavascript-interview-questions","sudheerj","List of 1000 JavaScript Interview Questions","",null,"JavaScript",27464,7647,331,4,0,16,89,18,45,false,"master",true,[25,26,27,28,5,29,30,31],"angular","core-javascript","javascript","javascript-applications","react","vanilla-javascript","vuejs","2026-06-12 02:00:44","# JavaScript Interview Questions & Answers\n\n> Click :star:if you like the project and follow [@SudheerJonna](https:\u002F\u002Ftwitter.com\u002FSudheerJonna) for more updates. Coding questions available [here](#coding-exercise). Check [DataStructures and Algorithms](https:\u002F\u002Fgithub.com\u002Fsudheerj\u002Fdatastructures-algorithms) for DSA related questions and [ECMAScript](https:\u002F\u002Fgithub.com\u002Fsudheerj\u002FECMAScript-features) for all ES features.)\n\n---\n\n\u003Cdiv>\n\u003Cp align=\"center\">\n  \u003Ca href=\"https:\u002F\u002Fwww.greatfrontend.com\u002Fquestions\u002Fformats\u002Fjavascript-functions?utm_source=github&utm_medium=referral&utm_campaign=sudheerj-js&fpr=sudheerj&gnrs=sudheerj\">\n    \u003Cimg src=\".\u002Fimages\u002Fcollab\u002Fgreatfrontend-js.gif\" alt=\"GreatFrontEnd JavaScript Interview Questions\" width=\"100%\">\n  \u003C\u002Fa>\n\u003C\u002Fp>\n\u003C\u002Fdiv>\n\n> Practice 280+ JavaScript coding interview questions in-browser. Built by ex-FAANG interviewers. No AI-generated fluff. No fake reviews. [Try GreatFrontEnd →](https:\u002F\u002Fwww.greatfrontend.com\u002Fquestions\u002Fformats\u002Fjavascript-functions?utm_source=github&utm_medium=referral&utm_campaign=sudheerj-js&fpr=sudheerj&gnrs=sudheerj) 💡\n\n\n\u003Cdiv>\n\u003Cp align=\"center\">\n  \u003Ca href=\"https:\u002F\u002Fzerotomastery.io\u002F?utm_source=github&utm_medium=sponsor&utm_campaign=javascript-interview-questions\">\n    \u003Cimg src=\".\u002Fimages\u002Fcollab\u002Fztm.gif\" alt=\"ZTM Logo\" width=\"100%\" \u002F>\n  \u003C\u002Fa>\n\u003C\u002Fp>\n\u003C\u002Fdiv>\n\n> I recommend this [JavaScript Projects courses](https:\u002F\u002Fzerotomastery.io\u002Fcourses\u002Fjavascript-projects\u002F?utm_source=github&utm_medium=sponsor&utm_campaign=javascript-interview-questions) and this [Advanced JavaScript Course](https:\u002F\u002Fzerotomastery.io\u002Fcourses\u002Fadvanced-javascript-concepts\u002F?utm_source=github&utm_medium=sponsor&utm_campaign=javascript-interview-questions) to become top 10% at JS and [this coding interview bootcamp](https:\u002F\u002Fzerotomastery.io\u002Fcourses\u002Flearn-data-structures-and-algorithms\u002F?utm_source=github&utm_medium=sponsor&utm_campaign=javascript-interview-questions) to ace your coding interview and actually get hired.\n\n### Table of Contents\n\n\u003C!-- TOC_START -->\n| No. | Questions |\n| --- | --------- |\n| 1 | [What are the possible ways to create objects in JavaScript](#what-are-the-possible-ways-to-create-objects-in-javascript) |\n| 2 | [What is a prototype chain](#what-is-a-prototype-chain) |\n| 3 | [What is the Difference Between `call`, `apply`, and `bind`](#what-is-the-difference-between-call-apply-and-bind) |\n| 4 | [What is JSON and its common operations](#what-is-json-and-its-common-operations) |\n| 5 | [What is the purpose of the array slice method](#what-is-the-purpose-of-the-array-slice-method) |\n| 6 | [What is the purpose of the array splice method](#what-is-the-purpose-of-the-array-splice-method) |\n| 7 | [What is the difference between slice and splice](#what-is-the-difference-between-slice-and-splice) |\n| 8 | [How do you compare Object and Map](#how-do-you-compare-object-and-map) |\n| 9 | [What is the difference between == and === operators](#what-is-the-difference-between--and--operators) |\n| 10 | [What are lambda expressions or arrow functions](#what-are-lambda-expressions-or-arrow-functions) |\n| 11 | [What is a first class function](#what-is-a-first-class-function) |\n| 12 | [What is a first order function](#what-is-a-first-order-function) |\n| 13 | [What is a higher order function](#what-is-a-higher-order-function) |\n| 14 | [What is a unary function](#what-is-a-unary-function) |\n| 15 | [What is the currying function](#what-is-the-currying-function) |\n| 16 | [What is a pure function](#what-is-a-pure-function) |\n| 17 | [What are the benefits of pure functions](#what-are-the-benefits-of-pure-functions) |\n| 18 | [What is the purpose of the let keyword](#what-is-the-purpose-of-the-let-keyword) |\n| 19 | [What is the difference between let and var](#what-is-the-difference-between-let-and-var) |\n| 20 | [What is the reason to choose the name let as a keyword](#what-is-the-reason-to-choose-the-name-let-as-a-keyword) |\n| 21 | [How do you redeclare variables in a switch block without an error](#how-do-you-redeclare-variables-in-a-switch-block-without-an-error) |\n| 22 | [What is the Temporal Dead Zone](#what-is-the-temporal-dead-zone) |\n| 23 | [What is an IIFE (Immediately Invoked Function Expression)](#what-is-an-iife-immediately-invoked-function-expression) |\n| 24 | [How do you decode or encode a URL in JavaScript?](#how-do-you-decode-or-encode-a-url-in-javascript) |\n| 25 | [What is memoization](#what-is-memoization) |\n| 26 | [What is Hoisting](#what-is-hoisting) |\n| 27 | [What are classes in ES6](#what-are-classes-in-es6) |\n| 28 | [What are closures](#what-are-closures) |\n| 29 | [What are modules](#what-are-modules) |\n| 30 | [Why do you need modules](#why-do-you-need-modules) |\n| 31 | [What is scope in javascript](#what-is-scope-in-javascript) |\n| 32 | [What is a service worker](#what-is-a-service-worker) |\n| 33 | [How do you manipulate DOM using a service worker](#how-do-you-manipulate-dom-using-a-service-worker) |\n| 34 | [How do you reuse information across service worker restarts](#how-do-you-reuse-information-across-service-worker-restarts) |\n| 35 | [What is IndexedDB](#what-is-indexeddb) |\n| 36 | [What is web storage](#what-is-web-storage) |\n| 37 | [What is a post message](#what-is-a-post-message) |\n| 38 | [What is a Cookie](#what-is-a-cookie) |\n| 39 | [Why do you need a Cookie](#why-do-you-need-a-cookie) |\n| 40 | [What are the options in a cookie](#what-are-the-options-in-a-cookie) |\n| 41 | [How do you delete a cookie](#how-do-you-delete-a-cookie) |\n| 42 | [What are the differences between cookie, local storage and session storage](#what-are-the-differences-between-cookie-local-storage-and-session-storage) |\n| 43 | [What is the main difference between localStorage and sessionStorage](#what-is-the-main-difference-between-localstorage-and-sessionstorage) |\n| 44 | [How do you access web storage](#how-do-you-access-web-storage) |\n| 45 | [What are the methods available on session storage](#what-are-the-methods-available-on-session-storage) |\n| 46 | [What is a storage event and its event handler](#what-is-a-storage-event-and-its-event-handler) |\n| 47 | [Why do you need web storage](#why-do-you-need-web-storage) |\n| 48 | [How do you check web storage browser support](#how-do-you-check-web-storage-browser-support) |\n| 49 | [How do you check web workers browser support](#how-do-you-check-web-workers-browser-support) |\n| 50 | [Give an example of a web worker](#give-an-example-of-a-web-worker) |\n| 51 | [What are the restrictions of web workers on DOM](#what-are-the-restrictions-of-web-workers-on-dom) |\n| 52 | [What is a promise](#what-is-a-promise) |\n| 53 | [Why do you need a promise](#why-do-you-need-a-promise) |\n| 54 | [Explain the three states of promise](#explain-the-three-states-of-promise) |\n| 55 | [What is a callback function](#what-is-a-callback-function) |\n| 56 | [Why do we need callbacks](#why-do-we-need-callbacks) |\n| 57 | [What is a callback hell](#what-is-a-callback-hell) |\n| 58 | [What are server-sent events](#what-are-server-sent-events) |\n| 59 | [How do you receive server-sent event notifications](#how-do-you-receive-server-sent-event-notifications) |\n| 60 | [How do you check browser support for server-sent events](#how-do-you-check-browser-support-for-server-sent-events) |\n| 61 | [What are the events available for server sent events](#what-are-the-events-available-for-server-sent-events) |\n| 62 | [What are the main rules of promise](#what-are-the-main-rules-of-promise) |\n| 63 | [What is callback in callback](#what-is-callback-in-callback) |\n| 64 | [What is promise chaining](#what-is-promise-chaining) |\n| 65 | [What is promise.all](#what-is-promiseall) |\n| 66 | [What is the purpose of the race method in promise](#what-is-the-purpose-of-the-race-method-in-promise) |\n| 67 | [What is a strict mode in javascript](#what-is-a-strict-mode-in-javascript) |\n| 68 | [Why do you need strict mode](#why-do-you-need-strict-mode) |\n| 69 | [How do you declare strict mode](#how-do-you-declare-strict-mode) |\n| 70 | [What is the purpose of double exclamation](#what-is-the-purpose-of-double-exclamation) |\n| 71 | [What is the purpose of the delete operator](#what-is-the-purpose-of-the-delete-operator) |\n| 72 | [What is typeof operator](#what-is-typeof-operator) |\n| 73 | [What is undefined property](#what-is-undefined-property) |\n| 74 | [What is null value](#what-is-null-value) |\n| 75 | [What is the difference between null and undefined](#what-is-the-difference-between-null-and-undefined) |\n| 76 | [What is eval](#what-is-eval) |\n| 77 | [What is the difference between window and document](#what-is-the-difference-between-window-and-document) |\n| 78 | [How do you access history in javascript](#how-do-you-access-history-in-javascript) |\n| 79 | [How do you detect caps lock key turned on or not](#how-do-you-detect-caps-lock-key-turned-on-or-not) |\n| 80 | [What is isNaN](#what-is-isnan) |\n| 81 | [What are the differences between undeclared and undefined variables](#what-are-the-differences-between-undeclared-and-undefined-variables) |\n| 82 | [What are global variables](#what-are-global-variables) |\n| 83 | [What are the problems with global variables](#what-are-the-problems-with-global-variables) |\n| 84 | [What is NaN property](#what-is-nan-property) |\n| 85 | [What is the purpose of isFinite function](#what-is-the-purpose-of-isfinite-function) |\n| 86 | [What is an event flow](#what-is-an-event-flow) |\n| 87 | [What is event capturing](#what-is-event-capturing) |\n| 88 | [What is event bubbling](#what-is-event-bubbling) |\n| 89 | [How do you submit a form using JavaScript](#how-do-you-submit-a-form-using-javascript) |\n| 90 | [How do you find operating system details](#how-do-you-find-operating-system-details) |\n| 91 | [What is the difference between document load and DOMContentLoaded events](#what-is-the-difference-between-document-load-and-domcontentloaded-events) |\n| 92 | [What is the difference between native, host and user objects](#what-is-the-difference-between-native-host-and-user-objects) |\n| 93 | [What are the tools or techniques used for debugging JavaScript code](#what-are-the-tools-or-techniques-used-for-debugging-javascript-code) |\n| 94 | [What are the pros and cons of promises over callbacks](#what-are-the-pros-and-cons-of-promises-over-callbacks) |\n| 95 | [What is the difference between an attribute and a property](#what-is-the-difference-between-an-attribute-and-a-property) |\n| 96 | [What is same-origin policy](#what-is-same-origin-policy) |\n| 97 | [What is the purpose of void 0](#what-is-the-purpose-of-void-0) |\n| 98 | [Is JavaScript a compiled or interpreted language](#is-javascript-a-compiled-or-interpreted-language) |\n| 99 | [Is JavaScript a case-sensitive language](#is-javascript-a-case-sensitive-language) |\n| 100 | [Is there any relation between Java and JavaScript](#is-there-any-relation-between-java-and-javascript) |\n| 101 | [What are events](#what-are-events) |\n| 102 | [Who created javascript](#who-created-javascript) |\n| 103 | [What is the use of preventDefault method](#what-is-the-use-of-preventdefault-method) |\n| 104 | [What is the use of stopPropagation method](#what-is-the-use-of-stoppropagation-method) |\n| 105 | [What are the steps involved in return false usage](#what-are-the-steps-involved-in-return-false-usage) |\n| 106 | [What is BOM](#what-is-bom) |\n| 107 | [What is the use of setTimeout](#what-is-the-use-of-settimeout) |\n| 108 | [What is the use of setInterval](#what-is-the-use-of-setinterval) |\n| 109 | [Why is JavaScript treated as Single threaded](#why-is-javascript-treated-as-single-threaded) |\n| 110 | [What is an event delegation](#what-is-an-event-delegation) |\n| 111 | [What is ECMAScript](#what-is-ecmascript) |\n| 112 | [What is JSON](#what-is-json) |\n| 113 | [What are the syntax rules of JSON](#what-are-the-syntax-rules-of-json) |\n| 114 | [What is the purpose JSON stringify](#what-is-the-purpose-json-stringify) |\n| 115 | [How do you parse JSON string](#how-do-you-parse-json-string) |\n| 116 | [Why do you need JSON](#why-do-you-need-json) |\n| 117 | [What are PWAs](#what-are-pwas) |\n| 118 | [What is the purpose of clearTimeout method](#what-is-the-purpose-of-cleartimeout-method) |\n| 119 | [What is the purpose of clearInterval method](#what-is-the-purpose-of-clearinterval-method) |\n| 120 | [How do you redirect new page in javascript](#how-do-you-redirect-new-page-in-javascript) |\n| 121 | [How do you check whether a string contains a substring](#how-do-you-check-whether-a-string-contains-a-substring) |\n| 122 | [How do you validate an email in javascript](#how-do-you-validate-an-email-in-javascript) |\n| 123 | [How do you get the current url with javascript](#how-do-you-get-the-current-url-with-javascript) |\n| 124 | [What are the various url properties of location object](#what-are-the-various-url-properties-of-location-object) |\n| 125 | [How do you get query string values in javascript](#how-do-you-get-query-string-values-in-javascript) |\n| 126 | [How do you check if a key exists in an object](#how-do-you-check-if-a-key-exists-in-an-object) |\n| 127 | [How do you loop through or enumerate javascript object](#how-do-you-loop-through-or-enumerate-javascript-object) |\n| 128 | [How do you test for an empty object](#how-do-you-test-for-an-empty-object) |\n| 129 | [What is an arguments object](#what-is-an-arguments-object) |\n| 130 | [How do you make first letter of the string in an uppercase](#how-do-you-make-first-letter-of-the-string-in-an-uppercase) |\n| 131 | [What are the pros and cons of for loops](#what-are-the-pros-and-cons-of-for-loops) |\n| 132 | [How do you display the current date in javascript](#how-do-you-display-the-current-date-in-javascript) |\n| 133 | [How do you compare two date objects](#how-do-you-compare-two-date-objects) |\n| 134 | [How do you check if a string starts with another string](#how-do-you-check-if-a-string-starts-with-another-string) |\n| 135 | [How do you trim a string in javascript](#how-do-you-trim-a-string-in-javascript) |\n| 136 | [How do you add a key value pair in javascript](#how-do-you-add-a-key-value-pair-in-javascript) |\n| 137 | [Is the !-- notation represents a special operator](#is-the----notation-represents-a-special-operator) |\n| 138 | [How do you assign default values to variables](#how-do-you-assign-default-values-to-variables) |\n| 139 | [How do you define multiline strings](#how-do-you-define-multiline-strings) |\n| 140 | [What is an app shell model](#what-is-an-app-shell-model) |\n| 141 | [Can we define properties for functions](#can-we-define-properties-for-functions) |\n| 142 | [What is the way to find the number of parameters expected by a function](#what-is-the-way-to-find-the-number-of-parameters-expected-by-a-function) |\n| 143 | [What is a polyfill](#what-is-a-polyfill) |\n| 144 | [What are break and continue statements](#what-are-break-and-continue-statements) |\n| 145 | [What are js labels](#what-are-js-labels) |\n| 146 | [What are the benefits of keeping declarations at the top](#what-are-the-benefits-of-keeping-declarations-at-the-top) |\n| 147 | [What are the benefits of initializing variables](#what-are-the-benefits-of-initializing-variables) |\n| 148 | [What are the recommendations to create new object](#what-are-the-recommendations-to-create-new-object) |\n| 149 | [How do you define JSON arrays](#how-do-you-define-json-arrays) |\n| 150 | [How do you generate random integers](#how-do-you-generate-random-integers) |\n| 151 | [Can you write a random integers function to print integers within a range](#can-you-write-a-random-integers-function-to-print-integers-within-a-range) |\n| 152 | [What is tree shaking](#what-is-tree-shaking) |\n| 153 | [What is the need of tree shaking](#what-is-the-need-of-tree-shaking) |\n| 154 | [Is it recommended to use eval](#is-it-recommended-to-use-eval) |\n| 155 | [What is a Regular Expression](#what-is-a-regular-expression) |\n| 156 | [What are the string methods that accept Regular expression](#what-are-the-string-methods-that-accept-regular-expression) |\n| 157 | [What are modifiers in regular expression](#what-are-modifiers-in-regular-expression) |\n| 158 | [What are regular expression patterns](#what-are-regular-expression-patterns) |\n| 159 | [What is a RegExp object](#what-is-a-regexp-object) |\n| 160 | [How do you search a string for a pattern](#how-do-you-search-a-string-for-a-pattern) |\n| 161 | [What is the purpose of exec method](#what-is-the-purpose-of-exec-method) |\n| 162 | [How do you change the style of a HTML element](#how-do-you-change-the-style-of-a-html-element) |\n| 163 | [What would be the result of 1+2+'3'](#what-would-be-the-result-of-123) |\n| 164 | [What is a debugger statement](#what-is-a-debugger-statement) |\n| 165 | [What is the purpose of breakpoints in debugging](#what-is-the-purpose-of-breakpoints-in-debugging) |\n| 166 | [Can I use reserved words as identifiers](#can-i-use-reserved-words-as-identifiers) |\n| 167 | [How do you detect a mobile browser](#how-do-you-detect-a-mobile-browser) |\n| 168 | [How do you detect a mobile browser without regexp](#how-do-you-detect-a-mobile-browser-without-regexp) |\n| 169 | [How do you get the image width and height using JS](#how-do-you-get-the-image-width-and-height-using-js) |\n| 170 | [How do you make synchronous HTTP request](#how-do-you-make-synchronous-http-request) |\n| 171 | [How do you make asynchronous HTTP request](#how-do-you-make-asynchronous-http-request) |\n| 172 | [How do you convert date to another timezone in javascript](#how-do-you-convert-date-to-another-timezone-in-javascript) |\n| 173 | [What are the properties used to get size of window](#what-are-the-properties-used-to-get-size-of-window) |\n| 174 | [What is a conditional operator in javascript](#what-is-a-conditional-operator-in-javascript) |\n| 175 | [Can you apply chaining on conditional operator](#can-you-apply-chaining-on-conditional-operator) |\n| 176 | [What are the ways to execute javascript after a page load](#what-are-the-ways-to-execute-javascript-after-a-page-load) |\n| 177 | [What is the difference between proto and prototype](#what-is-the-difference-between-proto-and-prototype) |\n| 178 | [Can you give an example of when you really need a semicolon](#can-you-give-an-example-of-when-you-really-need-a-semicolon) |\n| 179 | [What is the freeze method](#what-is-the-freeze-method) |\n| 180 | [What is the purpose of the freeze method](#what-is-the-purpose-of-the-freeze-method) |\n| 181 | [Why do I need to use the freeze method](#why-do-i-need-to-use-the-freeze-method) |\n| 182 | [How do you detect a browser language preference](#how-do-you-detect-a-browser-language-preference) |\n| 183 | [How to convert a string to title case with javascript](#how-to-convert-a-string-to-title-case-with-javascript) |\n| 184 | [How do you detect if javascript is disabled on the page](#how-do-you-detect-if-javascript-is-disabled-on-the-page) |\n| 185 | [What are various operators supported by javascript](#what-are-various-operators-supported-by-javascript) |\n| 186 | [What is a rest parameter](#what-is-a-rest-parameter) |\n| 187 | [What happens if you do not use rest parameter as a last argument](#what-happens-if-you-do-not-use-rest-parameter-as-a-last-argument) |\n| 188 | [What are the bitwise operators available in javascript](#what-are-the-bitwise-operators-available-in-javascript) |\n| 189 | [What is a spread operator](#what-is-a-spread-operator) |\n| 190 | [How do you determine whether object is frozen or not](#how-do-you-determine-whether-object-is-frozen-or-not) |\n| 191 | [How do you determine two values same or not using object](#how-do-you-determine-two-values-same-or-not-using-object) |\n| 192 | [What is the purpose of using object is method](#what-is-the-purpose-of-using-object-is-method) |\n| 193 | [How do you copy properties from one object to other](#how-do-you-copy-properties-from-one-object-to-other) |\n| 194 | [What are the applications of the assign method](#what-are-the-applications-of-the-assign-method) |\n| 195 | [What is a proxy object](#what-is-a-proxy-object) |\n| 196 | [What is the purpose of the seal method](#what-is-the-purpose-of-the-seal-method) |\n| 197 | [What are the applications of the seal method](#what-are-the-applications-of-the-seal-method) |\n| 198 | [What are the differences between the freeze and seal methods](#what-are-the-differences-between-the-freeze-and-seal-methods) |\n| 199 | [How do you determine if an object is sealed or not](#how-do-you-determine-if-an-object-is-sealed-or-not) |\n| 200 | [How do you get enumerable key and value pairs](#how-do-you-get-enumerable-key-and-value-pairs) |\n| 201 | [What is the main difference between Object.values and Object.entries method](#what-is-the-main-difference-between-objectvalues-and-objectentries-method) |\n| 202 | [How can you get the list of keys of any object](#how-can-you-get-the-list-of-keys-of-any-object) |\n| 203 | [How do you create an object with a prototype](#how-do-you-create-an-object-with-a-prototype) |\n| 204 | [What is a WeakSet](#what-is-a-weakset) |\n| 205 | [What are the differences between WeakSet and Set](#what-are-the-differences-between-weakset-and-set) |\n| 206 | [List down the collection of methods available on WeakSet](#list-down-the-collection-of-methods-available-on-weakset) |\n| 207 | [What is a WeakMap](#what-is-a-weakmap) |\n| 208 | [What are the differences between WeakMap and Map](#what-are-the-differences-between-weakmap-and-map) |\n| 209 | [List down the collection of methods available on WeakMap](#list-down-the-collection-of-methods-available-on-weakmap) |\n| 210 | [What is the purpose of uneval](#what-is-the-purpose-of-uneval) |\n| 211 | [How do you encode an URL](#how-do-you-encode-an-url) |\n| 212 | [How do you decode an URL](#how-do-you-decode-an-url) |\n| 213 | [How do you print the contents of web page](#how-do-you-print-the-contents-of-web-page) |\n| 214 | [What is the difference between uneval and eval](#what-is-the-difference-between-uneval-and-eval) |\n| 215 | [What is an anonymous function](#what-is-an-anonymous-function) |\n| 216 | [What is the precedence order between local and global variables](#what-is-the-precedence-order-between-local-and-global-variables) |\n| 217 | [What are javascript accessors](#what-are-javascript-accessors) |\n| 218 | [How do you define property on Object constructor](#how-do-you-define-property-on-object-constructor) |\n| 219 | [What is the difference between get and defineProperty](#what-is-the-difference-between-get-and-defineproperty) |\n| 220 | [What are the advantages of Getters and Setters](#what-are-the-advantages-of-getters-and-setters) |\n| 221 | [Can I add getters and setters using defineProperty method](#can-i-add-getters-and-setters-using-defineproperty-method) |\n| 222 | [What is the purpose of switch-case](#what-is-the-purpose-of-switch-case) |\n| 223 | [What are the conventions to be followed for the usage of switch case](#what-are-the-conventions-to-be-followed-for-the-usage-of-switch-case) |\n| 224 | [What are primitive data types](#what-are-primitive-data-types) |\n| 225 | [What are the different ways to access object properties](#what-are-the-different-ways-to-access-object-properties) |\n| 226 | [What are the function parameter rules](#what-are-the-function-parameter-rules) |\n| 227 | [What is an error object](#what-is-an-error-object) |\n| 228 | [When do you get a syntax error](#when-do-you-get-a-syntax-error) |\n| 229 | [What are the different error names from error object](#what-are-the-different-error-names-from-error-object) |\n| 230 | [What are the various statements in error handling](#what-are-the-various-statements-in-error-handling) |\n| 231 | [What are the two types of loops in javascript](#what-are-the-two-types-of-loops-in-javascript) |\n| 232 | [What is nodejs](#what-is-nodejs) |\n| 233 | [What is the Intl object](#what-is-the-intl-object) |\n| 234 | [How do you perform language specific date and time formatting](#how-do-you-perform-language-specific-date-and-time-formatting) |\n| 235 | [What is an Iterator](#what-is-an-iterator) |\n| 236 | [How does synchronous iteration works](#how-does-synchronous-iteration-works) |\n| 237 | [What is the event loop](#what-is-the-event-loop) |\n| 238 | [What is the call stack](#what-is-the-call-stack) |\n| 239 | [What is the event queue](#what-is-the-event-queue) |\n| 240 | [What is a decorator](#what-is-a-decorator) |\n| 241 | [What are the properties of the Intl object](#what-are-the-properties-of-the-intl-object) |\n| 242 | [What is an Unary operator](#what-is-an-unary-operator) |\n| 243 | [How do you sort elements in an array](#how-do-you-sort-elements-in-an-array) |\n| 244 | [What is the purpose of compareFunction while sorting arrays](#what-is-the-purpose-of-comparefunction-while-sorting-arrays) |\n| 245 | [How do you reverse an array](#how-do-you-reverse-an-array) |\n| 246 | [How do you find the min and max values in an array](#how-do-you-find-the-min-and-max-values-in-an-array) |\n| 247 | [How do you find the min and max values without Math functions](#how-do-you-find-the-min-and-max-values-without-math-functions) |\n| 248 | [What is an empty statement and purpose of it](#what-is-an-empty-statement-and-purpose-of-it) |\n| 249 | [How do you get the metadata of a module](#how-do-you-get-the-metadata-of-a-module) |\n| 250 | [What is the comma operator](#what-is-the-comma-operator) |\n| 251 | [What is the advantage of the comma operator](#what-is-the-advantage-of-the-comma-operator) |\n| 252 | [What is typescript](#what-is-typescript) |\n| 253 | [What are the differences between javascript and typescript](#what-are-the-differences-between-javascript-and-typescript) |\n| 254 | [What are the advantages of typescript over javascript](#what-are-the-advantages-of-typescript-over-javascript) |\n| 255 | [What is an object initializer](#what-is-an-object-initializer) |\n| 256 | [What is a constructor method](#what-is-a-constructor-method) |\n| 257 | [What happens if you write constructor more than once in a class](#what-happens-if-you-write-constructor-more-than-once-in-a-class) |\n| 258 | [How do you call the constructor of a parent class](#how-do-you-call-the-constructor-of-a-parent-class) |\n| 259 | [How do you get the prototype of an object](#how-do-you-get-the-prototype-of-an-object) |\n| 260 | [What happens If I pass string type for getPrototype method](#what-happens-if-i-pass-string-type-for-getprototype-method) |\n| 261 | [How do you set the prototype of one object to another](#how-do-you-set-the-prototype-of-one-object-to-another) |\n| 262 | [How do you check whether an object can be extended or not](#how-do-you-check-whether-an-object-can-be-extended-or-not) |\n| 263 | [How do you prevent an object from being extend](#how-do-you-prevent-an-object-from-being-extend) |\n| 264 | [What are the different ways to make an object non-extensible](#what-are-the-different-ways-to-make-an-object-non-extensible) |\n| 265 | [How do you define multiple properties on an object](#how-do-you-define-multiple-properties-on-an-object) |\n| 266 | [What is the MEAN stack](#what-is-the-mean-stack) |\n| 267 | [What is obfuscation in javascript](#what-is-obfuscation-in-javascript) |\n| 268 | [Why do you need Obfuscation](#why-do-you-need-obfuscation) |\n| 269 | [What is Minification](#what-is-minification) |\n| 270 | [What are the advantages of minification](#what-are-the-advantages-of-minification) |\n| 271 | [What are the differences between obfuscation and Encryption](#what-are-the-differences-between-obfuscation-and-encryption) |\n| 272 | [What are the common tools used for minification](#what-are-the-common-tools-used-for-minification) |\n| 273 | [How do you perform form validation using javascript](#how-do-you-perform-form-validation-using-javascript) |\n| 274 | [How do you perform form validation without javascript](#how-do-you-perform-form-validation-without-javascript) |\n| 275 | [What are the DOM methods available for constraint validation](#what-are-the-dom-methods-available-for-constraint-validation) |\n| 276 | [What are the available constraint validation DOM properties](#what-are-the-available-constraint-validation-dom-properties) |\n| 277 | [What are the validity properties](#what-are-the-validity-properties) |\n| 278 | [Give an example usage of the rangeOverflow property](#give-an-example-usage-of-the-rangeoverflow-property) |\n| 279 | [Are enums available in javascript](#are-enums-available-in-javascript) |\n| 280 | [What is an enum](#what-is-an-enum) |\n| 281 | [How do you list all properties of an object](#how-do-you-list-all-properties-of-an-object) |\n| 282 | [How do you get property descriptors of an object](#how-do-you-get-property-descriptors-of-an-object) |\n| 283 | [What are the attributes provided by a property descriptor](#what-are-the-attributes-provided-by-a-property-descriptor) |\n| 284 | [How do you extend classes](#how-do-you-extend-classes) |\n| 285 | [How do I modify the url without reloading the page](#how-do-i-modify-the-url-without-reloading-the-page) |\n| 286 | [How do you check whether or not an array includes a particular value](#how-do-you-check-whether-or-not-an-array-includes-a-particular-value) |\n| 287 | [How do you compare scalar arrays](#how-do-you-compare-scalar-arrays) |\n| 288 | [How to get the value from get parameters](#how-to-get-the-value-from-get-parameters) |\n| 289 | [How do you print numbers with commas as thousand separators](#how-do-you-print-numbers-with-commas-as-thousand-separators) |\n| 290 | [What is the difference between java and javascript](#what-is-the-difference-between-java-and-javascript) |\n| 291 | [Does JavaScript support namespaces](#does-javascript-support-namespaces) |\n| 292 | [How do you declare a namespace](#how-do-you-declare-a-namespace) |\n| 293 | [How do you invoke javascript code in an iframe from the parent page](#how-do-you-invoke-javascript-code-in-an-iframe-from-the-parent-page) |\n| 294 | [How do you get the timezone offset of a date object](#how-do-you-get-the-timezone-offset-of-a-date-object) |\n| 295 | [How do you load CSS and JS files dynamically](#how-do-you-load-css-and-js-files-dynamically) |\n| 296 | [What are the different methods to find HTML elements in DOM](#what-are-the-different-methods-to-find-html-elements-in-dom) |\n| 297 | [What is jQuery](#what-is-jquery) |\n| 298 | [What is V8 JavaScript engine](#what-is-v8-javascript-engine) |\n| 299 | [Why do we call javascript as dynamic language](#why-do-we-call-javascript-as-dynamic-language) |\n| 300 | [What is a void operator](#what-is-a-void-operator) |\n| 301 | [How to set the cursor to wait](#how-to-set-the-cursor-to-wait) |\n| 302 | [How do you create an infinite loop](#how-do-you-create-an-infinite-loop) |\n| 303 | [Why do you need to avoid with statement](#why-do-you-need-to-avoid-with-statement) |\n| 304 | [What is the output of the following for loops](#what-is-the-output-of-the-following-for-loops) |\n| 305 | [List down some of the features of ES6](#list-down-some-of-the-features-of-es6) |\n| 306 | [What is ES6](#what-is-es6) |\n| 307 | [Can I redeclare let and const variables](#can-i-redeclare-let-and-const-variables) |\n| 308 | [Does the `const` variable make the value immutable](#does-the-const-variable-make-the-value-immutable) |\n| 309 | [What are default parameters](#what-are-default-parameters) |\n| 310 | [What are template literals](#what-are-template-literals) |\n| 311 | [How do you write multi-line strings in template literals](#how-do-you-write-multi-line-strings-in-template-literals) |\n| 312 | [What are nesting templates](#what-are-nesting-templates) |\n| 313 | [What are tagged templates](#what-are-tagged-templates) |\n| 314 | [What are raw strings](#what-are-raw-strings) |\n| 315 | [What is destructuring assignment](#what-is-destructuring-assignment) |\n| 316 | [What are default values in destructuring assignment](#what-are-default-values-in-destructuring-assignment) |\n| 317 | [How do you swap variables in destructuring assignment](#how-do-you-swap-variables-in-destructuring-assignment) |\n| 318 | [What are enhanced object literals](#what-are-enhanced-object-literals) |\n| 319 | [What are dynamic imports](#what-are-dynamic-imports) |\n| 320 | [What are the use cases for dynamic imports](#what-are-the-use-cases-for-dynamic-imports) |\n| 321 | [What are typed arrays](#what-are-typed-arrays) |\n| 322 | [What are the advantages of module loaders](#what-are-the-advantages-of-module-loaders) |\n| 323 | [What is collation](#what-is-collation) |\n| 324 | [What is for...of statement](#what-is-forof-statement) |\n| 325 | [What is the output of below spread operator array](#what-is-the-output-of-below-spread-operator-array) |\n| 326 | [Is PostMessage secure](#is-postmessage-secure) |\n| 327 | [What are the problems with postmessage target origin as wildcard](#what-are-the-problems-with-postmessage-target-origin-as-wildcard) |\n| 328 | [How do you avoid receiving postMessages from attackers](#how-do-you-avoid-receiving-postmessages-from-attackers) |\n| 329 | [Can I avoid using postMessages completely](#can-i-avoid-using-postmessages-completely) |\n| 330 | [Is postMessages synchronous](#is-postmessages-synchronous) |\n| 331 | [What paradigm is Javascript](#what-paradigm-is-javascript) |\n| 332 | [What is the difference between internal and external javascript](#what-is-the-difference-between-internal-and-external-javascript) |\n| 333 | [Is JavaScript faster than server side script](#is-javascript-faster-than-server-side-script) |\n| 334 | [How do you get the status of a checkbox](#how-do-you-get-the-status-of-a-checkbox) |\n| 335 | [What is the purpose of double tilde operator](#what-is-the-purpose-of-double-tilde-operator) |\n| 336 | [How do you convert character to ASCII code](#how-do-you-convert-character-to-ascii-code) |\n| 337 | [What is ArrayBuffer](#what-is-arraybuffer) |\n| 338 | [What is the output of below string expression](#what-is-the-output-of-below-string-expression) |\n| 339 | [What is the purpose of Error object](#what-is-the-purpose-of-error-object) |\n| 340 | [What is the purpose of EvalError object](#what-is-the-purpose-of-evalerror-object) |\n| 341 | [What are the list of cases error thrown from non-strict mode to strict mode](#what-are-the-list-of-cases-error-thrown-from-non-strict-mode-to-strict-mode) |\n| 342 | [Do all objects have prototypes](#do-all-objects-have-prototypes) |\n| 343 | [What is the difference between a parameter and an argument](#what-is-the-difference-between-a-parameter-and-an-argument) |\n| 344 | [What is the purpose of some method in arrays](#what-is-the-purpose-of-some-method-in-arrays) |\n| 345 | [How do you combine two or more arrays](#how-do-you-combine-two-or-more-arrays) |\n| 346 | [What is the difference between Shallow and Deep copy](#what-is-the-difference-between-shallow-and-deep-copy) |\n| 347 | [How do you create specific number of copies of a string](#how-do-you-create-specific-number-of-copies-of-a-string) |\n| 348 | [How do you return all matching strings against a regular expression](#how-do-you-return-all-matching-strings-against-a-regular-expression) |\n| 349 | [How do you trim a string at the beginning or ending](#how-do-you-trim-a-string-at-the-beginning-or-ending) |\n| 350 | [What is the output of below console statement with unary operator](#what-is-the-output-of-below-console-statement-with-unary-operator) |\n| 351 | [Does javascript uses mixins](#does-javascript-uses-mixins) |\n| 352 | [Mixin Example using Object composition](#mixin-example-using-object-composition) |\n| 353 | [Benefits](#benefits) |\n| 354 | [What is a thunk function](#what-is-a-thunk-function) |\n| 355 | [What are asynchronous thunks](#what-are-asynchronous-thunks) |\n| 356 | [What is the output of below function calls](#what-is-the-output-of-below-function-calls) |\n| 357 | [How to remove all line breaks from a string](#how-to-remove-all-line-breaks-from-a-string) |\n| 358 | [What is the difference between reflow and repaint](#what-is-the-difference-between-reflow-and-repaint) |\n| 359 | [What happens with negating an array](#what-happens-with-negating-an-array) |\n| 360 | [What happens if we add two arrays](#what-happens-if-we-add-two-arrays) |\n| 361 | [What is the output of prepend additive operator on falsy values](#what-is-the-output-of-prepend-additive-operator-on-falsy-values) |\n| 362 | [How do you create self string using special characters](#how-do-you-create-self-string-using-special-characters) |\n| 363 | [How do you remove falsy values from an array](#how-do-you-remove-falsy-values-from-an-array) |\n| 364 | [How do you get unique values of an array](#how-do-you-get-unique-values-of-an-array) |\n| 365 | [What is destructuring aliases](#what-is-destructuring-aliases) |\n| 366 | [How do you map the array values without using map method](#how-do-you-map-the-array-values-without-using-map-method) |\n| 367 | [How do you empty an array](#how-do-you-empty-an-array) |\n| 368 | [How do you round numbers to certain decimals](#how-do-you-round-numbers-to-certain-decimals) |\n| 369 | [What is the easiest way to convert an array to an object](#what-is-the-easiest-way-to-convert-an-array-to-an-object) |\n| 370 | [How do you create an array with some data](#how-do-you-create-an-array-with-some-data) |\n| 371 | [What are the placeholders from console object](#what-are-the-placeholders-from-console-object) |\n| 372 | [Is it possible to add CSS to console messages](#is-it-possible-to-add-css-to-console-messages) |\n| 373 | [What is the purpose of dir method of console object](#what-is-the-purpose-of-dir-method-of-console-object) |\n| 374 | [Is it possible to debug HTML elements in console](#is-it-possible-to-debug-html-elements-in-console) |\n| 375 | [How do you display data in a tabular format using console object](#how-do-you-display-data-in-a-tabular-format-using-console-object) |\n| 376 | [How do you verify that an argument is a Number or not](#how-do-you-verify-that-an-argument-is-a-number-or-not) |\n| 377 | [How do you create copy to clipboard button](#how-do-you-create-copy-to-clipboard-button) |\n| 378 | [What is the shortcut to get timestamp](#what-is-the-shortcut-to-get-timestamp) |\n| 379 | [How do you flattening multi dimensional arrays](#how-do-you-flattening-multi-dimensional-arrays) |\n| 380 | [What is the easiest multi condition checking](#what-is-the-easiest-multi-condition-checking) |\n| 381 | [How do you capture browser back button](#how-do-you-capture-browser-back-button) |\n| 382 | [How do you disable right click in the web page](#how-do-you-disable-right-click-in-the-web-page) |\n| 383 | [What are wrapper objects](#what-are-wrapper-objects) |\n| 384 | [What is AJAX](#what-is-ajax) |\n| 385 | [What are the different ways to deal with Asynchronous Code](#what-are-the-different-ways-to-deal-with-asynchronous-code) |\n| 386 | [How to cancel a fetch request](#how-to-cancel-a-fetch-request) |\n| 387 | [What is web speech API](#what-is-web-speech-api) |\n| 388 | [What is minimum timeout throttling](#what-is-minimum-timeout-throttling) |\n| 389 | [How do you implement zero timeout in modern browsers](#how-do-you-implement-zero-timeout-in-modern-browsers) |\n| 390 | [What are tasks in event loop](#what-are-tasks-in-event-loop) |\n| 391 | [What is microtask](#what-is-microtask) |\n| 392 | [What are different event loops](#what-are-different-event-loops) |\n| 393 | [What is the purpose of queueMicrotask](#what-is-the-purpose-of-queuemicrotask) |\n| 394 | [How do you use javascript libraries in typescript file](#how-do-you-use-javascript-libraries-in-typescript-file) |\n| 395 | [What are the differences between promises and observables](#what-are-the-differences-between-promises-and-observables) |\n| 396 | [What is heap](#what-is-heap) |\n| 397 | [What is an event table](#what-is-an-event-table) |\n| 398 | [What is a microTask queue](#what-is-a-microtask-queue) |\n| 399 | [What is the difference between shim and polyfill](#what-is-the-difference-between-shim-and-polyfill) |\n| 400 | [How do you detect primitive or non primitive value type](#how-do-you-detect-primitive-or-non-primitive-value-type) |\n| 401 | [What is babel](#what-is-babel) |\n| 402 | [Is Node.js completely single threaded](#is-nodejs-completely-single-threaded) |\n| 403 | [What are the common use cases of observables](#what-are-the-common-use-cases-of-observables) |\n| 404 | [What is RxJS](#what-is-rxjs) |\n| 405 | [What is the difference between Function constructor and function declaration](#what-is-the-difference-between-function-constructor-and-function-declaration) |\n| 406 | [What is a Short circuit condition](#what-is-a-short-circuit-condition) |\n| 407 | [What is the easiest way to resize an array](#what-is-the-easiest-way-to-resize-an-array) |\n| 408 | [What is an observable](#what-is-an-observable) |\n| 409 | [What is the difference between function and class declarations](#what-is-the-difference-between-function-and-class-declarations) |\n| 410 | [What is an async function](#what-is-an-async-function) |\n| 411 | [How do you prevent promises swallowing errors](#how-do-you-prevent-promises-swallowing-errors) |\n| 412 | [What is deno](#what-is-deno) |\n| 413 | [How do you make an object iterable in javascript](#how-do-you-make-an-object-iterable-in-javascript) |\n| 414 | [What is a Proper Tail Call](#what-is-a-proper-tail-call) |\n| 415 | [How do you check an object is a promise or not](#how-do-you-check-an-object-is-a-promise-or-not) |\n| 416 | [How to detect if a function is called as constructor](#how-to-detect-if-a-function-is-called-as-constructor) |\n| 417 | [What are the differences between arguments object and rest parameter](#what-are-the-differences-between-arguments-object-and-rest-parameter) |\n| 418 | [What are the differences between spread operator and rest parameter](#what-are-the-differences-between-spread-operator-and-rest-parameter) |\n| 419 | [What are the different kinds of generators](#what-are-the-different-kinds-of-generators) |\n| 420 | [What are the built-in iterables](#what-are-the-built-in-iterables) |\n| 421 | [What are the differences between for...of and for...in statements](#what-are-the-differences-between-forof-and-forin-statements) |\n| 422 | [How do you define instance and non-instance properties](#how-do-you-define-instance-and-non-instance-properties) |\n| 423 | [What is the difference between isNaN and Number.isNaN?](#what-is-the-difference-between-isnan-and-numberisnan) |\n| 424 | [How to invoke an IIFE without any extra brackets?](#how-to-invoke-an-iife-without-any-extra-brackets) |\n| 425 | [Is that possible to use expressions in switch cases?](#is-that-possible-to-use-expressions-in-switch-cases) |\n| 426 | [What is the easiest way to ignore promise errors?](#what-is-the-easiest-way-to-ignore-promise-errors) |\n| 427 | [How do style the console output using CSS?](#how-do-style-the-console-output-using-css) |\n| 428 | [What is nullish coalescing operator (??)?](#what-is-nullish-coalescing-operator-) |\n| 429 | [How do you group and nest console output?](#how-do-you-group-and-nest-console-output) |\n| 430 | [What is the difference between dense and sparse arrays?](#what-is-the-difference-between-dense-and-sparse-arrays) |\n| 431 | [What are the different ways to create sparse arrays?](#what-are-the-different-ways-to-create-sparse-arrays) |\n| 432 | [What is the difference between setTimeout, setImmediate and process.nextTick?](#what-is-the-difference-between-settimeout-setimmediate-and-processnexttick) |\n| 433 | [How do you reverse an array without modifying original array?](#how-do-you-reverse-an-array-without-modifying-original-array) |\n| 434 | [How do you create custom HTML element?](#how-do-you-create-custom-html-element) |\n| 435 | [What is global execution context?](#what-is-global-execution-context) |\n| 436 | [What is function execution context?](#what-is-function-execution-context) |\n| 437 | [What is debouncing?](#what-is-debouncing) |\n| 438 | [What is throttling?](#what-is-throttling) |\n| 439 | [What is optional chaining?](#what-is-optional-chaining) |\n| 440 | [What is an environment record?](#what-is-an-environment-record) |\n| 441 | [How to verify if a variable is an array?](#how-to-verify-if-a-variable-is-an-array) |\n| 442 | [What is pass by value and pass by reference?](#what-is-pass-by-value-and-pass-by-reference) |\n| 443 | [What are the differences between primitives and non-primitives?](#what-are-the-differences-between-primitives-and-non-primitives) |\n| 444 | [How do you create your own bind method using either call or apply method?](#how-do-you-create-your-own-bind-method-using-either-call-or-apply-method) |\n| 445 | [What are the differences between pure and impure functions?](#what-are-the-differences-between-pure-and-impure-functions) |\n| 446 | [What is referential transparency?](#what-is-referential-transparency) |\n| 447 | [What are the possible side-effects in javascript?](#what-are-the-possible-side-effects-in-javascript) |\n| 448 | [What are compose and pipe functions?](#what-are-compose-and-pipe-functions) |\n| 449 | [What is module pattern?](#what-is-module-pattern) |\n| 450 | [What is Function Composition?](#what-is-function-composition) |\n| 451 | [How to use await outside of async function prior to ES2022?](#how-to-use-await-outside-of-async-function-prior-to-es2022) |\n| 452 | [What is the purpose of the this keyword in JavaScript?](#what-is-the-purpose-of-the-this-keyword-in-javascript) |\n| 453 | [What are the uses of closures?](#what-are-the-uses-of-closures) |\n| 454 | [What are the phases of execution context?](#what-are-the-phases-of-execution-context) |\n| 455 | [What are the possible reasons for memory leaks?](#what-are-the-possible-reasons-for-memory-leaks) |\n| 456 | [What are the optimization techniques of V8 engine?](#what-are-the-optimization-techniques-of-v8-engine) |\n| 457 | [What are the examples of built-in higher order functions?](#what-are-the-examples-of-built-in-higher-order-functions) |\n| 458 | [What are the benefits higher order functions?](#what-are-the-benefits-higher-order-functions) |\n| 459 | [How do you create polyfills for map, filter and reduce methods?](#how-do-you-create-polyfills-for-map-filter-and-reduce-methods) |\n| 460 | [What is the difference between map and forEach functions?](#what-is-the-difference-between-map-and-foreach-functions) |\n| 461 | [Give an example of statements affected by automatic semicolon insertion?](#give-an-example-of-statements-affected-by-automatic-semicolon-insertion) |\n| 462 | [What are the event phases of a browser?](#what-are-the-event-phases-of-a-browser) |\n| 463 | [What are the real world use cases of proxy?](#what-are-the-real-world-use-cases-of-proxy) |\n| 464 | [What are hidden classes?](#what-are-hidden-classes) |\n| 465 | [What is inline caching?](#what-is-inline-caching) |\n| 466 | [What are the different ways to execute external scripts?](#what-are-the-different-ways-to-execute-external-scripts) |\n| 467 | [What is Lexical Scope?](#what-is-lexical-scope) |\n| 468 | [How to detect system dark mode in javascript?](#how-to-detect-system-dark-mode-in-javascript) |\n| 469 | [What is the purpose of requestAnimationFrame method?](#what-is-the-purpose-of-requestanimationframe-method) |\n| 470 | [What is the difference between substring and substr methods?](#what-is-the-difference-between-substring-and-substr-methods) |\n| 471 | [How to find the number of parameters expected by a function?](#how-to-find-the-number-of-parameters-expected-by-a-function) |\n| 472 | [What is globalThis, and what is the importance of it?](#what-is-globalthis-and-what-is-the-importance-of-it) |\n| 473 | [What are the array mutation methods?](#what-are-the-array-mutation-methods) |\n| 474 | [What is module scope in JavaScript?](#what-is-module-scope-in-javascript) |\n| 475 | [What are shadowing and illegal shadowing?](#what-are-shadowing-and-illegal-shadowing) |\n| 476 | [Why is it important to remove event listeners after use?](#why-is-it-important-to-remove-event-listeners-after-use) |\n| 477 | [What is structuredClone and how is it used for deep copying objects?](#what-is-structuredclone-and-how-is-it-used-for-deep-copying-objects) |\n| 478 | [What is the difference between const and Object.freeze](#what-is-the-difference-between-const-and-objectfreeze) |\n\u003C!-- TOC_END -->\n\n\u003C!-- QUESTIONS_START -->\n\n1. ### What are the possible ways to create objects in JavaScript\n\n    There are many ways to create objects in javascript as mentioned below:\n\n    1. **Object literal syntax:**\n\n       The object literal syntax (or object initializer), is a comma-separated set of name-value pairs wrapped in curly braces.\n\n       ```javascript\n       var object = {\n         name: \"Sudheer\",\n         age: 34,\n       };\n       ```\n\n       Object literal property values can be of any data type, including array, function, and nested object.\n\n       **Note:** This is one of the easiest ways to create an object and it's most commonly used for creating simple, ad-hoc objects.\n\n    2. **Object constructor:**\n\n       The simplest way to create an empty object is using the `Object` constructor. Currently this approach is not recommended.\n\n       ```javascript\n       var object = new Object();\n       ```\n\n       The `Object()` is a built-in constructor function so \"new\" keyword is not required for creating plain objects. The above code snippet can be re-written as:\n\n       ```javascript\n       var object = Object();\n       ```\n       However, `Object()` can be used to either create a plain object or convert a given value into its corresponding object wrapper, whereas `new Object()` is specifically used to explicitly create a new object instance.\n       \n    3. **Object's create method:**\n\n       The `create` method of Object is used to create a new object by passing the specified prototype object and properties as arguments, i.e., this pattern is helpful to create new objects based on existing objects. In other words, this is useful for setting up **prototypal inheritance**. The second argument is optional and it is used to create properties on a newly created object.\n\n       The following code creates a new empty object whose prototype is null.\n\n       ```javascript\n       var object = Object.create(null);\n       ```\n\n       The following example creates an object along with additional new properties.\n\n       ```javascript\n       let vehicle = {\n         wheels: \"4\",\n         fuelType: \"Gasoline\",\n         color: \"Green\",\n       };\n       let carProps = {\n         type: {\n           value: \"Volkswagen\",\n         },\n         model: {\n           value: \"Golf\",\n         },\n       };\n\n       var car = Object.create(vehicle, carProps);\n       console.log(car);\n       ```\n\n    4. **Function constructor:**\n\n       In this approach, create any function and apply the new operator to create object instances. This was the main way to do constructor-based OOP before ES6 classes.\n\n       ```javascript\n       function Person(name) {\n         this.name = name;\n         this.age = 21;\n       }\n       var object = new Person(\"Sudheer\");\n       ```\n    5. **Function constructor with prototype:**\n\n       This is similar to function constructor but it uses prototype for their properties and methods. Using prototype means you're sharing methods\u002Fproperties across instances, which saves memory and improve performance.\n\n       ```javascript\n       function Person() {}\n       Person.prototype.name = \"Sudheer\";\n       var object = new Person();\n       ```\n\n       This is equivalent to creating an instance with `Object.create` method with a function prototype and then calling that function with an instance and parameters as arguments.\n\n       ```javascript\n       function func(x, y, z) {\n        this.x = x;\n        this.y = y;\n        this.z = z;\n       }\n\n       var instance = new func(1, 2, 3);\n       ```\n\n       **(OR)**\n\n       ```javascript\n       function func(x, y, z) {\n          this.x = x;\n          this.y = y;\n          this.z = z;\n       }\n       \u002F\u002F Create a new instance using function prototype.\n       var newInstance = Object.create(func.prototype);\n\n       \u002F\u002F Call the function\n       var result = func.call(newInstance, 1, 2, 3);\n\n       \u002F\u002F If the result is a non-null object then use it otherwise just use the new instance.\n       console.log(result && typeof result === 'object' ? result : newInstance);\n       ```\n\n    6. **Object's assign method:**\n\n       The `Object.assign` method is used to copy all the properties from one or more source objects and stores them into a target object. This is mainly used for cloning and merging\n\n       The following code creates a new staff object by copying properties of his working company and the car he owns.\n\n       ```javascript\n       const orgObject = { company: \"XYZ Corp\" };\n       const carObject = { name: \"Toyota\" };\n       const staff = Object.assign({}, orgObject, carObject);\n       ```\n\n    7. **ES6 Class syntax:**\n\n       ES6 introduces class feature to create objects. This is syntactic sugar over the prototype-based system.\n\n       ```javascript\n       class Person {\n         constructor(name) {\n           this.name = name;\n         }\n       }\n\n       var object = new Person(\"Sudheer\");\n       ```\n\n    8. **Singleton pattern:**\n\n       A Singleton is an object which can only be instantiated one time. Repeated calls to its constructor return the same instance. This way one can ensure that they don't accidentally create multiple instances.\n\n        ##### Singleton with Closure (Classic JS Pattern)\n        ```javascript\n        const Singleton = (function () {\n        let instance;\n\n        function createInstance() {\n          return { name: \"Sudheer\" };\n        }\n\n        return {\n          getInstance: function () {\n            if (!instance) {\n              instance = createInstance();\n            }\n            return instance;\n          }\n        };\n        })();\n\n        \u002F\u002F Usage\n        const obj1 = Singleton.getInstance();\n        const obj2 = Singleton.getInstance();\n\n        console.log(obj1 === obj2); \u002F\u002F true\n        ```\n         In modern JavaScript applications, singletons are commonly implemented using ES6 modules for their built-in caching behavior, or closures for encapsulated state management.\n\n      **[⬆ Back to Top](#table-of-contents)**\n\n2. ### What is a prototype chain\n\n    The prototype chain is a core concept in JavaScript’s inheritance model. It allows objects to inherit properties and methods from other objects. When you try to access a property or method on an object, JavaScript first looks for it on that object itself. If it’s not found, the engine looks up the object's internal `[[Prototype]]` reference (accessible via `Object.getPrototypeOf(obj)` or the deprecated `__proto__` property) and continues searching up the chain until it finds the property or reaches the end (usually `null`).\n\n    For objects created via constructor functions, the prototype chain starts with the instance, then refers to the constructor’s `.prototype` object, and continues from there. For example:\n\n    ```javascript\n    function Person() {}\n    const person1 = new Person();\n\n    console.log(Object.getPrototypeOf(person1) === Person.prototype); \u002F\u002F true\n    ```\n\n    This mechanism allows for property and method sharing among objects, enabling code reuse and a form of inheritance.\n\n    **Summary:**\n\n    *   The prototype chain enables inheritance in JavaScript.\n    *   If a property isn’t found on an object, JavaScript looks up its prototype chain.\n    *   The prototype of an object instance can be accessed with `Object.getPrototypeOf(obj)` or `__proto__`.\n    *   The prototype of a constructor function is available via `Constructor.prototype`.\n    *   The chain ends when the prototype is `null`.\n\n    The prototype chain among objects appears as below, \n    \n    ![Screenshot](images\u002Fprototype_chain.png)\n\n    **[⬆ Back to Top](#table-of-contents)**\n\n3. ### What is the Difference Between `call`, `apply`, and `bind`\n\n  In JavaScript, `call`, `apply`, and `bind` are methods that allow you to control the context (`this` value) in which a function is executed. While their purposes are similar, they differ in how they handle arguments and when the function is invoked.\n\n  ---\n\n  #### `call`\n\n  - **Description:**  \n    The `call()` method invokes a function immediately, allowing you to specify the value of `this` and pass arguments individually (comma-separated).\n\n  - **Syntax:**  \n    ```js\n    func.call(thisArg, arg1, arg2, ...)\n    ```\n\n  - **Example:**\n    ```js\n    var employee1 = { firstName: \"John\", lastName: \"Rodson\" };\n    var employee2 = { firstName: \"Jimmy\", lastName: \"Baily\" };\n\n    function invite(greeting1, greeting2) {\n      console.log(\n        greeting1 + \" \" + this.firstName + \" \" + this.lastName + \", \" + greeting2\n      );\n    }\n\n    invite.call(employee1, \"Hello\", \"How are you?\"); \u002F\u002F Hello John Rodson, How are you?\n    invite.call(employee2, \"Hello\", \"How are you?\"); \u002F\u002F Hello Jimmy Baily, How are you?\n    ```\n\n  ---\n\n  #### `apply`\n\n  - **Description:**  \n    The `apply()` method is similar to `call()`, but it takes the function arguments as an array (or array-like object) instead of individual arguments.\n\n  - **Syntax:**  \n    ```js\n    func.apply(thisArg, [argsArray])\n    ```\n\n  - **Example:**\n    ```js\n    var employee1 = { firstName: \"John\", lastName: \"Rodson\" };\n    var employee2 = { firstName: \"Jimmy\", lastName: \"Baily\" };\n\n    function invite(greeting1, greeting2) {\n      console.log(\n        greeting1 + \" \" + this.firstName + \" \" + this.lastName + \", \" + greeting2\n      );\n    }\n\n    invite.apply(employee1, [\"Hello\", \"How are you?\"]); \u002F\u002F Hello John Rodson, How are you?\n    invite.apply(employee2, [\"Hello\", \"How are you?\"]); \u002F\u002F Hello Jimmy Baily, How are you?\n    ```\n\n  ---\n\n  #### `bind`\n\n  - **Description:**  \n    The `bind()` method creates a new function with a specific `this` value and, optionally, preset initial arguments. Unlike `call` and `apply`, `bind` does **not** immediately invoke the function; instead, it returns a new function that you can call later.\n\n  - **Syntax:**  \n    ```js\n    var boundFunc = func.bind(thisArg[, arg1[, arg2[, ...]]])\n    ```\n\n  - **Example:**\n    ```js\n    var employee1 = { firstName: \"John\", lastName: \"Rodson\" };\n    var employee2 = { firstName: \"Jimmy\", lastName: \"Baily\" };\n\n    function invite(greeting1, greeting2) {\n      console.log(\n        greeting1 + \" \" + this.firstName + \" \" + this.lastName + \", \" + greeting2\n      );\n    }\n\n    var inviteEmployee1 = invite.bind(employee1);\n    var inviteEmployee2 = invite.bind(employee2);\n\n    inviteEmployee1(\"Hello\", \"How are you?\"); \u002F\u002F Hello John Rodson, How are you?\n    inviteEmployee2(\"Hello\", \"How are you?\"); \u002F\u002F Hello Jimmy Baily, How are you?\n    ```\n\n  ---\n\n  #### Summary\n\n  | Method | Invokes Function Immediately? | How Arguments Are Passed         | Returns      |\n  |--------|-------------------------------|----------------------------------|--------------|\n  | `call` | Yes                           | Comma-separated list             | Function's result |\n  | `apply`| Yes                           | Array or array-like object       | Function's result |\n  | `bind` | No                            | (Optional) preset, then rest     | New function      |\n\n  ---\n\n  ## Key Points\n\n  - **`call`** and **`apply`** are almost interchangeable; both invoke the function immediately, but differ in how arguments are passed.\n      - _Tip:_ \"Call is for Comma-separated, Apply is for Array.\"\n  - **`bind`** does not execute the function immediately. Instead, it creates a new function with the specified `this` value and optional arguments, which can be called later.\n\n  - Use `call` or `apply` when you want to immediately invoke a function with a specific `this` context. Use `bind` when you want to create a new function with a specific `this` context to be invoked later.\n  \n  ---\n\n  **[⬆ Back to Top](#table-of-contents)**\n\n4. ### What is JSON and its common operations\n\n    **JSON (JavaScript Object Notation)** is a lightweight, text-based data format that uses JavaScript object syntax for structuring data. It was popularized by Douglas Crockford and is widely used for transmitting data between a server and a client in web applications. JSON files typically have a `.json` extension and use the MIME type `application\u002Fjson`. \n\n    #### Common Operations with JSON\n\n    1. **Parsing**: Transforming a JSON-formatted string into a native JavaScript object.\n      ```js\n      const obj = JSON.parse(jsonString);\n      ```\n      - Example:  \n        ```js\n        const jsonString = '{\"name\":\"John\",\"age\":30}';\n        const obj = JSON.parse(jsonString);  \u002F\u002F { name: \"John\", age: 30 }\n        ```\n\n    2. **Stringification**: Converting a JavaScript object into a JSON-formatted string, commonly used for data transmission or storage.\n      ```js\n      const jsonString = JSON.stringify(object);\n      ```\n      - Example:  \n        ```js\n        const obj = { name: \"Jane\", age: 25 };\n        const jsonString = JSON.stringify(obj);  \u002F\u002F '{\"name\":\"Jane\",\"age\":25}'\n        ```\n\n    **[⬆ Back to Top](#table-of-contents)**\n\n5. ### What is the purpose of the array slice method\n\n    The `slice()` method in JavaScript is used to extract a section of an array, returning a new array containing the selected elements. It does not modify the original array. The method takes two arguments:\n\n    - **start**: The index at which extraction begins (inclusive).\n    - **end** (optional): The index before which to end extraction (exclusive). If omitted, extraction continues to the end of the array.\n\n    You can also use negative indices, which count from the end of the array.\n\n    #### Examples:\n\n    ```js\n    let arrayIntegers = [1, 2, 3, 4, 5];\n\n    let arrayIntegers1 = arrayIntegers.slice(0, 2);    \u002F\u002F [1, 2]\n    let arrayIntegers2 = arrayIntegers.slice(2, 3);    \u002F\u002F [3]\n    let arrayIntegers3 = arrayIntegers.slice(4);       \u002F\u002F [5]\n    let arrayIntegers4 = arrayIntegers.slice(-3, -1);  \u002F\u002F [3, 4]\n    ```\n\n    **Note:**  \n    The `slice()` method does **not** mutate (change) the original array; instead, it returns a new array containing the extracted elements.\n\n    **[⬆ Back to Top](#table-of-contents)**\n\n6. ### What is the purpose of the array splice method\n\n    The `splice()` method in JavaScript is used to add, remove, or replace elements within an array. Unlike `slice()`, which creates a shallow copy and does not alter the original array, `splice()` **modifies the original array in place** and returns an array containing the removed elements.\n\n    #### Syntax\n\n    ```javascript\n    array.splice(start, deleteCount, item1, item2, ...)\n    ```\n    - **start:** The index at which to start changing the array.\n    - **deleteCount:** (Optional) The number of elements to remove from the array. If omitted, all elements from the start index to the end of the array will be removed.\n    - **item1, item2, ...:** (Optional) Elements to add to the array, starting at the start position.\n\n    #### Examples\n\n    ```javascript\n    let arrayIntegersOriginal1 = [1, 2, 3, 4, 5];\n    let arrayIntegersOriginal2 = [1, 2, 3, 4, 5];\n    let arrayIntegersOriginal3 = [1, 2, 3, 4, 5];\n\n    \u002F\u002F Remove the first two elements\n    let arrayIntegers1 = arrayIntegersOriginal1.splice(0, 2); \n    \u002F\u002F arrayIntegers1: [1, 2]\n    \u002F\u002F arrayIntegersOriginal1 (after): [3, 4, 5]\n\n    \u002F\u002F Remove all elements from index 3 onwards\n    let arrayIntegers2 = arrayIntegersOriginal2.splice(3);     \n    \u002F\u002F arrayIntegers2: [4, 5]\n    \u002F\u002F arrayIntegersOriginal2 (after): [1, 2, 3]\n\n    \u002F\u002F Remove 1 element at index 3, then insert \"a\", \"b\", \"c\" at that position\n    let arrayIntegers3 = arrayIntegersOriginal3.splice(3, 1, \"a\", \"b\", \"c\"); \n    \u002F\u002F arrayIntegers3: [4]\n    \u002F\u002F arrayIntegersOriginal3 (after): [1, 2, 3, \"a\", \"b\", \"c\", 5]\n    ```\n\n    **Note:**  \n    - The `splice()` method **modifies the original array**.\n    - It returns an array containing the elements that were removed (if any).\n    - You can use it both to remove and insert elements in a single operation.\n\n    **[⬆ Back to Top](#table-of-contents)**\n\n7. ### What is the difference between slice and splice\n   \n    Here are the key differences between `slice()` and `splice()` methods in JavaScript arrays:\n\n    | `slice()`                                         | `splice()`                                          |\n    | ------------------------------------------------- | --------------------------------------------------- |\n    | Does **not** modify the original array (immutable) | Modifies the original array (mutable)               |\n    | Returns a **shallow copy** (subset) of selected elements | Returns an array of the **removed** elements           |\n    | Used to **extract** elements from an array         | Used to **add**, **remove**, or **replace** elements in an array |\n    | Syntax: `array.slice(start, end)`                  | Syntax: `array.splice(start, deleteCount, ...items)`             |\n\n    **Summary:**  \n    - Use `slice()` when you want to copy or extract elements without altering the original array.\n    - Use `splice()` when you need to add, remove, or replace elements and want to change the original array.\n\n    **[⬆ Back to Top](#table-of-contents)**\n\n8. ### How do you compare Object and Map\n\n    **Objects** and **Maps** both allow you to associate keys with values, retrieve those values, delete keys, and check if a key exists. Historically, Objects have been used as Maps, but there are several key differences that make `Map` a better choice in certain scenarios:\n\n    | Feature                  | Object                                              | Map                                                      |\n    |--------------------------|----------------------------","该项目是一个包含1000个JavaScript面试题的列表，旨在帮助开发者准备技术面试。它涵盖了从基础到高级的各种主题，包括核心JavaScript、框架（如Angular、React和Vue.js）以及常见的编码问题。每个问题都附有详细的解答，有助于深入理解JavaScript及其生态系统。适合正在准备前端或全栈开发职位面试的技术人员使用，也适用于希望通过系统学习提升自身JavaScript技能的开发者。",2,"2026-06-11 02:51:37","top_language"]