This document provides an overview of various JavaScript objects including the Math, String, Date, document, and window objects. It describes key properties and methods for each object, and provides examples of how to use the Date and window objects.
Agenda Introduction Math Object String Object Date Object document Object window Object of 20
3.
Math ObjectMath object methods allow you to perform many common mathematical calculations . An object’s methods are called by writing the name of the object followed by a dot operator ( . ) and the name of the method In parentheses following the method name is the argument (or a comma-separated list of arguments) to the method of 20
Math Object ExampleGenerating a random number from 0…10, inclusive. ( randomNumber1.html ) Generating a random number from 10…20, inclusive. ( randomNumber2.html ) of 20
7.
String ObjectA string is a series of characters treated as a single unit A string may include letters, digits and various special characters, such as + , - , * , / , and $ JavaScript supports Unicode, which represents a large portion of the world’s languages String literals or string constants (often called anonymous String objects) are written as a sequence of characters in double quotation marks or single quotation marks of 20
String Objects -Examples To Uppercase, Split and Sub String SplitAndSubString of 20
11.
Date ObjectDate object provides methods for date and time manipulations A constructor is an initializer method for an object Called automatically when an object is allocated with new The Date constructor with no arguments initializes the Date object with the local computer’s current date and time Can also create a new Date object by supplying arguments to the Date constructor for year, month, date, hours, minutes, seconds and milliseconds. of 20
window Objectwindow object provides methods for manipulating browser windows window object open method Creates a window Three parameters—the URL of the page to open in the new window, the name of the window, a string of comma-separated, all-lowercase feature names, each followed by an = sign and either "yes" or "no" to determine whether that feature should be displayed in the new window If these parameters are omitted, the browser defaults to a new window containing an empty page, no title and all features visible. of 20
18.
… window Object window object closed property Contains a boolean value that is true if the window is closed and false if the window is open close method Closes the current window and deletes its object from memory location property contains a string representation of the URL displayed in the current window of 20