JavaScript Exam Sample Questions with Verified Answers 2024
What is NOT true about let, var, and const? -let and const were new additions in ES6 -let can be defined in block scope -let can be redeclared in the same scope -const cannot be reassigned - let can be redeclared in the same scope TRUE OR FALSE: By default, event handlers are set to the bubbling phase. - True Which function of the XMLHttpRequest object sends the request to the server? - send Which of these is not among the parameters used in the XMLHttpRequest open function? -HTTP method -URL -async on/off -form data - form data This property of the XMLHttpRequest object will contain the event handler to be called when the readystatechange event is fired. - onreadystatechange This property of the XMLHttpRequest object will have a value of 200 when the server sends back an HTTP response with an OK status code. - status This property of the XMLHttpRequest object will have a value of 4 when the server completes the requested operation. - readyState What is === operator? - Compares value equality as well as data type Which is NOT a JavaScript data type? -Number -String -Boolean -Function -Object -Null -Undeclared - Undeclared What is NOT true about JavaScript? -JavaScript is a scripting language -It is object-based, lightweight, and cross platform -It is widely used for client side validation -JavaScript relies on server-side technologies to manage cookies -Able to build interactivity into otherwise static HTML pages -Embedded in Netscape, Internet Explorer, and other web browsers - JavaScript relies on server-side technologies to manage cookies TRUE OR FALSE: In JavaScript, Array inherits from Object. - True TRUE OR FALSE: In JavaScript, a closure is an inner function that has access to its outer function's scope, even after the outer function has returned. - True TRUE OR FALSE: JavaScript code is compiled before being delivered to the browser (or other platform). - False What is the correct way to write a JavaScript array? - var colors = ["red', "green", "blue"
Document information
- Uploaded on
- June 10, 2024
- Number of pages
- 5
- Written in
- 2023/2024
- Type
- Exam (elaborations)
- Contains
- Questions & answers