Podcast
Questions and Answers
What method is used to set date values for a date object?
What method is used to set date values for a date object?
Which of the following methods is NOT a part of the String Object?
Which of the following methods is NOT a part of the String Object?
Which method would you use to retrieve the character at a specific position in a string?
Which method would you use to retrieve the character at a specific position in a string?
What is the primary purpose of the Browser Object Model (BOM)?
What is the primary purpose of the Browser Object Model (BOM)?
Signup and view all the answers
In JavaScript, what are the two main components that objects serve as containers for?
In JavaScript, what are the two main components that objects serve as containers for?
Signup and view all the answers
Which object would you use in JavaScript to perform mathematical tasks?
Which object would you use in JavaScript to perform mathematical tasks?
Signup and view all the answers
What method can you use to close the current window in the browser?
What method can you use to close the current window in the browser?
Signup and view all the answers
To return the width of the visitor's screen in pixels, which object and property would you use?
To return the width of the visitor's screen in pixels, which object and property would you use?
Signup and view all the answers
Which of the following accurately describes the built-in objects in JavaScript?
Which of the following accurately describes the built-in objects in JavaScript?
Signup and view all the answers
What is the purpose of the Document Object Model (DOM)?
What is the purpose of the Document Object Model (DOM)?
Signup and view all the answers
Which statement about the Date object is incorrect?
Which statement about the Date object is incorrect?
Signup and view all the answers
Which method retrieves the highest value among given numbers?
Which method retrieves the highest value among given numbers?
Signup and view all the answers
What syntax would you use to retrieve the base 10 logarithm of a number?
What syntax would you use to retrieve the base 10 logarithm of a number?
Signup and view all the answers
What is the correct syntax to round a number down to the nearest integer?
What is the correct syntax to round a number down to the nearest integer?
Signup and view all the answers
Which of the following statements about JavaScript Math properties is false?
Which of the following statements about JavaScript Math properties is false?
Signup and view all the answers
Which method allows you to adjust date objects by setting specific date and time components?
Which method allows you to adjust date objects by setting specific date and time components?
Signup and view all the answers
What method should be used to load a new document in the window location object?
What method should be used to load a new document in the window location object?
Signup and view all the answers
Which methods can be used to navigate back and forward in the browsing history?
Which methods can be used to navigate back and forward in the browsing history?
Signup and view all the answers
Which of the following describes the three window popup boxes correctly?
Which of the following describes the three window popup boxes correctly?
Signup and view all the answers
What is the purpose of a confirm box?
What is the purpose of a confirm box?
Signup and view all the answers
Which statement is false regarding a prompt box?
Which statement is false regarding a prompt box?
Signup and view all the answers
Which of the following methods is not part of the HTML DOM concept?
Which of the following methods is not part of the HTML DOM concept?
Signup and view all the answers
What is the correct method to access elements by their class name in a document object?
What is the correct method to access elements by their class name in a document object?
Signup and view all the answers
How can you modify the content of an HTML element most easily?
How can you modify the content of an HTML element most easily?
Signup and view all the answers
Study Notes
Built-in Objects
- Pre-defined objects providing functionalities
- Included in the browser environment
Document Object Model (DOM)
- Enables JavaScript to interact with the browser
- Collection of objects exposed by the browser
- Allows JS to interact with the browser window, document, and other browser-specific functionalities
- Provides an interface to create, change or remove elements within a document.
Mathematical Constants and Methods
-
Math.SQRT1_2
: Returns the square root of 1/2 -
Math.LOG10E
: Returns the base-10 logarithm of e -
Math.min()
: Returns the lowest value among input parameters -
Math.max()
: Returns the highest value among input parameters -
Math.abs()
: Returns the absolute value of a number -
Math.random()
: Generates a random number
Date Object
- Represents dates and times in JavaScript
- Allows creating and manipulating dates
- Extracts specific components (year, month, day, hour, minute, second)
Window and Screen Object
-
Screen.availWidth
: Returns width of user's display minus the interface (like taskbar) -
Screen.width
: Returns the total width of the screen. -
Window.location.href
: Returns the URL of the current page. -
Window.location.assign()
: Loads a specified URL
History Object
-
history.back()
: Loads the previous URL. -
history.forward()
: Loads the next URL.
Popup boxes
-
Alert Box
: Informs the user. -
Confirm Box
: Asks a yes/no question. -
Prompt Box
: Asks for input
HTML Document Object Model (DOM)
- The HTML DOM allows you to execute code when an event occurs
- Used to change the styles and content of elements.
-
document.getElementById()
: Finds an element by its ID. -
document.getElementByTagName()
: Finds elements by tag name. -
document.getElementByClassName()
: Finds elements by class name. -
innerHTML
: Modifies the content of an element, typically used to display or change content. -
style.property
: Modifies styling of an element.
Studying That Suits You
Use AI to generate personalized quizzes and flashcards to suit your learning preferences.
Related Documents
Description
Test your knowledge on the built-in objects in JavaScript, including the Document Object Model (DOM) and mathematical constants. This quiz covers functionalities that enable JavaScript to interact with the browser, manipulate dates, and perform mathematical operations. Enhance your understanding of these essential JavaScript concepts.