This section contains some methods that will be added to the standard Javascript objects.
Methods
- Makes a shallow copy of the array
Returns:
Type Description array A shallow copy of the array - Checks whether the array contains a given element
Name Type Description elementany The element to search for Returns:
Type Description boolean True if the array contains a given element - Checks whether the two arrays are the same
Name Type Description arrayarray The array to compare Returns:
Type Description boolean True if the two arrays are the same - Removes a given element from the array (in place)
Name Type Description elementany The element to remove Returns:
Type Description array The array after removal - Generates a random integer in the range (0, max-1)
Name Type Description maxnumber The upper boundary (excluded) Returns:
Type Description number A random integer - Returns a number whose value is limited to the given range
Name Type Description minnumber The lower boundary maxnumber The upper boundary Returns:
Type Description number A number within the range (min, max). - Returns a modulo value which is always positive
Name Type Description nnumber The divisor Returns:
Type Description number A modulo value - Makes a number string with leading zeros
Name Type Description lengthnumber The length of the output string Returns:
Type Description string A string with leading zeros - Checks whether the string contains a given string
Name Type Description stringstring The string to search for Returns:
Type Description boolean True if the string contains a given string - Replaces %1, %2 and so on in the string to the arguments
Name Type Description ...argsany The objects to format Returns:
Type Description string A formatted string - Makes a number string with leading zeros
Name Type Description lengthnumber The length of the output string Returns:
Type Description string A string with leading zeros