






Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!







When you call Screen.pixeldepth what does it return? - Correct Answers -Number of bits used to display one color Which of the following statements accurately describe the concept of "NaN" in JavaScript? - Correct Answers -It is a property of the global object NaN is a non-configurable, non-writable property NaN indicates a failed operation on numbers Which of the following are true about the JavaScript "Document" Object? - Correct Answers -A Document object represents the HTML document that is displayed in that window The document contains the contents of the page Which of the following accurately describes the "mouseout" event in JavaScript? - Correct Answers -It occurs when the mouse pointer is moved out of an element, or out of one of its children Which of the following statements about JavaScript basics is/are true? - Correct Answers -JavaScript is case-sensitive. JavaScript is a single-threaded programming language. What is the purpose of the Browser Object Model (BOM)? - Correct Answers -To provide a way for JavaScript to interact with the web browser What are different types of Inheritance in JavaScript? - Correct Answers -Classical Inheritance Prototype Inheritance What does the "Continue" Statement in JavaScript do? - Correct Answers -It terminates the execution of statements while iterating the loop What is the purpose of the toLocaleString() method in JavaScript? - Correct Answers - Returns a string with the local representation of the date and time
_____ returns the number of options displayed in the selection list. - Correct Answers - select.length What is the definition of a function in JavaScript? - Correct Answers -A block of code that performs a specific task and returns a result What is the difference between using single quotes and double quotes in JavaScript? - Correct Answers -Single quotes and double quotes can be used interchangeably to define strings in JavaScript Which of the following statements are true about JavaScript Objects? - Correct Answers -To create object classes, you should apply a function known as an object constructor that defines the properties and methods associated with the object type One object class can include objects defined in other classes What is the purpose of the return statement in a function? - Correct Answers -To specify the value that should be returned from the function Which of the following provides the most accurate definition of "Block Scope"? - Correct Answers -The variables can be scoped to the nearest pair of curly braces. Which means they can't be accessed from outside that pair of curly braces What are the categories that Non-Primitive datatypes are divided into? - Correct Answers -Object Array What is the primary function of using "console.log()" in JavaScript? - Correct Answers - To debug and troubleshoot the issues To display information and feedback to the user Which of the following options can be used to determine the height of the screen in JavaScript? - Correct Answers -screen.height screen.availHeight Which of the following best defines "Global Scope" in JavaScript? - Correct Answers -A scope that is available throughout the entire program Which of the following statements are correct about methods in JavaScript? - Correct Answers -Methods are actions that can be performed on objects Method is a property containing a function definition Methods are functions stored as object properties What is returned by Screen.colordepth when invoked? - Correct Answers -number of bits used to display one color
What is the expected output of "Math.min(0,150,30,20, -8, -200);"? - Correct Answers -- 200 How many types of errors are there in JavaScript? - Correct Answers - What is the purpose of the "POST" HTTP request method? - Correct Answers -To send data to a server for processing Which of the following is the correct syntax for using the call() method in JavaScript? - Correct Answers -function.call(thisObj, arg1, arg2, arg3, ...) A Confirmation Dialog Box contains _______ Buttons: - Correct Answers - What is an object in JavaScript? - Correct Answers -A collection of related data and functions How many types of basic "Scope" are available in JavaScript? - Correct Answers - What are the true statements about the JavaScript "Window" Object? - Correct Answers -It represents the browser's window Global functions that are methods of the window object Which of the following is a correct statement about the "click" event in JavaScript? - Correct Answers -It occurs when the user clicks on an element An Alert Dialog Box contains _______ Buttons. - Correct Answers - Which of the following statements are true about the "submit" event in JavaScript? - Correct Answers -This event that occurs when you try to submit a form You can put your form validation against this event type Which of the following best describes the usage of getElementsByClassName in JavaScript? - Correct Answers -A method of the document object that returns a collection of elements by class name What is the main purpose of using the "GET" HTTP request method? - Correct Answers -It retrieves a representation of the specified resource What is the main function of the getElementsByTagName method in JavaScript? - Correct Answers -It returns all elements with the specified tag name from the current document What is innerHTML used for in JavaScript? - Correct Answers -It sets the HTML contents of an element on a web page A developer can change the page's content without refreshing the page
Which statement best defines a Higher Order Function in JavaScript? - Correct Answers -A function that takes other functions as arguments or returns a function Which of the following statements are correct about properties in JavaScript? - Correct Answers -It is a characteristic of an object, often describing attributes associated with a data structure Which of the following accurately describes the "mouseover" event in JavaScript? - Correct Answers -Triggered when the mouse pointer moves over an element or one of its descendants Why do developers use the "Debugger" keyword in JavaScript? - Correct Answers -It stops the execution of JavaScript code It calls the debugging function Which of the following are correct statements about the "Math" Object? - Correct Answers -To performs calculations It is used to perform mathematical tasks on numbers Math is not a constructor Which of the following statements correctly describe Syntax Errors in JavaScript? - Correct Answers -An exception caused by the incorrect use of a pre-defined syntax Syntax errors are detected while compiling or parsing source code Which of the following best describes the use of the "mouseover" event in JavaScript? - Correct Answers -Triggers an action when the mouse pointer enters an element What is the correct description of static properties in JavaScript? - Correct Answers -It holds data shared among all object instances What does the "load" event in JavaScript do? - Correct Answers -Triggers when the page is fully loaded Input Radio Object Property: Value - Correct Answers -Sets or returns the value of the value attribute of the radio button Input Radio Object Property: Checked - Correct Answers -Sets or returns the checked state of a radio button Input Radio Object Property: DefaultChecked - Correct Answers -Returns the default value of the checked attribute. Input Radio Object Property: name - Correct Answers -sets or returns the value of the name attribute of a radio button
If you declare a variable inside a function using the let keyword, where can you access that variable? - Correct Answers -Only inside that function Given the RegExp literal /ab+c/, what does it represent? - Correct Answers -Matches a string that has an a followed by one or more b's If you want to generate a custom error message, which statement would you use? - Correct Answers -throw new Error('Message') How would you display a prompt dialog to ask a user for their name? - Correct Answers -window.prompt('What's your name?'); In JavaScript, what will the following code display in the console? console.log(4 + 3 + '7'); - Correct Answers - What methods can be used to check if an object is an instance of a particular constructor? - Correct Answers -instanceOf What BOM method is best used to display an informational message to the user? - Correct Answers -window.alert('Your data has been saved.'); To check if an object has its own enumerable property with a specific name, which method can you use? - Correct Answers -obj.hasOwnProperty(propName) Given a string variable userInput, which of the following would correctly test if it has a numeric value? - Correct Answers -if (!isNaN(userInput)) Which of the following is NOT a valid way to create an object in JavaScript? - Correct Answers -const obj = new obj(); Which of the following methods can be used to deeply compare two objects for equality in JavaScript? - Correct Answers -JSON.stringify(obj1) === JSON.stringify(obj2) When using a for...in loop to enumerate properties of an object, which of the following statements is true? - Correct Answers -It will iterate over all properties, including those in the prototype chain. What is a distinctive feature of arrow functions in comparison to traditional function expressions? - Correct Answers -They don't bind their own this value To create a new div element in JavaScript, which method would be appropriate? - Correct Answers -document.createElement Which of the following is the conditional (ternary) operator in JavaScript? - Correct Answers -? :
How is an Array literal correctly represented in JavaScript? - Correct Answers -array = ['a', 'b', 'c',]; What is the correct syntax for accessing a property in an object? - Correct Answers - objectName.propertyName bjectName["propertyName"] Consider the following JavaScript code: console.log(x); var x = 5; console.log(x); What will be the output in the console? - Correct Answers -Undefined, 5 Which of the following is the most recent way to declare a block-scoped variable in JavaScript? - Correct Answers -let Which method can be used to extract the minutes from a Date object in JavaScript? - Correct Answers -date.getMinutes Which method can be used to create an object that inherits from another object? - Correct Answers -Object.create() What will be the output of the following JavaScript expression: '5' + 3? - Correct Answers -'53' Which of the following statements correctly describes the differences between the "==" and "===" operators in JavaScript? - Correct Answers -"==" performs type coercion, whereas "===" does not. "==" checks for both values, whereas "===" checks for both type and values. iven the code below, what will the value of x be after execution? var x = 10; function changeX() { var x = 5; } changeX(); - Correct Answers - Why is overusing document.write() generally discouraged in modern web development?
If you want to mask values such as passwords in an input field, which attribute should the field have? - Correct Answers -type = 'password' Given the expression a = b = 5, what is the value of a after this expression is executed?