Docsity

JavaScript Built-in Objects and Methods: Math, String, Date, and Window, Summaries of Computer science

Toggle sidebar
bg1
1. join(delimiter): returns do you limited list of the items indexed with integers
in the array.
2. length: holds the number of elements in the array.
3. sort(): sorts the array alphabetically.
Built in objects in JavaScript!
Math Object-
E: the constant of E, the base of natural logarithms.!
LN2: The natural logarithm of 2.!
LOG2E: base 2 logarithm of E.!
PI: returns pi.!
SQRT1_2: square root of 1/2.!
SQRT2. sin(x). log(x). max. min. sqrt(x). random(). pow(a,b). !
abs(x): absolute value of x.!
ceil(x): returns the smallest integer greater than or equal to X.| floor(x).
String Object-
length. toLowerCase(). toUpperCase(). toString(). split(string). concat(string).
pf3

Partial preview of the text

Download JavaScript Built-in Objects and Methods: Math, String, Date, and Window and more Summaries Computer science in PDF only on Docsity!

  1. join(delimiter): returns do you limited list of the items indexed with integers in the array.
  2. length: holds the number of elements in the array.
  3. sort(): sorts the array alphabetically.

Built in objects in JavaScript

Math Object-

E: the constant of E, the base of natural logarithms. LN2: The natural logarithm of 2. LOG2E: base 2 logarithm of E. PI: returns pi. SQRT1_2: square root of 1/2. SQRT2. sin(x). log(x). max. min. sqrt(x). random(). pow(a,b). abs(x): absolute value of x. ceil(x): returns the smallest integer greater than or equal to X.| floor(x).

String Object-

length. toLowerCase(). toUpperCase(). toString(). split(string). concat(string).

substr(start, length): Returns the characters in a string beginning at the specified location through the specified numbers of characters. substring(start, end): returns the characters in a string between two indexes into the string. charAt(index): returns the character at the specified index in a string. charCodeAt(index): Returns a number indicating the Unicode value of the character at the given index in a string.

Date Object-

Date(). getDate(). getDay(). getFullYear(). getHours(). getMilliseconds(). getMinutes(). getMonth(). getSeconds(). getTime().

Window Object-

closed: returs a boolean value indicating whether a window has been closed or not. name: name of window parent: returns the parent window of the current window. blur(): removes focus from current window. close(): dialogue box with message, OK and CANCEL. focus(): sets focus to correct window.| open(). print(). prompt(). stop().