jsmp-infra-miracle
v1.2.1
Published
Miracle package for updating your strings and arrays
Downloads
2
Maintainers
Readme
jsmp-infra-miracle
Install
npm install --save jsmp-infra-miracle
Using and examples
To use code, import index.js file to your code and you can use to function updateString and updateArray from that.
updateString
takes a string and number as an argument and returns a modified string where the first symbol is in Uppercase and quantity of repeated letters equals entered number ;
For example:
Next function call will be return 'Hhhhh-Eeeee-Lllll-Lllll-Ooooo- -Wwwww-Ooooo-Rrrrr-Lllll-Ddddd'
;
updateString('Hello World', 5)
updateArray
takes two arrays as an arguments (array and number) and filters the values that are divisible without residue on entered number.
For example:
Next function call will be return [ 12, 45, 12, 42, 12 ]
;
updateArray([4, 12, 45, 34, 12, 42, 12, 5], 3);