{"id":10162,"date":"2023-05-01T11:42:26","date_gmt":"2023-05-01T11:42:26","guid":{"rendered":"https:\/\/www.scmgalaxy.com\/tutorials\/?p=10162"},"modified":"2023-06-19T13:29:52","modified_gmt":"2023-06-19T13:29:52","slug":"top-50-javascript-interview-questions-with-answers","status":"publish","type":"post","link":"https:\/\/www.scmgalaxy.com\/tutorials\/top-50-javascript-interview-questions-with-answers\/","title":{"rendered":"Top 50 JavaScript Interview Questions with Answers"},"content":{"rendered":"<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.scmgalaxy.com\/tutorials\/wp-content\/uploads\/2023\/05\/image-23-1024x576.png\" alt=\"\" class=\"wp-image-10163\" width=\"664\" height=\"373\" srcset=\"https:\/\/www.scmgalaxy.com\/tutorials\/wp-content\/uploads\/2023\/05\/image-23-1024x576.png 1024w, https:\/\/www.scmgalaxy.com\/tutorials\/wp-content\/uploads\/2023\/05\/image-23-300x169.png 300w, https:\/\/www.scmgalaxy.com\/tutorials\/wp-content\/uploads\/2023\/05\/image-23-768x432.png 768w, https:\/\/www.scmgalaxy.com\/tutorials\/wp-content\/uploads\/2023\/05\/image-23.png 1200w\" sizes=\"auto, (max-width: 664px) 100vw, 664px\" \/><figcaption class=\"wp-element-caption\"><strong><em>JavaScript Interview Questions with Answers<\/em><\/strong><\/figcaption><\/figure>\n<\/div>\n\n\n<ol class=\"wp-block-list\">\n<li>What is JavaScript?<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">A. A programming language<br>B. A markup language<br>C. A web browser<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Answer: A<\/h4>\n\n\n\n<ol class=\"wp-block-list\" start=\"2\">\n<li>What is the output of console.log(&#8220;Hello&#8221; + 4)?<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">A. Hello4<br>B. TypeError<br>C. Hello<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Answer: A<\/h4>\n\n\n\n<ol class=\"wp-block-list\" start=\"3\">\n<li>Which one of the following is considered a falsy value in JavaScript?<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">A. null<br>B. NaN<br>C. undefined<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Answer: A<\/h4>\n\n\n\n<ol class=\"wp-block-list\" start=\"4\">\n<li>What is the difference between == and ===?<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">A. Both are the same<br>B. == only compares values, while === compares both values and data types<br>C. === only compares values, while == compares both values and data types<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Answer: B<\/h4>\n\n\n\n<ol class=\"wp-block-list\" start=\"5\">\n<li>What is an example of a higher-order function in JavaScript?<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">A. setTimeout()<br>B. console.log()<br>C. Math.random()<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Answer: A<\/h4>\n\n\n\n<ol class=\"wp-block-list\" start=\"6\">\n<li>What is the output of console.log(5 == &#8220;5&#8221;)?<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">A. true<br>B. false<br>C. undefined<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Answer: A<\/h4>\n\n\n\n<ol class=\"wp-block-list\" start=\"7\">\n<li>What is the output of console.log(typeof null)?<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">A. null<br>B. object<br>C. undefined<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Answer: B<\/h4>\n\n\n\n<ol class=\"wp-block-list\" start=\"8\">\n<li>What is the output of console.log([1, 2, 3] + [4, 5, 6])?<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">A. [1, 2, 3, 4, 5, 6]<br>B. 123456<br>C. NaN<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Answer: B<\/h4>\n\n\n\n<ol class=\"wp-block-list\" start=\"9\">\n<li>Which one of the following is an example of a JavaScript event?<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">A. click<br>B. div<br>C. span<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Answer: A<\/h4>\n\n\n\n<ol class=\"wp-block-list\" start=\"10\">\n<li>What is the output of console.log(+&#8221;5&#8243;)?<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">A. 5<br>B. &#8220;5&#8221;<br>C. TypeError<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Answer: A<\/h4>\n\n\n\n<ol class=\"wp-block-list\" start=\"11\">\n<li>What is the output of console.log(10%3)?<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">A. 1<br>B. 3<br>C. 0<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Answer: A<\/h4>\n\n\n\n<ol class=\"wp-block-list\" start=\"12\">\n<li>Which one of the following is a valid JavaScript variable name?<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">A. my-variable<br>B. my variable<br>C. myVariable<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Answer: C<\/h4>\n\n\n\n<ol class=\"wp-block-list\" start=\"13\">\n<li>What is the output of console.log(!&#8221;Hello&#8221;)?<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">A. false<br>B. true<br>C. &#8220;&#8221; (empty string)<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Answer: B<\/h4>\n\n\n\n<ol class=\"wp-block-list\" start=\"14\">\n<li>What is the output of console.log(5 + &#8220;5&#8221;)?<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">A. &#8220;55&#8221;<br>B. 10<br>C. TypeError<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Answer: A<\/h4>\n\n\n\n<ol class=\"wp-block-list\" start=\"15\">\n<li>What is an example of a JavaScript closure?<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">A. function add(x, y) { return x + y; }<br>B. function() { var x = 5; return function() { return x; } }<br>C. var x = 5; x++;<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Answer: B<\/h4>\n\n\n\n<ol class=\"wp-block-list\" start=\"16\">\n<li>What is the output of console.log(typeof undefined)?<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">A. undefined<br>B. null<br>C. object<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Answer: A<\/h4>\n\n\n\n<ol class=\"wp-block-list\" start=\"17\">\n<li>What is the output of console.log(Infinity &#8211; Infinity)?<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">A. NaN<br>B. Infinity<br>C. -Infinity<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Answer: NaN<\/h4>\n\n\n\n<ol class=\"wp-block-list\" start=\"18\">\n<li>What is the output of console.log(Math.floor(4.5))?<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">A. 4<br>B. 5<br>C. 4.5<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Answer: A<\/h4>\n\n\n\n<ol class=\"wp-block-list\" start=\"19\">\n<li>What is an example of a JavaScript constructor function?<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">A. function add(x, y) { return x + y; }<br>B. var obj = { name: &#8220;John&#8221;, age: 30 };<br>C. function Person(name, age) { this.name = name; this.age = age; }<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Answer: C<\/h4>\n\n\n\n<ol class=\"wp-block-list\" start=\"20\">\n<li>What is the output of console.log(Array.isArray({}))?<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">A. true<br>B. false<br>C. TypeError<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Answer: B<\/h4>\n\n\n\n<ol class=\"wp-block-list\" start=\"21\">\n<li>What is an example of a JavaScript callback function?<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">A. function add(x, y) { return x + y; }<br>B. setTimeout(function() { console.log(&#8220;Hello&#8221;); }, 1000);<br>C. var x = 5; x++;<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Answer: B<\/h4>\n\n\n\n<ol class=\"wp-block-list\" start=\"22\">\n<li>What is the output of console.log(Math.max([1, 2, 3]))?<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">A. 1<br>B. 2<br>C. 3<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Answer: NaN<\/h4>\n\n\n\n<ol class=\"wp-block-list\" start=\"23\">\n<li>What is an example of a JavaScript promise?<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">A. function add(x, y) { return x + y; }<br>B. new Promise(function(resolve, reject) { setTimeout(function() { resolve(&#8220;Hello&#8221;); }, 1000); });<br>C. var x = 5; x++;<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Answer: B<\/h4>\n\n\n\n<ol class=\"wp-block-list\" start=\"24\">\n<li>What is the output of console.log([&#8220;a&#8221;, &#8220;b&#8221;, &#8220;c&#8221;].splice(1, 1))?<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">A. [&#8220;a&#8221;, &#8220;c&#8221;]<br>B. [&#8220;b&#8221;, &#8220;c&#8221;]<br>C. &#8220;b&#8221;<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Answer: B<\/h4>\n\n\n\n<ol class=\"wp-block-list\" start=\"25\">\n<li>What is the output of console.log(&#8220;Hello John&#8221;.split(&#8221; &#8220;))?<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">A. &#8220;Hello John&#8221;<br>B. [&#8220;Hello&#8221;, &#8220;John&#8221;]<br>C. TypeError<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Answer: B<\/h4>\n\n\n\n<ol class=\"wp-block-list\" start=\"26\">\n<li>What is the output of console.log(20 + 30 + &#8220;40&#8221;)?<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">A. &#8220;2050&#8221;<br>B. &#8220;50&#8221;<br>C. TypeError<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Answer: A<\/h4>\n\n\n\n<ol class=\"wp-block-list\" start=\"27\">\n<li>What is the output of console.log(&#8220;Hello&#8221;.charAt(1))?<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">A. &#8220;h&#8221;<br>B. &#8220;e&#8221;<br>C. &#8220;l&#8221;<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Answer: B<\/h4>\n\n\n\n<ol class=\"wp-block-list\" start=\"28\">\n<li>What is an example of a JavaScript regular expression?<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">A. \/hello\/<br>B. function add(x, y) { return x + y; }<br>C. var x = 5; x++;<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Answer: A<\/h4>\n\n\n\n<ol class=\"wp-block-list\" start=\"29\">\n<li>What is the output of console.log(&#8220;Hello&#8221;.toUpperCase())?<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">A. &#8220;hello&#8221;<br>B. &#8220;HELLO&#8221;<br>C. TypeError<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Answer: B<\/h4>\n\n\n\n<ol class=\"wp-block-list\" start=\"30\">\n<li>What is the output of console.log([].constructor === Array)?<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">A. true<br>B. false<br>C. TypeError<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Answer: A<\/h4>\n\n\n\n<ol class=\"wp-block-list\" start=\"31\">\n<li>What is the output of console.log(&#8220;Hello&#8221;.replace(&#8220;l&#8221;, &#8220;x&#8221;))?<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">A. &#8220;Hexlo&#8221;<br>B. &#8220;Hxllo&#8221;<br>C. &#8220;Hello&#8221;<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Answer: B<\/h4>\n\n\n\n<ol class=\"wp-block-list\" start=\"32\">\n<li>What is the output of console.log(Math.ceil(4.1))?<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">A. 4<br>B. 5<br>C. 4.1<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Answer: B<\/h4>\n\n\n\n<ol class=\"wp-block-list\" start=\"33\">\n<li>What is an example of a JavaScript arrow function?<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">A. function add(x, y) { return x + y; }<br>B. var multiply = (x, y) =&gt; x * y;<br>C. var x = 5; x++;<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Answer: B<\/h4>\n\n\n\n<ol class=\"wp-block-list\" start=\"34\">\n<li>What is the output of console.log([1, 2, 3].map(x =&gt; x * 2))?<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">A. [2, 4, 6]<br>B. [1, 2, 3]<br>C. [4, 8, 12]<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Answer: C<\/h4>\n\n\n\n<ol class=\"wp-block-list\" start=\"35\">\n<li>What is the output of console.log(9 &lt; 8 &lt; 7)?<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">A. true<br>B. false<br>C. TypeError<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Answer: A<\/h4>\n\n\n\n<ol class=\"wp-block-list\" start=\"36\">\n<li>What is the output of console.log(&#8220;Hello&#8221;.length)?<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">A. 5<br>B. &#8220;Hello&#8221;<br>C. TypeError<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Answer: A<\/h4>\n\n\n\n<ol class=\"wp-block-list\" start=\"37\">\n<li>What is an example of a JavaScript IIFE (Immediately Invoked Function Expression)?<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">A. (function add(x, y) { return x + y; })(3, 4);<br>B. function() { var x = 5; return function() { return x; } }<br>C. function Person(name, age) { this.name = name; this.age = age; }<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Answer: A<\/h4>\n\n\n\n<ol class=\"wp-block-list\" start=\"38\">\n<li>What is the output of console.log(Math.round(4.4))?<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">A. 4<br>B. 5<br>C. 4.4<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Answer: A<\/h4>\n\n\n\n<ol class=\"wp-block-list\" start=\"39\">\n<li>What is the output of console.log(Math.random() * 10)?<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">A. A random number between 0 and 1<br>B. A random number between 0 and 10<br>C. A random number between 1 and 10<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Answer: B<\/h4>\n\n\n\n<ol class=\"wp-block-list\" start=\"40\">\n<li>What is the output of console.log([1, 2, 3].indexOf(2))?<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">A. 0<br>B. 1<br>C. 2<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Answer: B<\/h4>\n\n\n\n<ol class=\"wp-block-list\" start=\"41\">\n<li>What is the output of console.log(+&#8221;5&#8243; + 5)?<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">A. 10<br>B. &#8220;10&#8221;<br>C. TypeError<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Answer: A<\/h4>\n\n\n\n<ol class=\"wp-block-list\" start=\"42\">\n<li>What is the output of console.log([&#8220;a&#8221;, &#8220;b&#8221;, &#8220;c&#8221;].indexOf(&#8220;d&#8221;))?<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">A. -1<br>B. 0<br>C. 1<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Answer: A<\/h4>\n\n\n\n<ol class=\"wp-block-list\" start=\"43\">\n<li>What is the output of console.log(&#8220;apple&#8221;.indexOf(&#8220;p&#8221;))?<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">A. 0<br>B. 1<br>C. 2<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Answer: 1<\/h4>\n\n\n\n<ol class=\"wp-block-list\" start=\"44\">\n<li>What is the output of console.log(&#8220;apple&#8221;.slice(1, 3))?<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">A. &#8220;ap&#8221;<br>B. &#8220;pp&#8221;<br>C. &#8220;pl&#8221;<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Answer: C<\/h4>\n\n\n\n<ol class=\"wp-block-list\" start=\"45\">\n<li>What is the output of console.log(&#8220;Hello&#8221;.substring(1, 3))?<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">A. &#8220;el&#8221;<br>B. &#8220;llo&#8221;<br>C. &#8220;He&#8221;<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Answer: A<\/h4>\n\n\n\n<ol class=\"wp-block-list\" start=\"46\">\n<li>What is the output of console.log([1, 2, 3].push(4))?<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">A. [1, 2, 3, 4]<br>B. [4, 3, 2, 1]<br>C. 4<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Answer: C<\/h4>\n\n\n\n<ol class=\"wp-block-list\" start=\"47\">\n<li>What is an example of a JavaScript generator function?<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">A. function add(x, y) { return x + y; }<br>B. function* generate() { yield 1; yield 2; yield 3; }<br>C. var x = 5; x++;<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Answer: B<\/h4>\n\n\n\n<ol class=\"wp-block-list\" start=\"48\">\n<li>What is the output of console.log(Math.min([1, 2, 3]))?<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">A. 1<br>B. 2<br>C. 3<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Answer: NaN<\/h4>\n\n\n\n<ol class=\"wp-block-list\" start=\"49\">\n<li>What is an example of a JavaScript async\/await function?<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">A. function add(x, y) { return x + y; }<br>B. async function fetchData() { const response = await fetch(&#8220;http:\/\/example.com\/data&#8221;); const data = await response.json(); return data; }<br>C. var x = 5; x++;<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Answer: B<\/h4>\n\n\n\n<ol class=\"wp-block-list\" start=\"50\">\n<li>What is the output of console.log([1, 2, 3].reverse())?<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">A. [1, 2, 3]<br>B. [3, 2, 1]<br>C. TypeError<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Answer: B<\/h4>\n","protected":false},"excerpt":{"rendered":"<p>A. A programming languageB. A markup languageC. A web browser Answer: A A. Hello4B. TypeErrorC. Hello Answer: A A. nullB. [&hellip;]<\/p>\n","protected":false},"author":33,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_joinchat":[],"footnotes":""},"categories":[16],"tags":[],"class_list":["post-10162","post","type-post","status-publish","format-standard","hentry","category-javascript"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Top 50 JavaScript Interview Questions with Answers - scmGalaxy<\/title>\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.scmgalaxy.com\/tutorials\/top-50-javascript-interview-questions-with-answers\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Top 50 JavaScript Interview Questions with Answers - scmGalaxy\" \/>\n<meta property=\"og:description\" content=\"A. A programming languageB. A markup languageC. A web browser Answer: A A. Hello4B. TypeErrorC. Hello Answer: A A. nullB. [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.scmgalaxy.com\/tutorials\/top-50-javascript-interview-questions-with-answers\/\" \/>\n<meta property=\"og:site_name\" content=\"scmGalaxy\" \/>\n<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/profile.php?id=100003935402658\" \/>\n<meta property=\"article:published_time\" content=\"2023-05-01T11:42:26+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-06-19T13:29:52+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.scmgalaxy.com\/tutorials\/wp-content\/uploads\/2023\/05\/image-23-1024x576.png\" \/>\n<meta name=\"author\" content=\"Ashwani Kumar\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Ashwani Kumar\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/top-50-javascript-interview-questions-with-answers\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/top-50-javascript-interview-questions-with-answers\\\/\"},\"author\":{\"name\":\"Ashwani Kumar\",\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/#\\\/schema\\\/person\\\/19f28f8f969c1679bfb37d4dad6adc31\"},\"headline\":\"Top 50 JavaScript Interview Questions with Answers\",\"datePublished\":\"2023-05-01T11:42:26+00:00\",\"dateModified\":\"2023-06-19T13:29:52+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/top-50-javascript-interview-questions-with-answers\\\/\"},\"wordCount\":971,\"commentCount\":0,\"image\":{\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/top-50-javascript-interview-questions-with-answers\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/wp-content\\\/uploads\\\/2023\\\/05\\\/image-23-1024x576.png\",\"articleSection\":[\"JavaScript\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/top-50-javascript-interview-questions-with-answers\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/top-50-javascript-interview-questions-with-answers\\\/\",\"url\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/top-50-javascript-interview-questions-with-answers\\\/\",\"name\":\"Top 50 JavaScript Interview Questions with Answers - scmGalaxy\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/top-50-javascript-interview-questions-with-answers\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/top-50-javascript-interview-questions-with-answers\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/wp-content\\\/uploads\\\/2023\\\/05\\\/image-23-1024x576.png\",\"datePublished\":\"2023-05-01T11:42:26+00:00\",\"dateModified\":\"2023-06-19T13:29:52+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/#\\\/schema\\\/person\\\/19f28f8f969c1679bfb37d4dad6adc31\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/top-50-javascript-interview-questions-with-answers\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/top-50-javascript-interview-questions-with-answers\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/top-50-javascript-interview-questions-with-answers\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/wp-content\\\/uploads\\\/2023\\\/05\\\/image-23.png\",\"contentUrl\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/wp-content\\\/uploads\\\/2023\\\/05\\\/image-23.png\",\"width\":1200,\"height\":675},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/top-50-javascript-interview-questions-with-answers\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Top 50 JavaScript Interview Questions with Answers\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/#website\",\"url\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/\",\"name\":\"scmGalaxy\",\"description\":\"A Platform for Software Engineers\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/#\\\/schema\\\/person\\\/19f28f8f969c1679bfb37d4dad6adc31\",\"name\":\"Ashwani Kumar\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/b0fe597f4b8473400f95ce54bee0bdd62df08a319a198ad229b279aaab4f5410?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/b0fe597f4b8473400f95ce54bee0bdd62df08a319a198ad229b279aaab4f5410?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/b0fe597f4b8473400f95ce54bee0bdd62df08a319a198ad229b279aaab4f5410?s=96&d=mm&r=g\",\"caption\":\"Ashwani Kumar\"},\"description\":\"There is no end to education. It is not that you read a book, pass an examination, and finish with education. The whole of life, from the moment you are born to the moment you die, is a process of learning.\",\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/profile.php?id=100003935402658\",\"https:\\\/\\\/www.instagram.com\\\/adarshashwani\\\/\",\"https:\\\/\\\/www.linkedin.com\\\/in\\\/adarsh-ashwani-a75b23130\\\/\"],\"url\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/author\\\/ashwani\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Top 50 JavaScript Interview Questions with Answers - scmGalaxy","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.scmgalaxy.com\/tutorials\/top-50-javascript-interview-questions-with-answers\/","og_locale":"en_US","og_type":"article","og_title":"Top 50 JavaScript Interview Questions with Answers - scmGalaxy","og_description":"A. A programming languageB. A markup languageC. A web browser Answer: A A. Hello4B. TypeErrorC. Hello Answer: A A. nullB. [&hellip;]","og_url":"https:\/\/www.scmgalaxy.com\/tutorials\/top-50-javascript-interview-questions-with-answers\/","og_site_name":"scmGalaxy","article_author":"https:\/\/www.facebook.com\/profile.php?id=100003935402658","article_published_time":"2023-05-01T11:42:26+00:00","article_modified_time":"2023-06-19T13:29:52+00:00","og_image":[{"url":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-content\/uploads\/2023\/05\/image-23-1024x576.png","type":"","width":"","height":""}],"author":"Ashwani Kumar","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Ashwani Kumar","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.scmgalaxy.com\/tutorials\/top-50-javascript-interview-questions-with-answers\/#article","isPartOf":{"@id":"https:\/\/www.scmgalaxy.com\/tutorials\/top-50-javascript-interview-questions-with-answers\/"},"author":{"name":"Ashwani Kumar","@id":"https:\/\/www.scmgalaxy.com\/tutorials\/#\/schema\/person\/19f28f8f969c1679bfb37d4dad6adc31"},"headline":"Top 50 JavaScript Interview Questions with Answers","datePublished":"2023-05-01T11:42:26+00:00","dateModified":"2023-06-19T13:29:52+00:00","mainEntityOfPage":{"@id":"https:\/\/www.scmgalaxy.com\/tutorials\/top-50-javascript-interview-questions-with-answers\/"},"wordCount":971,"commentCount":0,"image":{"@id":"https:\/\/www.scmgalaxy.com\/tutorials\/top-50-javascript-interview-questions-with-answers\/#primaryimage"},"thumbnailUrl":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-content\/uploads\/2023\/05\/image-23-1024x576.png","articleSection":["JavaScript"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.scmgalaxy.com\/tutorials\/top-50-javascript-interview-questions-with-answers\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.scmgalaxy.com\/tutorials\/top-50-javascript-interview-questions-with-answers\/","url":"https:\/\/www.scmgalaxy.com\/tutorials\/top-50-javascript-interview-questions-with-answers\/","name":"Top 50 JavaScript Interview Questions with Answers - scmGalaxy","isPartOf":{"@id":"https:\/\/www.scmgalaxy.com\/tutorials\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.scmgalaxy.com\/tutorials\/top-50-javascript-interview-questions-with-answers\/#primaryimage"},"image":{"@id":"https:\/\/www.scmgalaxy.com\/tutorials\/top-50-javascript-interview-questions-with-answers\/#primaryimage"},"thumbnailUrl":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-content\/uploads\/2023\/05\/image-23-1024x576.png","datePublished":"2023-05-01T11:42:26+00:00","dateModified":"2023-06-19T13:29:52+00:00","author":{"@id":"https:\/\/www.scmgalaxy.com\/tutorials\/#\/schema\/person\/19f28f8f969c1679bfb37d4dad6adc31"},"breadcrumb":{"@id":"https:\/\/www.scmgalaxy.com\/tutorials\/top-50-javascript-interview-questions-with-answers\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.scmgalaxy.com\/tutorials\/top-50-javascript-interview-questions-with-answers\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.scmgalaxy.com\/tutorials\/top-50-javascript-interview-questions-with-answers\/#primaryimage","url":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-content\/uploads\/2023\/05\/image-23.png","contentUrl":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-content\/uploads\/2023\/05\/image-23.png","width":1200,"height":675},{"@type":"BreadcrumbList","@id":"https:\/\/www.scmgalaxy.com\/tutorials\/top-50-javascript-interview-questions-with-answers\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.scmgalaxy.com\/tutorials\/"},{"@type":"ListItem","position":2,"name":"Top 50 JavaScript Interview Questions with Answers"}]},{"@type":"WebSite","@id":"https:\/\/www.scmgalaxy.com\/tutorials\/#website","url":"https:\/\/www.scmgalaxy.com\/tutorials\/","name":"scmGalaxy","description":"A Platform for Software Engineers","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.scmgalaxy.com\/tutorials\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.scmgalaxy.com\/tutorials\/#\/schema\/person\/19f28f8f969c1679bfb37d4dad6adc31","name":"Ashwani Kumar","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/b0fe597f4b8473400f95ce54bee0bdd62df08a319a198ad229b279aaab4f5410?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/b0fe597f4b8473400f95ce54bee0bdd62df08a319a198ad229b279aaab4f5410?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/b0fe597f4b8473400f95ce54bee0bdd62df08a319a198ad229b279aaab4f5410?s=96&d=mm&r=g","caption":"Ashwani Kumar"},"description":"There is no end to education. It is not that you read a book, pass an examination, and finish with education. The whole of life, from the moment you are born to the moment you die, is a process of learning.","sameAs":["https:\/\/www.facebook.com\/profile.php?id=100003935402658","https:\/\/www.instagram.com\/adarshashwani\/","https:\/\/www.linkedin.com\/in\/adarsh-ashwani-a75b23130\/"],"url":"https:\/\/www.scmgalaxy.com\/tutorials\/author\/ashwani\/"}]}},"_links":{"self":[{"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/posts\/10162","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/users\/33"}],"replies":[{"embeddable":true,"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/comments?post=10162"}],"version-history":[{"count":1,"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/posts\/10162\/revisions"}],"predecessor-version":[{"id":10164,"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/posts\/10162\/revisions\/10164"}],"wp:attachment":[{"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/media?parent=10162"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/categories?post=10162"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/tags?post=10162"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}