jsmp-infrastucture-garbage-bag
v1.0.4
Published
This package can perform some operations on strings and arrays:
Downloads
2
Readme
This package can perform some operations on strings and arrays:
findElementIndex
takes an array and a predicate function and return the index of the first array element for which the function returns true
const array = ['max', 'ksysha', 'john'];
const isKsysha = person => person === 'ksysha';
findIndex(array, isKsysha) // -> 1
reverseString
takes a string and returns a reversed string
const name = 'ksy';
const reversedName = reverseString(name);
reversedName // -> 'ysk'