mirror of
https://github.com/LeCoupa/awesome-cheatsheets.git
synced 2026-01-26 13:18:06 -08:00
Compare commits
3 Commits
cb048c4549
...
a50957ab8a
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a50957ab8a | ||
|
|
c3c164bea7 | ||
|
|
cd95d18c5b |
@@ -99,3 +99,22 @@ arr.reduce(callback[, initialValue]) // Apply a function against
|
|||||||
arr.reduceRight(callback[, initialValue]) // Apply a function against an accumulator and each value of the array (from right-to-left) as to reduce it to a single value.
|
arr.reduceRight(callback[, initialValue]) // Apply a function against an accumulator and each value of the array (from right-to-left) as to reduce it to a single value.
|
||||||
arr.some(callback[, initialValue]) // Returns true if at least one element in this array satisfies the provided testing function.
|
arr.some(callback[, initialValue]) // Returns true if at least one element in this array satisfies the provided testing function.
|
||||||
arr.values() // Returns a new Array Iterator object that contains the values for each index in the array.
|
arr.values() // Returns a new Array Iterator object that contains the values for each index in the array.
|
||||||
|
|
||||||
|
|
||||||
|
// String.prototype.startsWith()
|
||||||
|
str.startsWith(searchString[, position]) // Checks if the string starts with the given characters.
|
||||||
|
str.endsWith(searchString[, length]) // Checks if the string ends with the given characters.
|
||||||
|
str.includes(searchString[, position]) // Checks if the string contains the given characters.
|
||||||
|
str.repeat(count) // Repeats the string for the specified number of times.
|
||||||
|
|
||||||
|
// Math methods
|
||||||
|
Math.max(value1, value2, ..., valueN) // Returns the largest number from the given arguments.
|
||||||
|
Math.min(value1, value2, ..., valueN) // Returns the smallest number from the given arguments.
|
||||||
|
Math.random() // Generates a random number between 0 (inclusive) and 1 (exclusive).
|
||||||
|
Math.round(x) // Rounds the number to the nearest integer.
|
||||||
|
Math.floor(x) // Rounds the number down to the nearest integer.
|
||||||
|
Math.ceil(x) // Rounds the number up to the nearest integer.
|
||||||
|
Math.pow(base, exponent) // Raises the base to the power of the exponent.
|
||||||
|
Math.sqrt(x) // Returns the square root of a number.
|
||||||
|
Math.trunc(x) // Removes the fractional part of a number, returning only the integer part.
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user