{"id":901,"date":"2024-11-20T05:33:10","date_gmt":"2024-11-20T05:33:10","guid":{"rendered":"https:\/\/www.akalinfo.com\/blog\/?p=901"},"modified":"2025-03-27T08:15:04","modified_gmt":"2025-03-27T08:15:04","slug":"javascript-interview-questions","status":"publish","type":"post","link":"https:\/\/www.akalinfo.com\/blog\/javascript-interview-questions\/","title":{"rendered":"50+ JavaScript Interview Questions and Answers (2025)"},"content":{"rendered":"<p>Are you looking for the top JavaScript interview questions? You\u2019re in the right place! JavaScript, a lightweight and open-source scripting language, is widely used for building applications. It is known for its speed and versatility. It powers web and mobile apps, games, servers, and more. It is the third most popular web technology.<\/p>\n<p>This blog will explore some of the most essential JavaScript interview questions. They are frequently asked at beginner, intermediate, and advanced levels. Let\u2019s dive in!<\/p>\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_82_2 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/www.akalinfo.com\/blog\/javascript-interview-questions\/#JavaScript_Interview_Questions_For_Beginners\" >JavaScript Interview Questions For Beginners<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/www.akalinfo.com\/blog\/javascript-interview-questions\/#Q1_What_is_JavaScript\" >Q1: What is JavaScript?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/www.akalinfo.com\/blog\/javascript-interview-questions\/#Q2_List_some_essential_features_of_JavaScript\" >Q2: List some essential features of JavaScript.<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/www.akalinfo.com\/blog\/javascript-interview-questions\/#Q3_Which_Symbol_Can_Be_Used_to_Write_Comments_in_JavaScript\" >Q3: Which Symbol Can Be Used to Write Comments in JavaScript?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/www.akalinfo.com\/blog\/javascript-interview-questions\/#Q4_What_Are_The_Different_Data_Types_In_JavaScript\" >Q4: What Are The Different Data Types In JavaScript?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/www.akalinfo.com\/blog\/javascript-interview-questions\/#Q5_What_is_the_purpose_of_the_isNaN_function\" >Q5: What is the purpose of the isNaN function?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/www.akalinfo.com\/blog\/javascript-interview-questions\/#Q6_Which_is_faster_JavaScript_or_ASP_Script\" >Q6: Which is faster: JavaScript or ASP Script?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/www.akalinfo.com\/blog\/javascript-interview-questions\/#Q7_What_is_negative_infinity\" >Q7: What is negative infinity?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/www.akalinfo.com\/blog\/javascript-interview-questions\/#Q8_Write_a_JavaScript_code_snippet_to_dynamically_add_new_elements\" >Q8: Write a JavaScript code snippet to dynamically add new elements.<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-10\" href=\"https:\/\/www.akalinfo.com\/blog\/javascript-interview-questions\/#Q9_What_are_the_advantages_of_JavaScript\" >Q9: What are the advantages of JavaScript?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-11\" href=\"https:\/\/www.akalinfo.com\/blog\/javascript-interview-questions\/#Q10_Can_You_Break_JavaScript_Code_Into_Several_Lines\" >Q10: Can You Break JavaScript Code Into Several Lines?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-12\" href=\"https:\/\/www.akalinfo.com\/blog\/javascript-interview-questions\/#Q11_What_Is_A_Prompt_Box\" >Q11. What Is A Prompt Box?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-13\" href=\"https:\/\/www.akalinfo.com\/blog\/javascript-interview-questions\/#Q12_What_is_a_Function_in_JavaScript\" >Q12: What is a Function in JavaScript?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-14\" href=\"https:\/\/www.akalinfo.com\/blog\/javascript-interview-questions\/#Q13_What_were_the_previous_names_of_JavaScript\" >Q13: What were the previous names of JavaScript?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-15\" href=\"https:\/\/www.akalinfo.com\/blog\/javascript-interview-questions\/#Q14_What_is_the_difference_between_Java_and_JavaScript\" >Q14: What is the difference between Java and JavaScript?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-16\" href=\"https:\/\/www.akalinfo.com\/blog\/javascript-interview-questions\/#Q15_What_is_DOM_in_JavaScript\" >Q15: What is DOM in JavaScript?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-17\" href=\"https:\/\/www.akalinfo.com\/blog\/javascript-interview-questions\/#Q16_What_is_BOM_in_JavaScript\" >Q16: What is BOM in JavaScript?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-18\" href=\"https:\/\/www.akalinfo.com\/blog\/javascript-interview-questions\/#Q17_What_is_an_anonymous_function_in_JavaScript\" >Q17: What is an anonymous function in JavaScript?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-19\" href=\"https:\/\/www.akalinfo.com\/blog\/javascript-interview-questions\/#Q18_What_is_the_use_of_a_history_object_in_JavaScript\" >Q18: What is the use of a history object in JavaScript?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-20\" href=\"https:\/\/www.akalinfo.com\/blog\/javascript-interview-questions\/#Q19_What_does_the_%E2%80%9Cthis%E2%80%9D_keyword_refer_to_in_JavaScript\" >Q19: What does the \u201cthis\u201d keyword refer to in JavaScript?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-21\" href=\"https:\/\/www.akalinfo.com\/blog\/javascript-interview-questions\/#Q20_How_do_timers_work_in_JavaScript_Are_there_any_disadvantages\" >Q20: How do timers work in JavaScript? Are there any disadvantages?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-22\" href=\"https:\/\/www.akalinfo.com\/blog\/javascript-interview-questions\/#Q21_What_is_the_difference_between_ViewState_and_SessionState\" >Q21: What is the difference between ViewState and SessionState?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-23\" href=\"https:\/\/www.akalinfo.com\/blog\/javascript-interview-questions\/#Q22_How_do_I_use_JavaScript_for_submitting_an_HTML_form\" >Q22: How do I use JavaScript for submitting an HTML form?<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-24\" href=\"https:\/\/www.akalinfo.com\/blog\/javascript-interview-questions\/#Javascript_Interview_Questions_For_Intermediate\" >Javascript Interview Questions For Intermediate<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-25\" href=\"https:\/\/www.akalinfo.com\/blog\/javascript-interview-questions\/#Q1_What_is_the_use_of_Math_Object_in_JavaScript\" >Q1. What is the use of Math Object in JavaScript?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-26\" href=\"https:\/\/www.akalinfo.com\/blog\/javascript-interview-questions\/#Q2_What_is_the_role_of_a_strict_mode_in_JavaScript\" >Q2. What is the role of a strict mode in JavaScript?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-27\" href=\"https:\/\/www.akalinfo.com\/blog\/javascript-interview-questions\/#Q3_What_are_the_various_looping_structures_in_JavaScript\" >Q3: What are the various looping structures in JavaScript?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-28\" href=\"https:\/\/www.akalinfo.com\/blog\/javascript-interview-questions\/#Q4_What_is_the_need_for_debugging_in_JavaScript\" >Q4. What is the need for debugging in JavaScript?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-29\" href=\"https:\/\/www.akalinfo.com\/blog\/javascript-interview-questions\/#Q5_How_do_you_modify_the_style_or_class_of_an_element_in_JavaScript\" >Q5. How do you modify the style or class of an element in JavaScript?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-30\" href=\"https:\/\/www.akalinfo.com\/blog\/javascript-interview-questions\/#Q6_How_can_you_read_and_write_files_using_JavaScript\" >Q6. How can you read and write files using JavaScript?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-31\" href=\"https:\/\/www.akalinfo.com\/blog\/javascript-interview-questions\/#Q7_What_is_variable_typing_in_JavaScript\" >Q7. What is variable typing in JavaScript?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-32\" href=\"https:\/\/www.akalinfo.com\/blog\/javascript-interview-questions\/#Q8_What_is_the_meaning_of_hoisting_in_JavaScript\" >Q8. What is the meaning of hoisting in JavaScript?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-33\" href=\"https:\/\/www.akalinfo.com\/blog\/javascript-interview-questions\/#Q9_What_are_the_types_of_scopes_in_JavaScript\" >Q9. What are the types of scopes in JavaScript?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-34\" href=\"https:\/\/www.akalinfo.com\/blog\/javascript-interview-questions\/#Q10_What_is_a_callback_in_JavaScript\" >Q10. What is a callback in JavaScript?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-35\" href=\"https:\/\/www.akalinfo.com\/blog\/javascript-interview-questions\/#Q11_What_is_the_difference_between_Function_declaration_and_Function_expression\" >Q11. What is the difference between Function declaration and Function expression?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-36\" href=\"https:\/\/www.akalinfo.com\/blog\/javascript-interview-questions\/#Q12_How_can_you_convert_a_number_in_any_base_to_an_integer_in_JavaScript\" >Q12: How can you convert a number in any base to an integer in JavaScript?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-37\" href=\"https:\/\/www.akalinfo.com\/blog\/javascript-interview-questions\/#Q13_How_will_you_identify_the_client_machines_OS\" >Q13: How will you identify the client machine&#8217;s OS?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-38\" href=\"https:\/\/www.akalinfo.com\/blog\/javascript-interview-questions\/#Q14_What_are_the_different_types_of_pop-up_boxes_in_JavaScript\" >Q14: What are the different types of pop-up boxes in JavaScript?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-39\" href=\"https:\/\/www.akalinfo.com\/blog\/javascript-interview-questions\/#Q15_Whats_the_difference_between_an_alert_box_and_a_confirmation_box\" >Q15: What&#8217;s the difference between an alert box and a confirmation box?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-40\" href=\"https:\/\/www.akalinfo.com\/blog\/javascript-interview-questions\/#Q16_What_are_the_disadvantages_of_using_innerHTML_in_JavaScript\" >Q16: What are the disadvantages of using `innerHTML` in JavaScript?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-41\" href=\"https:\/\/www.akalinfo.com\/blog\/javascript-interview-questions\/#Q17_What_is_the_purpose_of_void0_in_JavaScript\" >Q17: What is the purpose of `void(0)` in JavaScript?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-42\" href=\"https:\/\/www.akalinfo.com\/blog\/javascript-interview-questions\/#Q18_What_is_the_process_to_remove_a_cookie_in_JavaScript\" >Q18. What is the process to remove a cookie in JavaScript?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-43\" href=\"https:\/\/www.akalinfo.com\/blog\/javascript-interview-questions\/#Q19_How_would_you_add_JavaScript_code_to_HTML_pages\" >Q19. How would you add JavaScript code to HTML pages?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-44\" href=\"https:\/\/www.akalinfo.com\/blog\/javascript-interview-questions\/#Q20_What_are_the_closures_in_JavaScript\" >Q20. What are the closures in JavaScript?<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-45\" href=\"https:\/\/www.akalinfo.com\/blog\/javascript-interview-questions\/#JavaScript_Interview_Questions_For_Advanced_Level\" >JavaScript Interview Questions For Advanced Level<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-46\" href=\"https:\/\/www.akalinfo.com\/blog\/javascript-interview-questions\/#Q1_Name_three_JavaScript_frameworks_and_their_uses\" >Q1: Name three JavaScript frameworks and their uses.<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-47\" href=\"https:\/\/www.akalinfo.com\/blog\/javascript-interview-questions\/#Q2_What_is_the_%E2%80%98Strict_mode_in_JavaScript_How_do_you_invoke_it\" >Q2. What is the &#8216;Strict&#8217; mode in JavaScript? How do you invoke it?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-48\" href=\"https:\/\/www.akalinfo.com\/blog\/javascript-interview-questions\/#Q3_How_to_get_the_status_of_a_CheckBox\" >Q3. How to get the status of a CheckBox?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-49\" href=\"https:\/\/www.akalinfo.com\/blog\/javascript-interview-questions\/#Q4_How_to_explain_closures_in_JavaScript_and_when_to_use_it\" >Q4. How to explain closures in JavaScript and when to use it?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-50\" href=\"https:\/\/www.akalinfo.com\/blog\/javascript-interview-questions\/#Q5_What_is_the_difference_between_the_call_and_apply_methods\" >Q5. What is the difference between the `call()` and `apply()` methods?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-51\" href=\"https:\/\/www.akalinfo.com\/blog\/javascript-interview-questions\/#Q6_How_do_I_address_a_specific_frame_from_a_hyperlink_using_JavaScript\" >Q6. How do I address a specific frame from a hyperlink using JavaScript?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-52\" href=\"https:\/\/www.akalinfo.com\/blog\/javascript-interview-questions\/#Q7_What_are_the_types_of_errors_in_JavaScript\" >Q7. What are the types of errors in JavaScript?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-53\" href=\"https:\/\/www.akalinfo.com\/blog\/javascript-interview-questions\/#Q8_What_is_the_difference_between_JavaScript_and_JScript\" >Q8. What is the difference between JavaScript and JScript?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-54\" href=\"https:\/\/www.akalinfo.com\/blog\/javascript-interview-questions\/#Q9_What_does_the_statement_var_myArray_declare\" >Q9. What does the statement `var myArray = [[]];` declare?**<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-55\" href=\"https:\/\/www.akalinfo.com\/blog\/javascript-interview-questions\/#Q10_In_JavaScript_how_can_you_refer_to_an_HTML_element\" >Q10. In JavaScript, how can you refer to an HTML element?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-56\" href=\"https:\/\/www.akalinfo.com\/blog\/javascript-interview-questions\/#Q11_What_is_event_bubbling_in_JavaScript\" >Q11. What is event bubbling in JavaScript?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-57\" href=\"https:\/\/www.akalinfo.com\/blog\/javascript-interview-questions\/#Q12_What_is_memoisation\" >Q12. What is memoisation?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-58\" href=\"https:\/\/www.akalinfo.com\/blog\/javascript-interview-questions\/#Q13_What_are_object_prototypes\" >Q13: What are object prototypes?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-59\" href=\"https:\/\/www.akalinfo.com\/blog\/javascript-interview-questions\/#Q14_What_is_the_difference_between_the_client-side_and_the_server-side_scripting\" >Q14: What is the difference between the client-side and the server-side scripting?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-60\" href=\"https:\/\/www.akalinfo.com\/blog\/javascript-interview-questions\/#Q15_What_is_a_WeakMap\" >Q15: What is a WeakMap?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-61\" href=\"https:\/\/www.akalinfo.com\/blog\/javascript-interview-questions\/#Q16_What_does_Event_Bubbling_refer_to_in_JavaScript\" >Q16: What does Event Bubbling refer to in JavaScript?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-62\" href=\"https:\/\/www.akalinfo.com\/blog\/javascript-interview-questions\/#Q17_State_the_difference_between_declaring_variables_using_var_let_and_cont\" >Q17: State the difference between declaring variables using var, let, and cont.<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-63\" href=\"https:\/\/www.akalinfo.com\/blog\/javascript-interview-questions\/#Q18_What_are_undeclared_and_undefined_variables\" >Q18: What are undeclared and undefined variables?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-64\" href=\"https:\/\/www.akalinfo.com\/blog\/javascript-interview-questions\/#Q19_What_is_Strict_Mode_in_JavaScript\" >Q19: What is Strict Mode in JavaScript?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-65\" href=\"https:\/\/www.akalinfo.com\/blog\/javascript-interview-questions\/#Q20_What_is_Event_Capturing_in_JavaScript\" >Q20: What is Event Capturing in JavaScript?<\/a><\/li><\/ul><\/li><\/ul><\/nav><\/div>\n<h2><span class=\"ez-toc-section\" id=\"JavaScript_Interview_Questions_For_Beginners\"><\/span><b>JavaScript Interview Questions For Beginners<\/b><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Here are some questions about JavaScript for beginners:<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Q1_What_is_JavaScript\"><\/span>Q1: What is JavaScript?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><b>Ans:<\/b> JavaScript is an open-source scripting and programming language. It enriches web pages and provides a great user experience. It has no relation to Java in terms of design. It is a lightweight, object-oriented, cross-platform language. It is often used for client-side scripting.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Q2_List_some_essential_features_of_JavaScript\"><\/span><b>Q2: List some essential features of JavaScript.<\/b><span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><b>Ans:<\/b> JavaScript is a popular language with multiple features that aid in developing a web application.<\/p>\n<p><strong>Some of them are as follows:<\/strong><\/p>\n<ul>\n<li><b>Lightweight Scripting Language: <\/b>It&#8217;s a lightweight scripting language designed for managing data on the browser; rather than being a general-purpose language, it considers only a set of libraries, and because of client-side execution for web applications, it&#8217;s lightweight.<\/li>\n<li><b>Stable Control:<\/b> This enables stable browser control instead of being wholly confided on the web servers. This provides more browsers with extra functionalities that help reduce server load and network traffic.<\/li>\n<li><b>Client-side Calculations:<\/b> JavaScript is a scripting language that can perform simple calculations on the browser. It can ask for permission on some tasks. It is beneficial if the user has to do these calculations multiple times. In such scenarios, connecting to the server will take much longer than actual calculations.<\/li>\n<li><b>Producing HTML Content Using JavaScript:<\/b> JavaScript has valuable features for generating HTML content for web pages. It lets developers add texts, tables, links, images, etc. after an event comes into their view.<\/li>\n<\/ul>\n<h3><span class=\"ez-toc-section\" id=\"Q3_Which_Symbol_Can_Be_Used_to_Write_Comments_in_JavaScript\"><\/span>Q3: Which Symbol Can Be Used to Write Comments in JavaScript?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><b>Ans:<\/b> In JavaScript, comments are used to prevent the execution of specific statements and are ignored during code execution by the compiler. There are two types of symbols for writing comments:<\/p>\n<p><b>Double slash (<\/b><b>\/\/<\/b><b>)<\/b>: Represents a single-line comment.<\/p>\n<div class=\"resume-outer-box\">\n\/\/ This is a single-line comment\n<\/div>\n<p><b>Slash with asterisk (<\/b><b>\/* &#8230; *\/<\/b><b>)<\/b>: Represents a multi-line comment.<\/p>\n<div class=\"resume-outer-box\">\n\/*<\/p>\n<p>This is a multi-line comment.<\/p>\n<p>It can span multiple lines.<\/p>\n<p>*\/\n<\/p><\/div>\n<h3><span class=\"ez-toc-section\" id=\"Q4_What_Are_The_Different_Data_Types_In_JavaScript\"><\/span>Q4: What Are The Different Data Types In JavaScript?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><b>Ans: <\/b>JavaScript data types fall into two categories- <b>primitive<\/b> and <b>non-primitive.<\/b><\/p>\n<p><b>Primitive Data Types:<\/b> These are the basic data types which are built into JavaScript. They are also referred to as in-built data types.<\/p>\n<ul>\n<li>Numbers<\/li>\n<li>Strings<\/li>\n<li>Boolean<\/li>\n<li>Symbol<\/li>\n<li>Undefined<\/li>\n<li>Null<\/li>\n<li>BigInt<\/li>\n<\/ul>\n<p><b>Derived Data Types:<\/b> These data types are derived from the primitive data types and called reference or derived data types.<\/p>\n<ul>\n<li>Objects<\/li>\n<li>Functions<\/li>\n<li>Arrays<\/li>\n<\/ul>\n<h3><span class=\"ez-toc-section\" id=\"Q5_What_is_the_purpose_of_the_isNaN_function\"><\/span>Q5: What is the purpose of the isNaN function?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><b>Ans:<\/b> The isNaN function checks whether a given value is NaN (Not a Number) and of the type &#8220;Number.&#8221; In JavaScript, NaN is an exceptional value of the number type. The function returns true if the input is not a number; otherwise, it returns false.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Q6_Which_is_faster_JavaScript_or_ASP_Script\"><\/span>Q6: Which is faster: JavaScript or ASP Script?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><b>Ans: <\/b>JavaScript is faster than ASP Script. JavaScript is a client-side script. It runs in the browser and doesn&#8217;t depend on the server. However, ASP Script is a server side script type requiring the server to process, making it dependent on server performance.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Q7_What_is_negative_infinity\"><\/span>Q7: What is negative infinity?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><b>Ans: <\/b>Negative infinity is one of the constant values that define the smallest possible value in JavaScript. No number is smaller than this value. It is produced through specific arithmetic operations or custom functions. In JavaScript, we can present this as -Infinity.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Q8_Write_a_JavaScript_code_snippet_to_dynamically_add_new_elements\"><\/span>Q8: Write a JavaScript code snippet to dynamically add new elements.<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<div class=\"resume-outer-box\">\n&lt;!DOCTYPE html&gt;<\/p>\n<p>&lt;html lang=&#8221;en&#8221;&gt;<\/p>\n<p>&lt;head&gt;<\/p>\n<p>&lt;title&gt;Document&lt;\/title&gt;<\/p>\n<p>&lt;\/head&gt;<\/p>\n<p>&lt;body&gt;<\/p>\n<p>&lt;button onclick=&#8221;create()&#8221;&gt;<\/p>\n<p>Click Here!<\/p>\n<p>&lt;\/button&gt;<\/p>\n<p>&lt;script&gt;<\/p>\n<p>function create() {<\/p>\n<p>let akal = document.createElement(&#8216;akal&#8217;);<\/p>\n<p>akal.textContent = &#8220;akalitcompany&#8221;;<\/p>\n<p>akal.setAttribute(&#8216;class&#8217;, &#8216;note&#8217;);<\/p>\n<p>document.body.appendChild(akal);<\/p>\n<p>}<\/p>\n<p>&lt;\/script&gt;<\/p>\n<p>&lt;\/body&gt;<\/p>\n<p>&lt;\/html&gt;\n<\/p><\/div>\n<h3><span class=\"ez-toc-section\" id=\"Q9_What_are_the_advantages_of_JavaScript\"><\/span>Q9: What are the advantages of JavaScript?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><b>Ans: <\/b>Like any other programming language, JavaScript has several benefits, such as:<\/p>\n<ul>\n<li aria-level=\"1\"><b>Speed: <\/b>JavaScript is an interpreted client-side scripting language. It does not require the lengthy compilation that languages like Java do. So, it is faster.<\/li>\n<li aria-level=\"1\"><b>Simplicity: <\/b>It is easy to learn and understand. Its structure is straightforward for both developers and users. Its ease of execution allows for quicker dynamic and creative web content development.<\/li>\n<li aria-level=\"1\"><b>Versatility: <\/b>JavaScript is highly versatile, supporting both front-end and back-end development. Libraries like AngularJS and ReactJS boost front-end work. Node.js enables efficient back-end coding.<\/li>\n<li aria-level=\"1\"><b>Less Overhead:<\/b> Shorter JavaScript code boosts the performance of websites and web apps. The codes comprise less overhead because of multiple built-in functions for DOM, loops, access, etc.<\/li>\n<\/ul>\n<h3><span class=\"ez-toc-section\" id=\"Q10_Can_You_Break_JavaScript_Code_Into_Several_Lines\"><\/span>Q10: Can You Break JavaScript Code Into Several Lines?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><b>Ans:<\/b> Yes, you can break JavaScript code into several lines within a string statement. This can be done by using the newline character \\n.<\/p>\n<p>For example:<\/p>\n<div class=\"resume-outer-box\">\nconsole.log(&#8220;An IT Company\\n for Akal&#8221;);\n<\/div>\n<p>However, breaking code across lines like this is generally discouraged in JavaScript and should be avoided.<\/p>\n<p>For variable declarations and expressions, it&#8217;s better to write them in a more readable format:<\/p>\n<div class=\"resume-outer-box\">\nlet gfg = 10,<br \/>\nGFG = 5,<br \/>\nAkal = gfg + GFG;\n<\/div>\n<p>This makes the code clearer and easier to maintain.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Q11_What_Is_A_Prompt_Box\"><\/span>Q11. What Is A Prompt Box?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><b>Ans:<\/b> A prompt box is a dialog box which optionally shows a message asking the user for some text. Often used when the user must submit some input before continuing on a page, prompt boxes return a string containing the text that the user has entered, or null if the user did not enter any content.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Q12_What_is_a_Function_in_JavaScript\"><\/span>Q12: What is a Function in JavaScript?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><b>Ans:<\/b> Functions in JavaScript are pretty much like a process, a set of statements that does something or computes a value. This is a set of reusable codes that can be called anywhere in the program and eliminates the need to repeat the code. In simpler words, it lets the programmer divide a big program into several small and convenient functions.<\/p>\n<p><b>Example of Function Declaration<\/b><\/p>\n<p>This is an example of Function Declaration to give you a brief understanding:<\/p>\n<div class=\"resume-outer-box\">\nFunction abc(domain) {<br \/>\nconst abc = `Contract jobs ${domain}`;<br \/>\nconsole.log(abc);<br \/>\n}\n<\/div>\n<p><strong>Example of Function Expression<\/strong><\/p>\n<p>This is an example of Function Expression to give you a brief understanding:<\/p>\n<div class=\"resume-outer-box\">\nconst abc = function () {<br \/>\nconst abc = `Contract jobs ${domain}`;<br \/>\nconsole.log(abc); }\n<\/div>\n<h3><span class=\"ez-toc-section\" id=\"Q13_What_were_the_previous_names_of_JavaScript\"><\/span>Q13: What were the previous names of JavaScript?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><b>Ans<\/b>:\u00a0 JavaScript was created by Brendan Eich of Netscape Communications Corporation. It was initially named Mocha, later LiveScript, and then finally renamed to JavaScript.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Q14_What_is_the_difference_between_Java_and_JavaScript\"><\/span>Q14: What is the difference between Java and JavaScript?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Ans: Here is the significant difference between Java and JavaScript:<\/p>\n<table class=\"table-class\">\n<tbody>\n<tr>\n<th><b>Java<\/b><\/th>\n<th><b>JavaScript\u00a0<\/b><\/th>\n<\/tr>\n<tr>\n<td>Java is a programming language that has strong typing. This means that every variable must be declared with a specific data type.<\/td>\n<td>JavaScript is used for scripting.<\/td>\n<\/tr>\n<tr>\n<td>It is a programming language that is based on the principles of object-oriented programming.<\/td>\n<td>JavaScript object-based language.<\/td>\n<\/tr>\n<tr>\n<td>Java is a standalone language which means it can be used by itself.<\/td>\n<td>JavaScript is not a standalone language because it needs to be used with an HTML program for implementation.<\/td>\n<\/tr>\n<tr>\n<td>Java is a strongly typed language that requires users to specify the data type of a variable before declaring and using it.<\/td>\n<td>JavaScript is a loosely typed language, users don&#8217;t need to worry about specifying or maintaining the variable&#8217;s data type during or after its declaration.<\/td>\n<\/tr>\n<tr>\n<td>The text should be merged prior to execution.<\/td>\n<td>The text needs to be integrated into the HTML program for implementation.<\/td>\n<\/tr>\n<tr>\n<td>Java is a comparatively difficult language to learn.<\/td>\n<td>JavaScript is an easy language to learn.<\/td>\n<\/tr>\n<tr>\n<td>Not required to run Java programs<\/td>\n<td>Required to run JavaScript programs.<\/td>\n<\/tr>\n<tr>\n<td>Users can perform difficult tasks using multi-threading.<\/td>\n<td>Users cannot perform difficult tasks on JavaScript<\/td>\n<\/tr>\n<tr>\n<td>Java was developed by Sun Microsystems.<\/td>\n<td>JavaScript was developed by Netscape.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3><span class=\"ez-toc-section\" id=\"Q15_What_is_DOM_in_JavaScript\"><\/span>Q15: What is DOM in JavaScript?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><b>Ans:<\/b> DOM stands for Document Object Model, which is the data representation of the objects that includes the structure and content of a document on the web. In simple terms, it is a programming interface for web documents, representing the page so that programs can change the style, content, and document structure.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Q16_What_is_BOM_in_JavaScript\"><\/span>Q16: What is BOM in JavaScript?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><b>Ans<\/b><b>:<\/b> BOM (Browser Object Model) is one of the integral parts of JavaScript on the web. It offers all the objects and functionality and lets the developers interact with the browser.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Q17_What_is_an_anonymous_function_in_JavaScript\"><\/span>Q17: What is an anonymous function in JavaScript?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><b>Ans<\/b><i>: <\/i>It is a function without any name. These functions are used differently during the runtime, using the function operator instead of the function declaration. It is relatively more flexible than function declaration and can be easily utilized in the place of an expression.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Q18_What_is_the_use_of_a_history_object_in_JavaScript\"><\/span>Q18: What is the use of a history object in JavaScript?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><b>Ans:<\/b> JavaScript History is a built-in Interface that is used to access the history of the browser. It is a list of links visited by the user in a particular window, frame, or tab, etc. This is one important property of the JavaScript window object which can be accessed through the window.history property.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Q19_What_does_the_%E2%80%9Cthis%E2%80%9D_keyword_refer_to_in_JavaScript\"><\/span>Q19: What does the \u201cthis\u201d keyword refer to in JavaScript?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><b>Ans:<\/b> In JavaScript, functions are objects. Each function has its own properties. \u201cthis\u201d keyword refers to the context in which a program is running. In cases where \u201cthis\u201d keyword is used within a function, the value depends on the definition of the function and invocation, along with the default execution context.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Q20_How_do_timers_work_in_JavaScript_Are_there_any_disadvantages\"><\/span>Q20: How do timers work in JavaScript? Are there any disadvantages?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><b>Ans:<\/b> JavaScript timers run code after a specified period or repeat for a set time at fixed intervals. Important timer functions are:<\/p>\n<ul>\n<li><b>setTimeout<\/b>: Execute code once after some delay in milliseconds<\/li>\n<li><b>setInterval: <\/b>Repeat code execution at specified intervals.<\/li>\n<li><b>clearInterval: <\/b>Cancels a timer that has been started with setInterval.<\/li>\n<\/ul>\n<p>For instance, you can use setTimeout to alert &#8220;Time&#8217;s up!&#8221; after 2 minutes. A limitation of timers is that if used excessively or badly, they could become a performance bottleneck since they rely on the JavaScript event loop, which may block other operations from happening.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Q21_What_is_the_difference_between_ViewState_and_SessionState\"><\/span>Q21: What is the difference between ViewState and SessionState?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><b>Ans:\u00a0<\/b><\/p>\n<ul>\n<li><b>ViewState: <\/b>Stores data exclusive to a single page in a session. It is not accessible across different pages.<\/li>\n<li><b>SessionState :<\/b> Stores user-specific data that can be accessed anywhere on any page during the session of a particular user.<\/li>\n<\/ul>\n<h3><span class=\"ez-toc-section\" id=\"Q22_How_do_I_use_JavaScript_for_submitting_an_HTML_form\"><\/span>Q22: How do I use JavaScript for submitting an HTML form?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><b>Ans: <\/b>You can use the document.forms[0].submit() method to submit an HTML form programmatically in JavaScript.<\/p>\n<p><b>Does JavaScript support type coercion?<\/b><\/p>\n<p>Yes, JavaScript does support type coercion, generally known as automatic type conversion.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Javascript_Interview_Questions_For_Intermediate\"><\/span><b>Javascript Interview Questions For Intermediate<\/b><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p><i>Here are some JavaScript interview questions for Intermediate-level that you need to know:<\/i><\/p>\n<h3><span class=\"ez-toc-section\" id=\"Q1_What_is_the_use_of_Math_Object_in_JavaScript\"><\/span>Q1. What is the use of Math Object in JavaScript?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><b>Ans<\/b>: Math is a built-in object with properties and methods for mathematical constants and functions, where its properties and methods are static. Compared to other objects, it has no constructor.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Q2_What_is_the_role_of_a_strict_mode_in_JavaScript\"><\/span>Q2. What is the role of a strict mode in JavaScript?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><b>Ans: <\/b>Strict Mode is a new feature that allows developers to place a function or program in a strict operating context. It prevents certain specific actions from being taken, so JavaScript could be used safely.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Q3_What_are_the_various_looping_structures_in_JavaScript\"><\/span>Q3: What are the various looping structures in JavaScript?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><b>Ans:<\/b><\/p>\n<ul>\n<li><b>while loop:<\/b> Code is repeated as long as a certain Boolean condition is true. It can be viewed as a repeating if statement.<\/li>\n<li><b>for loop:<\/b> Initialization, the condition and increment\/decrement are combined in one line, making the code concise and easier to debug.<\/li>\n<li><b>do-while loop:<\/b> Just like the while loop, but the check is done after the code block has executed; hence the code block must run at least once.<\/li>\n<\/ul>\n<h3><span class=\"ez-toc-section\" id=\"Q4_What_is_the_need_for_debugging_in_JavaScript\"><\/span>Q4. What is the need for debugging in JavaScript?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><b>Ans: <\/b>Debugging is one of the essential and must-have skills for developers. It is the process of identifying the bugs and resolving them to enhance the efficient running of programs. JavaScript has multiple debugging strategies and tools to improve the performance of the code.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Q5_How_do_you_modify_the_style_or_class_of_an_element_in_JavaScript\"><\/span>Q5. How do you modify the style or class of an element in JavaScript?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><b>Ans:<\/b> You can change the style or class of an element by using the <strong>`document.getElementById`<\/strong> method:<\/p>\n<div class=\"resume-outer-box\">\ndocument.getElementById(&#8220;myText&#8221;).style.fontSize = &#8220;16px;<br \/>\ndocument.getElementById(&#8220;myText&#8221;).className = &#8220;class&#8221;;\n<\/div>\n<h3><span class=\"ez-toc-section\" id=\"Q6_How_can_you_read_and_write_files_using_JavaScript\"><\/span>Q6. How can you read and write files using JavaScript?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><b>Ans: <\/b>There are several functions that you can use to perform file operations:<\/p>\n<ul>\n<li>The <b>readFile()<\/b> functions is used for reading operation.<\/li>\n<\/ul>\n<p>readFile( Path, Options, Callback)<\/p>\n<ul>\n<li>The <b>writeFile()<\/b> functions is used for writing operation.<\/li>\n<\/ul>\n<p>writeFile( Path, Data, Callback)<\/p>\n<p>These functions are typically available in environments like Node.js, as browser-based JavaScript lacks direct file system access for security reasons.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Q7_What_is_variable_typing_in_JavaScript\"><\/span>Q7. What is variable typing in JavaScript?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><b>Ans: <\/b>Variable typing refers to the ability to assign values of different data types to the same variable. For example:<\/p>\n<div class=\"resume-outer-box\">\nAkal = 42;<br \/>\nAkal = &#8220;AkalforIT&#8221;;\n<\/div>\n<p>This is made possible because JavaScript happens to be a dynamically typed language.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Q8_What_is_the_meaning_of_hoisting_in_JavaScript\"><\/span>Q8. What is the meaning of hoisting in JavaScript?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><b>Ans:<\/b> \u00a0\u00a0In JavaScript, hoisting is a concept which lets you remove values of variables and functions. The unique feature of hoisting is that it lets you do so before providing value. This will also prevent errors. It enables functions to be safely used in code before their declaration.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Q9_What_are_the_types_of_scopes_in_JavaScript\"><\/span>Q9. What are the types of scopes in JavaScript?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><b>Ans:<\/b> The scopes in JavaScript are four in number, as listed below:<\/p>\n<ul>\n<li><b>Block Scope:<\/b> Initially, JavaScript has Global and Function scope. let, and const are the two important keywords developed by ES6, which provide Block Scope in JavaScript. To access the variables of this particular block, you have to create an object for it. \u00a0 Local Scope: Local scope consists of things that are declared inside the code blocks and can only be accessed where it is declared.<\/li>\n<li><b>Function Scope:<\/b> JavaScript also has a function scope where every function creates a new scope. Variables declared inside a function can&#8217;t be accessed from outside the function, and variables declared with let, var, and const are similar to when declared inside a function.<\/li>\n<li><b>Global Scope:<\/b> Variables declared Globally, outside any function, can be accessed from anywhere in a program. These include Global Scope and Global variables, similar to function scope variables declared with var, let and const, similar to when declared outside the block.<\/li>\n<\/ul>\n<h3><span class=\"ez-toc-section\" id=\"Q10_What_is_a_callback_in_JavaScript\"><\/span>Q10. What is a callback in JavaScript?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><b>Ans:<\/b> \u00a0Callback in JavaScript is a function that is passed to another function as an argument, which is then gathered inside the outset function to execute some routine and action. It is needed because multiple actions in JavaScript are asynchronous, which means they do stop the function from running till the time they are completed. Rather, it will run in the background while the rest of the code is still running.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Q11_What_is_the_difference_between_Function_declaration_and_Function_expression\"><\/span>Q11. What is the difference between Function declaration and Function expression?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><b>Ans:<\/b> Here is the significant difference between Function Declaration and Function Expression:<\/p>\n<table class=\"table-class\">\n<tbody>\n<tr>\n<th><b>Function Declaration<\/b><\/th>\n<th><b>Function Expression<\/b><\/th>\n<\/tr>\n<tr>\n<td><i>It is also known as a function statement, it declares a function with a function keyword. However, the function declaration must have a function name.<\/i><\/td>\n<td><i>It is like a function declaration but without having any function name.<\/i><\/td>\n<\/tr>\n<tr>\n<td><i>It does not require any variable assignment because it exists as a standalone construct and thus cannot be put inside a functional block.<\/i><\/td>\n<td><i>It can be stored in a variable assignment.<\/i><\/td>\n<\/tr>\n<tr>\n<td><i>It is the first code to be executed before any other code.\u00a0<\/i><\/td>\n<td><i>It can be loaded and executed only via the program executor.<\/i><\/td>\n<\/tr>\n<tr>\n<td><i>It can be accessed before and after a function explanation.\u00a0<\/i><\/td>\n<td><i>Requires the function definition to be accessed.<\/i><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3><span class=\"ez-toc-section\" id=\"Q12_How_can_you_convert_a_number_in_any_base_to_an_integer_in_JavaScript\"><\/span>Q12: How can you convert a number in any base to an integer in JavaScript?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><b>Ans:<\/b> In JavaScript, the `parseInt()` function is used to convert a string to an integer. This function accepts two arguments: the string to be converted and the base of the number system. If the string doesn&#8217;t contain a valid number, `parseInt()` returns `NaN` (Not-a-Number).<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Q13_How_will_you_identify_the_client_machines_OS\"><\/span>Q13: How will you identify the client machine&#8217;s OS?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><b>Ans:<\/b> You can identify the client machine&#8217;s OS using the `navigator.appVersion` or `navigator.userAgent` properties. These properties return a string containing version details of the browser, which can be parsed to identify the OS.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Q14_What_are_the_different_types_of_pop-up_boxes_in_JavaScript\"><\/span>Q14: What are the different types of pop-up boxes in JavaScript?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><b>Ans: <\/b>JavaScript offers three styles of popup boxes:<\/p>\n<ul>\n<li>1. Alert<\/li>\n<li>2. Confirm<\/li>\n<li>3. Prompt<\/li>\n<\/ul>\n<h3><span class=\"ez-toc-section\" id=\"Q15_Whats_the_difference_between_an_alert_box_and_a_confirmation_box\"><\/span>Q15: What&#8217;s the difference between an alert box and a confirmation box?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><b>Ans: <\/b>An alert box\u00a0 displays a message with a single &#8220;OK&#8221; button, usually used to provide information or warnings for the user.<\/p>\n<p>A confirmation box\u00a0 has both &#8220;OK&#8221; and &#8220;Cancel&#8221; buttons to confirm or cancel an action.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Q16_What_are_the_disadvantages_of_using_innerHTML_in_JavaScript\"><\/span>Q16: What are the disadvantages of using `innerHTML` in JavaScript?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><b>Ans: <\/b>Using `innerHTML` has several disadvantages:\u00a0 Replaces content: The use of `innerHTML` to assign new content replaces the entire contents of the element.<\/p>\n<ul>\n<li><b>Inefficient updates: <\/b>Using `+=` (e.g., `innerHTML = innerHTML + &#8216;html&#8217;`) still causes a complete replacement rather than an incremental update.<\/li>\n<li><b>Event handler removal: <\/b>Any event handlers attached to the element&#8217;s children are removed when `innerHTML` is updated.<\/li>\n<\/ul>\n<h3><span class=\"ez-toc-section\" id=\"Q17_What_is_the_purpose_of_void0_in_JavaScript\"><\/span>Q17: What is the purpose of `void(0)` in JavaScript?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><b>Ans:<\/b> The `void(0)` expression is used to execute a statement without causing a page refresh. The `0` is passed as a parameter to the `void` operator, effectively preventing the browser from taking any default action.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Q18_What_is_the_process_to_remove_a_cookie_in_JavaScript\"><\/span>Q18. What is the process to remove a cookie in JavaScript?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><b>Ans<\/b>: You can erase a cookie in JavaScript in two ways that include the use of expire attribute, web browser and max-age attribute.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Q19_How_would_you_add_JavaScript_code_to_HTML_pages\"><\/span>Q19. How would you add JavaScript code to HTML pages?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><b>Ans:<\/b> You can add JavaScript code to HTML pages in three ways, as follows.<\/p>\n<ul>\n<li><b>Embedding Code:<\/b> To include JavaScript code within HTML pages, you can use the &lt;script&gt;\u2026.&lt;\/script&gt; HTML tag that encloses JavaScript code within the HTML program. You can also position JavaScript code in the body or head section, as it completely depends upon the design of the web page that developers use.<\/li>\n<li><b>Inline Code:<\/b> This process is used to call a function in the HTML event attributes. There are multiple events or cases where developers have to add JavaScript code.<\/li>\n<li><b>External File: <\/b>One can also create a file of its own in order to maintain the code of JavaScript separately and then include it in the document of HTML with (.js) extension. You can do it by using the src attribute of &lt;script&gt; tag. This way, you keep the web pages clean, and also save time by not writing the same code again.<\/li>\n<\/ul>\n<h3><span class=\"ez-toc-section\" id=\"Q20_What_are_the_closures_in_JavaScript\"><\/span>Q20. What are the closures in JavaScript?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><b>Ans:<\/b> Closures are an important concept in JavaScript that every developer should know. It is a feature of JavaScript which means free variables that are independent variables. It is a characteristic where the inner function has access to the variable of the outer function. There are three scope chains of a closure as mentioned below:<\/p>\n<ul>\n<li>Access to the outer variables<\/li>\n<li>Access to its own scope<\/li>\n<li>Access to the global variables<\/li>\n<\/ul>\n<h2><span class=\"ez-toc-section\" id=\"JavaScript_Interview_Questions_For_Advanced_Level\"><\/span>JavaScript Interview Questions For Advanced Level<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Following are the questions of JavaScript interview questions for Advanced-level that you should be aware of:<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Q1_Name_three_JavaScript_frameworks_and_their_uses\"><\/span>Q1: Name three JavaScript frameworks and their uses.<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><b>Ans:<\/b> There are many JavaScript frameworks, but here are some of the most used ones:<\/p>\n<ul>\n<li><b>Angular: <\/b>It is a very powerful JavaScript framework which functions easily across different operating systems. It operates by using HTML vocabulary on different web pages. Angular is a cross-platform framework, easy to understand with fewer errors via the concise and data rendering technique. Besides this, it can function on several operating systems.<\/li>\n<li><b>Vue JS:<\/b> It is another JavaScript framework mostly used in building cross-platform applications and websites. Apart from that, it is used to build Single Page Applications. It is flexible, small in size, easy to understand, and provides two-way communication.<\/li>\n<li><b>React JS:<\/b> It is an open-source and one of the best JavaScript frameworks to create responsive and active UI (user interfaces). It is also SEO-friendly and highly recommended by developers who create e-commerce websites. Its key features include one-way data-binding only, Virtual Document Model (DOM), ability to test and debug quickly.<\/li>\n<\/ul>\n<h3><span class=\"ez-toc-section\" id=\"Q2_What_is_the_%E2%80%98Strict_mode_in_JavaScript_How_do_you_invoke_it\"><\/span>Q2. What is the &#8216;Strict&#8217; mode in JavaScript? How do you invoke it?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><b>Ans<\/b>: &#8216;Strict Mode&#8217; is a feature in ECMAScript 5, which introduces a more strict rule set into JavaScript, thereby enhancing code quality and security. It disallows certain actions and throws more exceptions on common mistakes. Strict Mode is enabled by the simple addition of `\\&#8221;use strict\\&#8221;;` at the beginning of a script or even inside a particular function. This will activate a more controlled, restricted environment for JavaScript.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Q3_How_to_get_the_status_of_a_CheckBox\"><\/span>Q3. How to get the status of a CheckBox?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><b>Ans:<\/b> The status of a checkbox can be determined by using the `checked` property of the DOM input element. This is used to reflect the `checked` attribute in HTML.<\/p>\n<p>You use the following code to get the status of a checkbox:<\/p>\n<p>document.getElementById(&#8220;GFG&#8221;).checked;<\/p>\n<p>If selected, it returns `true`; otherwise it returns `false`.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Q4_How_to_explain_closures_in_JavaScript_and_when_to_use_it\"><\/span>Q4. How to explain closures in JavaScript and when to use it?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><b>Ans:<\/b> A closure in JavaScript occurs when a child function retains access to the parent function&#8217;s scope even after the parent function has finished executing. That is, it allows a function to remember and access variables from its outer (enclosing) scope. Closures allow more control over your code and are useful for data encapsulation and creating function factories or private variables.<\/p>\n<p>\/\/ Explanation of closure<\/p>\n<p>function foo() {<\/p>\n<p>let b = 1;<\/p>\n<p>function inner() {<\/p>\n<p>return b;<\/p>\n<p>}<\/p>\n<p>return inner;<\/p>\n<p>}<\/p>\n<p>let get_func_inner = foo();<\/p>\n<p>console.log(get_func_inner());<\/p>\n<p>console.log(get_func_inner());<\/p>\n<p>console.log(get_func_inner());<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Q5_What_is_the_difference_between_the_call_and_apply_methods\"><\/span>Q5. What is the difference between the `call()` and `apply()` methods?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><b>Ans:<\/b> Both the methods are used in different situations:<\/p>\n<ul>\n<li><b>call() Method: <\/b>This method invokes a function, sets the `this` value to the owner object, and allows the function to be called using different objects. The arguments are passed individually.<\/li>\n<li><b>apply() Method:<\/b> Like `call()`, but it accepts its arguments as an array. Use it whenever you want to call a function with an array of arguments, making it great for methods that can work on multiple objects.<\/li>\n<\/ul>\n<h3><span class=\"ez-toc-section\" id=\"Q6_How_do_I_address_a_specific_frame_from_a_hyperlink_using_JavaScript\"><\/span>Q6. How do I address a specific frame from a hyperlink using JavaScript?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><b>Ans: <\/b>You can address a specific frame using the `target` attribute in the `&lt;a&gt;` tag. Here is an example:<\/p>\n<p>&lt;a href=&#8221;\/akalitcompany.htm&#8221; target=&#8221;newframe&#8221;&gt;New Page&lt;\/a&gt;<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Q7_What_are_the_types_of_errors_in_JavaScript\"><\/span>Q7. What are the types of errors in JavaScript?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><b>Ans: <\/b>There are three types of errors in JavaScript:<\/p>\n<ul>\n<li><b>Syntax Error: <\/b>This error occurs if there is some syntactical or structural problem in the code.<\/li>\n<li><b>Logical Error: <\/b>This is the most difficult error to be traced down to, and the program does run incorrectly and terminates unexpectedly because of flaws in the logic.<\/li>\n<li><b>Running Error:<\/b> This occurs in a program while it is running and is also known as an exception.<\/li>\n<\/ul>\n<h3><span class=\"ez-toc-section\" id=\"Q8_What_is_the_difference_between_JavaScript_and_JScript\"><\/span>Q8. What is the difference between JavaScript and JScript?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><b>Ans:<\/b><\/p>\n<ul>\n<li><strong>JavaScript: <\/strong>Developed by Netscape, JavaScript is used for developing applications on both clients and servers and is not related to the Java language.<\/li>\n<li><strong>JScript:<\/strong> Developed by Microsoft, JScript is used in developing dynamic content for the web and is specifically designed for the Microsoft environment.<\/li>\n<\/ul>\n<h3><span class=\"ez-toc-section\" id=\"Q9_What_does_the_statement_var_myArray_declare\"><\/span>Q9. What does the statement `var myArray = [[]];` declare?**<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><b>Ans:<\/b> This statement declares a two-dimensional array in JavaScript.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Q10_In_JavaScript_how_can_you_refer_to_an_HTML_element\"><\/span>Q10. In JavaScript, how can you refer to an HTML element?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><b>Ans: <\/b>There are four ways to refer to an HTML element in JavaScript:<\/p>\n<ul>\n<li>`<b>getElementById()`:<\/b> Access an element by its ID.<\/li>\n<li><b>`getElementsByClassName()`:<\/b> Access elements by their class name.<\/li>\n<li><b>`getElementsByTagName()`<\/b>: Access elements by their tag name.<\/li>\n<li><b>\u00a0`querySelector()`: <\/b>Access the first element that matches a CSS selector.<\/li>\n<\/ul>\n<h3><span class=\"ez-toc-section\" id=\"Q11_What_is_event_bubbling_in_JavaScript\"><\/span>Q11. What is event bubbling in JavaScript?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><b>Ans: <\/b>Event bubbling is a mechanism whereby an event triggered on an inner element propagates upwards to all outer elements. First, the innermost element handles the event, followed by the parent, and up the DOM tree, until the event has been served to all outer elements.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Q12_What_is_memoisation\"><\/span>Q12. What is memoisation?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><b>Ans:<\/b> Memoisation is one of the best techniques to make applications work faster and more effectively. It caches the results and retrieves the same information from the cache when it is needed next time for cashing instead of adding it again.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Q13_What_are_object_prototypes\"><\/span>Q13: What are object prototypes?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><b>Ans:<\/b> Prototypes are objects where JavaScript inherits features from one another. Simply, it is used to add new properties and methods to already existing objects and object constructors.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Q14_What_is_the_difference_between_the_client-side_and_the_server-side_scripting\"><\/span>Q14: What is the difference between the client-side and the server-side scripting?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><b>Ans:<\/b> Here are the significant differences between client-side and server-side scripting:<\/p>\n<table class=\"table-class\">\n<tbody>\n<tr>\n<th><b>Client-side Scripting<\/b><\/th>\n<th><b>Server-side Scripting<\/b><\/th>\n<\/tr>\n<tr>\n<td>Primarily focused on delivering the requested output to the end-user.<\/td>\n<td>Geared towards manipulating and providing access to the requested database.<\/td>\n<\/tr>\n<tr>\n<td>Operates on the front end, making the source code visible to the user.<\/td>\n<td>Functions on the backend, with source code hidden from users, as the output is usually rendered in HTML.<\/td>\n<\/tr>\n<tr>\n<td>Does not require server interaction.<\/td>\n<td>Depends on server interaction for execution<\/td>\n<\/tr>\n<tr>\n<td>Less secure due to the accessibility of the code to the client.<\/td>\n<td>More secure for web applications as the code remains concealed.<\/td>\n<\/tr>\n<tr>\n<td>Executed on the user&#8217;s device or browser<\/td>\n<td>Executed on the web server.<\/td>\n<\/tr>\n<tr>\n<td>Performance can vary depending on the browser version.<\/td>\n<td>Independent of the client\u2019s system or browser.<\/td>\n<\/tr>\n<tr>\n<td>Does not provide access to files stored on the web<\/td>\n<td>Grants complete access to files stored on the web database server.<\/td>\n<\/tr>\n<tr>\n<td>Used to customise web pages and create unique user experiences.<\/td>\n<td>Reduces server load<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3><span class=\"ez-toc-section\" id=\"Q15_What_is_a_WeakMap\"><\/span>Q15: What is a WeakMap?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><b>Ans:<\/b> A WeakMap is a key-value data structure where only objects can be used as keys. It automatically removes a key-value pair when the key object is no longer accessible, ensuring efficient memory management. This allows data to be associated with objects without preventing the garbage collection of those objects, even if the values reference the key.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Q16_What_does_Event_Bubbling_refer_to_in_JavaScript\"><\/span>Q16: What does Event Bubbling refer to in JavaScript?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><b>Ans:<\/b> Event bubbling is a method of event propagation in the HTML DOM API. Whenever an event occurs on an element nested inside another element, and both elements have event handlers for the same event, then the event propagates from the innermost element outwards towards the outer elements. In simpler words, the event triggers on the targeted element first and then &#8220;bubbles up&#8221; through its parent elements.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Q17_State_the_difference_between_declaring_variables_using_var_let_and_cont\"><\/span><b>Q17: State the difference between declaring variables using var, let, and cont.<\/b><span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><b>Ans:<\/b> Here are the major differences between var, let, and const:<\/p>\n<table class=\"table-class\">\n<tbody>\n<tr>\n<th><b>var<\/b><\/th>\n<th><b>let<\/b><\/th>\n<th><b>const<\/b><\/th>\n<\/tr>\n<tr>\n<td>Functional scope (accessible throughout the function it&#8217;s declared in).<\/td>\n<td>Block scope (accessible only within the block where it is declared).<\/td>\n<td>Block scope (accessible only within the block where it is declared).<\/td>\n<\/tr>\n<tr>\n<td>Can be updated and re-declared within the same scope<\/td>\n<td>Can be updated, but cannot be re-declared within the same scope.<\/td>\n<td>Cannot be updated or re-declared within the same scope.<\/td>\n<\/tr>\n<tr>\n<td>Can be declared without initialization (it defaults to undefined)<\/td>\n<td>Can be declared without initialization (but must be initialized before use).<\/td>\n<td>Must be declared with initialization (cannot be left undefined).<\/td>\n<\/tr>\n<tr>\n<td>Hoisting: The variable is hoisted and initialized with undefined at the start of the scope.<\/td>\n<td>The variable is hoisted but not initialized, leading to a Temporal Dead Zone (TDZ), where accessing it before initialization causes a ReferenceError<\/td>\n<td>The variable is hoisted but not initialized, leading to a Temporal Dead Zone (TDZ).<\/td>\n<\/tr>\n<tr>\n<td>Can cause issues due to hoisting and can lead to unexpected results when used in loops or conditional blocks.<\/td>\n<td>Offers more control over variable scope compared to var, reducing issues with hoisting.<\/td>\n<td>Ensures immutability, making it ideal for variables that should not be reassigned (though the object\u2019s contents can still be modified).<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3><span class=\"ez-toc-section\" id=\"Q18_What_are_undeclared_and_undefined_variables\"><\/span><b>Q18: What are undeclared and undefined variables?<\/b><span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><b>Ans:<\/b><\/p>\n<table class=\"table-class\">\n<tbody>\n<tr>\n<th><b>Undefined Variable<\/b><\/th>\n<th><b>Undeclared Variable<\/b><\/th>\n<\/tr>\n<tr>\n<td>An undefined variable is one that has been declared but has not been assigned a value.<\/td>\n<td>An undeclared variable is a variable that has not been defined or declared in the program.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3><span class=\"ez-toc-section\" id=\"Q19_What_is_Strict_Mode_in_JavaScript\"><\/span>Q19: What is Strict Mode in JavaScript?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><b>Ans:<\/b> In JavaScript, strict mode is a feature that has a much more restrictive set of rules for writing JavaScript code. It makes the code more secure to execute the actions by preventing certain actions and throwing errors for unsafe operations.<\/p>\n<p>Now that you know the most important JavaScript interview questions, it&#8217;s time to begin getting ready. Remember, practice makes perfect, so sit in front of a mirror and practice your answers as if you were interviewing. If you want further instruction in JavaScript, attend a course.\u00a0 Good luck with nailing your interview and landing your dream job!<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Q20_What_is_Event_Capturing_in_JavaScript\"><\/span>Q20: What is Event Capturing in JavaScript?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><b>Ans: <\/b>Event capturing is one of the two event propagation methods in the HTML DOM. In this process, the event starts from the outermost element and moves towards the target element, which is the reverse of event bubbling.<\/p>\n<p>The above are some JavaScript interview questions that will help you in clearing your interview. Best of luck!<\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"tmnf_excerpt\">Are you looking for the top JavaScript interview questions? You\u2019re in the right place! JavaScript, \u2026<\/div>","protected":false},"author":1,"featured_media":926,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[102],"tags":[],"_links":{"self":[{"href":"https:\/\/www.akalinfo.com\/blog\/wp-json\/wp\/v2\/posts\/901"}],"collection":[{"href":"https:\/\/www.akalinfo.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.akalinfo.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.akalinfo.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.akalinfo.com\/blog\/wp-json\/wp\/v2\/comments?post=901"}],"version-history":[{"count":29,"href":"https:\/\/www.akalinfo.com\/blog\/wp-json\/wp\/v2\/posts\/901\/revisions"}],"predecessor-version":[{"id":1053,"href":"https:\/\/www.akalinfo.com\/blog\/wp-json\/wp\/v2\/posts\/901\/revisions\/1053"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.akalinfo.com\/blog\/wp-json\/wp\/v2\/media\/926"}],"wp:attachment":[{"href":"https:\/\/www.akalinfo.com\/blog\/wp-json\/wp\/v2\/media?parent=901"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.akalinfo.com\/blog\/wp-json\/wp\/v2\/categories?post=901"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.akalinfo.com\/blog\/wp-json\/wp\/v2\/tags?post=901"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}