Collection of utility functions
adds two numbers
returns true or false depending if the provided property is present inside the provided object
assigns properties of one or more source objects onto target object
capitalizes first letter of string
returns a new array formed by applying a given callback function to each element of the array, and then flattening the result by one level
takes two arguments: a function and either an array or another function. The function applies the input function to every element of the input array or to the result of calling the input function on the input array. Then, the results are concatenated into a new array and returned.
chunks provided array to specified size chunks
determines whether provided value is an array
returns true or false depending if the provided value is an object
returns an array of the provided object keys
maps values of the provided object
returns an exact clone of the provided value with a new reference
converts provided string to camel case
removes all nullish and NaN values from the provided object or array
returns a composed value from the provided arguments
delays the execution of a function until a certain period of time has passed without the function being called again
recurses through an object and transforms its keys – and the keys of any nested objects – based on the provided key mapping function
deep merges provided objects by assigning the sources onto the target object passed as the first argument
returns true or false depending if the provided value is null or undefined
returns a function that invoked with a null or undefined values returns the provided default
returns an array of keys of the object passed as the first argument that are not present, or that are present, but have different values, in object passed as the second argument
drops specific amount of elements of the provided array starting at the beginning
drops specific amount of elements of the provided array starting at the end
returns an array if an array was provided, or a new array if provided value was not an array
returns an array of entries of the provided object
returns the first element of the provided array that returns true for the predicate function, or undefined if the element was not found
returns the index of the element of the provided array that returns true for the predicate function, or -1 if the element was not found
returns the key of the provided object that returns true for the predicate function, or undefined if the key was not found
returns the last element of the provided array that returns true for the predicate function, or undefined if the element was not found
returns the index of the last element of the provided array that returns true for the predicate function, starting from the specified index element to the begining of the array, or -1 if the element was not found
returns the index of the last element of the provided array that returns true for the predicate function, or -1 if the element was not found
returns an array of requested length filled with provided value
returns the provided value
flattens the provided array by one level
invokes the provided callback for each of the provided object fields
returns an object constructed from the provided array of key, value pairs'
generates a random id
generates an unique id based on the provided object keys
returns the value from the specififed path from the provided object
returns the value from the specififed path from the provided object or the default value if the path element was not found
groups values from the provided array or object based on the result of the provided mapper function
groups values from the provided object based on the result of the provided key mapping function
returns true or false depending if the provided value is present inside the provided array or string
returns true or false depending if the provided value is an empty object or an empty array
returns true or false depending if the provided value is falsy
returns true or false depending if the provided value is truthy
returns true or false depending if the provided value is a Promise
constructs an object from the provided array of objects, grouped by the value of the specified key
returns the last element of the provided array or undefined when array is empty
maps keys of the provided object
maps values and keys of the provided object
deep merges the two provided objects
deep merges all provided objects
memoizes the provided function so it returns cached results but based on the provided key resolver
memoizes the provided function so it returns cached results when invoked with the same arguments
memoizes the provided function so it returns cached results but only with one cache key
does literally nothing
returns an array of values of the provided object
sorts values of the provided object or array based on the provided mapping function or the provided prop string
returns an object the same as the provided one but without the fields omitted by the predicate function
returns the provided object but with specified keys omitted
returns an object same as the provided one but without the fields omitted by the predicate function
returns a particular function to be executed only a single time
returns a function that called invokes the provided array of functions with the call arguments
returns the specified amount of the provided array elements starting from the end
returns a function that called invokes the provided arguments transformers
returns a tuple from the two provided values
returns a tuple of valid and invalid parts of the object as defined in validation function passed in the first argument
picks specified properties from the object
returns an object same as the provided one but with the fields picked by the predicate function
returns an object same as the provided one but with the fields picked by the predicate function
picks specified props only if they exist on the provided object
returns a random integer number between the specified min and max values
returns an array filled with numbers in an ascending order to the provided max value
returns an array with elements that return false for the provided predicate function
returns the provided array without the specified index element
sets the property of the provided object specified by the provided path in form of a string or an array of keys
returns true if the provided values are shallow equal
shortens the provided string by the specified amount
returns a sign of the provided number or NaN if value different than number was provided
returns an array with the provided array values shuffled
returns the diff object from the provided object and slice comparison
snake cases the provided string
returns true if some of the array values is truthy
splits an array or a string at the given index
returns a tuple with the provided array splited on an element that returned true for the provided function, iterating from the right side
returns a function that called with an array of values calls the provided function with the spreaded arguments from the array arguments
returns a sum of all the provided array number values
returns the specified amount of the provided array elements starting from the beginning
takes elements while predicate returns true starting from the right from the specified index
takes elements while predicate returns true
ensures that a function is executed at a fixed interval, so that it is not called too frequently
converts values that are iterable to an array
returns the provided number with specified amount of decimal digits
returns an array of derived from the provided object key-value tuples
ensures that a function is executed at a fixed interval, so that it is not called too frequently
ensures that a function is executed at a fixed interval, so that it is not called too frequently
returns 0 for matching strings
return -1 for string with lower char code at some position
return 1 for string with greater char code at some position
trims the beginning whitespaces from the provided string
trims the end whitespaces from the provided string
returns the provided string repeated the specified amount of times
returns an array with all the duplicates from the provided array removed based on the iteratee function
returns an array with all the duplicates from the provided array removed
updates the provided array with the provided value on the specified index
returns an array without the specified elements from the provided array
returns an array of tuples of certain index elements from two provided arrays based on the zipper function
returns an array of tuples of certain index elements from two provided arrays
adds two numbers
Kind: global function
Example
``js`
add(1, 2)
// returns 3
returns true or false depending if the provided property is present inside the provided object
Kind: global function
Example
`js`
hasOwn('a', { a: 1, b: 2 })
// returns true
assigns properties of one or more source objects onto target object
Kind: global function
Example
`js`
assign({ a: 1, b: 2 }, { b: 4, c: 5 })
// returns { a: 1, b: 4, c: 5 }
capitalizes first letter of string
Kind: global function
Example
`js`
capitalizeFirstLetter('hello')
// returns 'Hello'
returns a new array formed by applying a given callback function to each element of the array, and then flattening the result by one level
Kind: global function
Example
`js`
const arr = [{ a: [1, 2] }, { a: [3, 4] }, { a: [5, 6] }]
flatMap(el => el.a, arr)
// returns [1, 2, 3, 4, 5, 6]
takes two arguments: a function and either an array or another function. The function applies the input function to every element of the input array or to the result of calling the input function on the input array. Then, the results are concatenated into a new array and returned.
Kind: global function
Example
`js`
chain(n => [n, n], [1, 2, 3])
// returns [1, 1, 2, 2, 3, 3]
const head = list => list[0]
const append = el => list => list.concat(el)
chain(append, head)([1, 2, 3])
// returns [1, 2, 3, 1]
chunks provided array to specified size chunks
Kind: global function
Example
`js`
chunk([1, 2, 3, 4], 2)
// returns [[1, 2], [3, 4]]
determines whether provided value is an array
Kind: global function
Example
`js`
isArray([1, 2])
// returns true
isArray('hello')
// returns false
returns true or false depending if the provided value is an object
Kind: global function
Example
`js`
isObject({ a: 1 })
// returns true
isObject([1, 2])
// returns false
returns an array of the provided object keys
Kind: global function
Example
`js`
keys({ a: 1, b: 2, c: 3 })
// returns ['a', 'b', 'c']
maps values of the provided object
Kind: global function
Example
`js`
mapValues(val => val.toUpperCase(), { a: 'foo', b: 'bar' })
// returns { a: 'FOO', b: 'BAR' }
returns an exact clone of the provided value with a new reference
Kind: global function
Example
`js`
cloneDeep({ a: 1, b: 2 })
// returns { a: 1, b: 2 }
converts provided string to camel case
Kind: global function
Example
`js`
camelCase('hello_world')
// returns 'helloWorld'
removes all nullish and NaN values from the provided object or array
Kind: global function
Example
`js`
compact({ a: 1, b: null })
// returns { a: 1 }
compact(['hello', undefined])
// returns ['hello']
returns a composed value from the provided arguments
Kind: global function
Example
`jsf3(${a})
const f3 = (a: string) => f2(${a})
const f2 = (a: string) => f1(${a})
const f1 = (a: string) => `
compose(f3, f2, f1)('arg')
// returns 'f3(f2(f1(arg)))'
delays the execution of a function until a certain period of time has passed without the function being called again
Kind: global function
Example
`js`
debounce(1000, someFunction)
recurses through an object and transforms its keys – and the keys of any nested objects – based on the provided key mapping function
Kind: global function
Example
`jstest_${key}
deepMapKeys(key => , { a: 1, b: { c: 2 } })`
// returns { test_a: 1, test_b: { test_c: 2 } }
deep merges provided objects by assigning the sources onto the target object passed as the first argument
Kind: global function
Example
`js`
deepMerge({ a: 1, b: { c: 2 } }, { b: { d: 3 } })
// returns { a: 1, b: { c: 2, d: 3 } }
returns true or false depending if the provided value is null or undefined
Kind: global function
Example
`js`
isNil(null)
// returns true
returns a function that invoked with a null or undefined values returns the provided default
Kind: global function
Example
`js`
const defaulter = defaultTo('default')
defaulter('hello')
// returns 'hello'
defaulter(null)
// returns 'default'
returns an array of keys of the object passed as the first argument that are not present, or that are present, but have different values, in object passed as the second argument
Kind: global function
Example
`js`
diffKeys({ a: 1, b: 2, c: 3 }, { c: 3, d: 4 })
// returns ['a', 'b']
drops specific amount of elements of the provided array starting at the beginning
Kind: global function
Example
`js`
drop(2, [1, 2, 3, 4])
// returns [3, 4]
drops specific amount of elements of the provided array starting at the end
Kind: global function
Example
`js`
dropRight(2, [1, 2, 3, 4])
// returns [1, 2]
returns an array if an array was provided, or a new array if provided value was not an array
Kind: global function
Example
`js`
ensureArray([1, 2])
// returns [1, 2]
ensureArray('test')
// returns ['test']
returns an array of entries of the provided object
Kind: global function
Example
`js`
entries({ a: 1, b: 2 })
// returns [['a', 1], ['b', 2]]
returns the first element of the provided array that returns true for the predicate function, or undefined if the element was not found
Kind: global function
Example
`js`
find(el => el === 2, [1, 2, 3])
// returns 2
returns the index of the element of the provided array that returns true for the predicate function, or -1 if the element was not found
Kind: global function
Example
`js`
findIndex(el => el === 2, [1, 2, 3])
// returns 1
findIndex(el => el === 5, [1, 2, 3])
// returns -1
returns the key of the provided object that returns true for the predicate function, or undefined if the key was not found
Kind: global function
Example
`js`
findKey(el => el === 1, { a: 1, b: { c: 2 } })
// returns 'a'
findKey(el => el === 2, { a: 1, b: { c: 2 } })
// returns undefined
returns the last element of the provided array that returns true for the predicate function, or undefined if the element was not found
Kind: global function
Example
`js`
findLast(el => el % 2 === 0, [1, 2, 3, 4])
// returns 4
returns the index of the last element of the provided array that returns true for the predicate function, starting from the specified index element to the begining of the array, or -1 if the element was not found
Kind: global function
Example
`js`
findLastIndexFrom(el => el % 2 === 0, 3, [1, 2, 3, 4, 5, 6])
// returns 3
returns the index of the last element of the provided array that returns true for the predicate function, or -1 if the element was not found
Kind: global function
Example
`js`
findLastIndex(el => el % 2 === 0, [1, 2, 3, 4])
// returns 3
returns an array of requested length filled with provided value
Kind: global function
Example
`js`
filledArray(3, 1)
// returns [1, 1, 1]
returns the provided value
Kind: global function
Example
`js`
identity('hello')
// returns 'hello'
flattens the provided array by one level
Kind: global function
Example
`js`
flatten([1, 2, [3, 4]])
// returns [1, 2, 3, 4]
flatten([1, 2, [3, [4, 5]], 6])
// returns [1, 2, 3, [4, 5], 6]
invokes the provided callback for each of the provided object fields
Kind: global function
Example
`js`
const obj = { a: 1, b: 2, c: 3 }
const arr: string[] = []
forOwn(el => arr.push(el.toString()), obj)
// arr equals ['1', '2', '3']
returns an object constructed from the provided array of key, value pairs'
Kind: global function
Example
`js`
const arr = [
['a', 1],
['b', 2],
['c', 3],
]
fromPairs(arr)
// returns { a: 1, b: 2, c: 3 }
generates a random id
Kind: global function
Example
`js`
generateRandomId()
// returns 'd1rjknhhch8'
generates an unique id based on the provided object keys
Kind: global function
Example
`js`
generateUniqueId({ xuvarw8cao: 1, b837g2nba1d: 2 })
// returns 'd1rjknhhch8'
returns the value from the specififed path from the provided object
Kind: global function
Example
`js`
const obj = { a: { b: [1, 2, 3] } }
get('a.b.1', obj)
// returns 2
get(['a', 'b', '1'], obj)
// returns 2
returns the value from the specififed path from the provided object or the default value if the path element was not found
Kind: global function
Example
`js`
const obj = { a: { b: [1, 2, 3] } }
getOr(null, 'a.b.1', obj)
// returns 2
getOr(null, 'a.c', obj)
// returns null
groups values from the provided array or object based on the result of the provided mapper function
Kind: global function
Example
`js`
const arr = [
{ a: 1, b: 2 },
{ a: 2, b: 4 },
{ a: 3, b: 6 },
]
groupBy(el => (el.a % 2 === 0 ? 'even' : 'odd'), arr)
// returns {
// odd: [
// { a: 1, b: 2 },
// { a: 3, b: 6 },
// ],
// even: [{ a: 2, b: 4 }],
// }
groups values from the provided object based on the result of the provided key mapping function
Kind: global function
Example
`js`
const obj = { a: 1, b: 2, c: 3 }
groupKeys(el => (el === 'a' ? 'aaa' : 'rest'), obj)
// returns {
// aaa: { a: 1 },
// rest: { b: 2, c: 3 },
// }
returns true or false depending if the provided value is present inside the provided array or string
Kind: global function
Example
`js`
includes('a', ['a', 'b', 'c'])
// returns true
includes('d', 'abc')
// returns false
returns true or false depending if the provided value is an empty object or an empty array
Kind: global function
Example
`js`
isEmpty({})
// returns true
returns true or false depending if the provided value is falsy
Kind: global function
Example
`js`
isFalsy(0)
// returns true
returns true or false depending if the provided value is truthy
Kind: global function
Example
`js`
isTruthy(1)
// returns true
returns true or false depending if the provided value is a Promise
Kind: global function
Example
`js`
isPromise(new Promise(res => res(null)))
// returns true
constructs an object from the provided array of objects, grouped by the value of the specified key
Kind: global function
Example
`js`
const arr = [
{ a: 'foo', b: 'bar' },
{ a: 'foo', b: 'baz' },
{ a: 'test', b: 'bab' },
]
keyBy('a', arr)
// returns { foo: { a: 'foo', b: 'baz' }, test: { a: 'test', b: 'bab' } }
returns the last element of the provided array or undefined when array is empty
Kind: global function
Example
`js`
last([1, 2, 3])
// returns 3
maps keys of the provided object
Kind: global function
Example
`js`
mapKeys(key => key.toUpperCase(), { a: 1, b: 2 })
// returns { A: 1, B: 2 }
maps values and keys of the provided object
Kind: global function
Example
`js${key}-${val}
mapValuesIndexed((val, key) => , { a: 1, b: 2 })`
// returns { a: 'a-1', b: 'b-2' }
deep merges the two provided objects
Kind: global function
Example
`js`
merge({ a: 1 }, { b: 2 })
// returns { a: 1, b: 2 }
deep merges all provided objects
Kind: global function
Example
`js`
mergeAll({ a: 1 }, { b: 2 }, { c: 3 })
// returns { a: 1, b: 2, c: 3 }
memoizes the provided function so it returns cached results but based on the provided key resolver
Kind: global function
Example
`js`
const memoizedFunc = memoizeWith(
key => (key === 'a' ? key : 'bar'),
(val: string) => ({ current: val }),
)
memoizedFunc('a') === memoizedFunc('a') // true
memoizedFunc('b') === memoizedFunc('c') // true
memoizes the provided function so it returns cached results when invoked with the same arguments
Kind: global function
Example
`js`
const memoizedFunc = memoize((val: number) => ({ current: val })
memoizedFunc(3) === memoizedFunc(3)
// returns true
memoizes the provided function so it returns cached results but only with one cache key
Kind: global function
Example
`js
const memoizedFunc = memoizeOne((val: number) => ({ current: val })
const resultFor1 = memoizedFunc(1) // { current: 1 }
resultFor1 === memoizedFunc(1) // true
resultFor1 === memoizedFunc(1) // true
const resultFor2 = memoizedFunc(2) // { current: 2 }
resultFor2 === memoizedFunc(2) // true
resultFor1 === memoizedFunc(1) // false
`
does literally nothing
Kind: global function
Example
`js`
somethingAsyncAndDangerous().catch(noop)
returns an array of values of the provided object
Kind: global function
Example
`js`
values({ a: 1, b: 2, c: 3 })
// returns [1, 2, 3]
sorts values of the provided object or array based on the provided mapping function or the provided prop string
Kind: global function
Example
`js`
const obj = {
a: { chats: 1 },
b: { chats: 3 },
c: { chats: 2 },
}
numericSortBy(el => el.chats * -1, obj)
// returns [{ chats: 3 }, { chats: 2 }, { chats: 1 }]
returns an object the same as the provided one but without the fields omitted by the predicate function
Kind: global function
Example
`js`
omitByIndexed((val, key) => key === 'b', { a: 1, b: 2, c: 3 })
// returns { a: 1, c: 3 }
returns the provided object but with specified keys omitted
Kind: global function
Example
`js`
omit(['a'], { a: 1, b: 2 })
// returns { b: 2 }
returns an object same as the provided one but without the fields omitted by the predicate function
Kind: global function
Example
`js`
omitBy(el => el % 2 === 0, { a: 1, b: 2, c: 3 })
// returns { a: 1, c: 3 }
returns a particular function to be executed only a single time
Kind: global function
Example
`js`
const results = [1, 2, 3, 4, 5]
const getResult = once(() => results.pop())
getResult() // 5
getResult() // 5
getResult() // 5
returns a function that called invokes the provided array of functions with the call arguments
Kind: global function
Example
`js`
const func = over([val => val + 1, val => val * 10, Boolean])
func(1)
// returns [2, 10, true]
returns the specified amount of the provided array elements starting from the end
Kind: global function
Example
`js`
takeLast(2, ['a', 'b', 'c', 'd'])
// returns ['c', 'd']
returns a function that called invokes the provided arguments transformers
Kind: global function
Example
`js`
const func = overArgs((a, b, c) => [a, b, c], [n => n * n, Boolean])
func(2, 0, 1)
// returns [4, false, 1]
returns a tuple from the two provided values
Kind: global function
Example
`js`
pair('a', 'b')
// returns ['a', 'b']
returns a tuple of valid and invalid parts of the object as defined in validation function passed in the first argument
Kind: global function
Example
`js`
partitionObject(el => el % 2 === 0, { a: 1, b: 2, c: 3 })
// returns [{ b: 2 }, { a: 1, c: 3 }]
picks specified properties from the object
Kind: global function
Example
`js`
pick(['b'], { a: 1, b: 2 })
// returns { b: 2 }
returns an object same as the provided one but with the fields picked by the predicate function
Kind: global function
Example
`js`
pickBy(el => el % 2 === 0, { a: 1, b: 2, c: 3 })
// returns { b: 2 }
returns an object same as the provided one but with the fields picked by the predicate function
Kind: global function
Example
`js`
pickByIndexed((val, key) => key === 'b', { a: 1, b: 2, c: 3 })
// returns { b: 2 }
picks specified props only if they exist on the provided object
Kind: global function
Example
`js`
pickOwn(['b'], { a: 1, b: 2 })
// returns { b: 2 }
returns a random integer number between the specified min and max values
Kind: global function
Example
`js`
randomInt(0, 10)
// returns 7
returns an array filled with numbers in an ascending order to the provided max value
Kind: global function
Example
`js`
range(5)
// returns [0, 1, 2, 3, 4, 5]
returns an array with elements that return false for the provided predicate function
Kind: global function
Example
`js`
reject(el => el % 2 === 0, [1, 2, 3, 4, 5])
// returns [1, 3, 5]
returns the provided array without the specified index element
Kind: global function
Example
`js`
removeAt(2, [1, 2, 3, 4, 5])
// returns [1, 2, 4, 5]
sets the property of the provided object specified by the provided path in form of a string or an array of keys
Kind: global function
Example
`js`
const obj = { a: 1, b: { c: 2 } }
set('b.d', 3, obj)
// returns { a: 1, b: { c: 2, d: 3 } }
set(['b', 'd'], 3, obj)
// returns { a: 1, b: { c: 2, d: 3 } }
returns true if the provided values are shallow equal
Kind: global function
Example
`js`
shallowEqual({ a: 1 }, { a: 1 })
// returns true
shallowEqual({ a: { b: 1 } }, { a: { b: 1 } })
// returns false
shortens the provided string by the specified amount
Kind: global function
Example
`js`
shortenLongText(5, 'Lorem ipsum dolor')
// returns 'Lorem...'
returns a sign of the provided number or NaN if value different than number was provided
Kind: global function
Example
`js`
sign(10)
// returns 1
sign(-8)
// returns -1
returns an array with the provided array values shuffled
Kind: global function
Example
`js`
shuffle([1, 2, 3, 4])
// returns [4, 1, 3, 2]
returns the diff object from the provided object and slice comparison
Kind: global function
Example
`js`
sliceDiff({ a: 1, b: 10, g: 3 }, { a: 1, b: 2, c: 3 })
// returns { b: 10, g: 3 }
snake cases the provided string
Kind: global function
Example
`js`
snakeCase('helloWorld')
// returns 'hello_world'
returns true if some of the array values is truthy
Kind: global function
Example
`js`
someAreTruthy([0, 1, 2])
// returns true
splits an array or a string at the given index
Kind: global function
Example
`js`
splitAt(2, [1, 2, 3, 4, 5])
// returns [[1, 2], [3, 4, 5]]
splitAt(2, 'foobar')
// returns ['fo', 'obar']
returns a tuple with the provided array splited on an element that returned true for the provided function, iterating from the right side
Kind: global function
Example
`js`
splitRightWhenAccum((el, acc) => [el % 2 === 0, acc], [], [1, 2, 3, 4])
// returns [[1, 2, 3], [4]]
returns a function that called with an array of values calls the provided function with the spreaded arguments from the array arguments
Kind: global function
Example
`js`
const func = spread((a, b, c) => a + b + c)
func([1, 2, 3])
// returns 6
returns a sum of all the provided array number values
Kind: global function
Example
`js`
sum([1, 2, 3])
// returns 6
returns the specified amount of the provided array elements starting from the beginning
Kind: global function
Example
`js`
take(2, ['a', 'b', 'c', 'd'])
// returns ['a', 'b']
takes elements while predicate returns true starting from the right from the specified index
Kind: global function
Example
`js`
takeRightWhileFrom(el => el > 2, 3, [1, 2, 3, 4, 5])
// returns [3, 4]
takes elements while predicate returns true
Kind: global function
Example
`js`
takeRightWhile(el => el > 2, [1, 2, 3, 4, 5])
// returns [3, 4]
ensures that a function is executed at a fixed interval, so that it is not called too frequently
Kind: global function
Example
`js`
const updatePreview = () => { ... }
const throttledUpdatePreview = throttle(updatePreview, 500);
inputField.addEventListener('input', throttledUpdatePreview);
converts values that are iterable to an array
Kind: global function
Example
`js`
toArray('hello')
// returns ['h', 'e', 'l', 'l', 'o']
returns the provided number with specified amount of decimal digits
Kind: global function
Example
`js`
toFixedNumber(1.2345, 2)
// returns 1.23
returns an array of derived from the provided object key-value tuples
Kind: global function
Example
`js`
toPairs({ a: 1, b: 2 })
// returns [['a', 1], ['b', 2]]
ensures that a function is executed at a fixed interval, so that it is not called too frequently
Kind: global function
Example
`js`
const updatePreview = () => { ... }
const throttledUpdatePreview = trailingThrottle(updatePreview, 500);
inputField.addEventListener('input', throttledUpdatePreview);
ensures that a function is executed at a fixed interval, so that it is not called too frequently
Kind: global function
Example
`js`
const updatePreview = () => { ... }
const throttledUpdatePreview = leadingThrottle(updatePreview, 500);
inputField.addEventListener('input', throttledUpdatePreview);
returns 0 for matching strings
return -1 for string with lower char code at some position
return 1 for string with greater char code at some position
Kind: global function
Example
`js`
stringCompare('abc', 'abc')
// returns 0
stringCompare('abc', 'abd')
// returns -1
trims the beginning whitespaces from the provided string
Kind: global function
Example
`js`
trimStart(' hello')
// returns 'hello'
trims the end whitespaces from the provided string
Kind: global function
Example
`js`
trimEnd('hello ')
// returns 'hello'
returns the provided string repeated the specified amount of times
Kind: global function
Example
`js`
repeat(3, 'test')
// returns 'testtesttest'
returns an array with all the duplicates from the provided array removed based on the iteratee function
Kind: global function
Example
`js`
uniqBy(el => el.toString(), [1, '1', 2, '3', 3])
// returns [1, 2, '3']
returns an array with all the duplicates from the provided array removed
Kind: global function
Example
`js`
uniq([1, 1, 2, 3, 3])
// returns [1, 2, 3]
updates the provided array with the provided value on the specified index
Kind: global function
Example
`js`
update(2, 3, [1, 2, 5])
// returns [1, 2, 3]
returns an array without the specified elements from the provided array
Kind: global function
Example
`js`
without([2, 4], [1, 2, 3, 4, 5])
// returns [1, 3, 5]
returns an array of tuples of certain index elements from two provided arrays based on the zipper function
Kind: global function
Example
`js`
zipWith((a, b) => [a * 2, b.toString()], [1, 2, 3], [10, 20, 30])
// returns [[2, '10'], [4, '20'], [6, '30']]
returns an array of tuples of certain index elements from two provided arrays
Kind: global function
Example
`js``
zip([1, 2, 3], [10, 20, 30])
// returns [[1, 10], [2, 20], [3, 30]]