Help.js is a library that contains a few helpful functions.
None
Use npm install jsmp-infrastructure-helpjs
const helpjs = require('jsmp-infrastructure-helpjs');
const arr1 = [1, 2, 3];
const arr2 = [2];
console.log(helpjs.intersect(arr1, arr2)); // [2]
const string = 'abcdef';
const chars = ['a', 'e'];
console.log(helpjs.removeCharacters(string, chars)); // 'bcdf'
-
intersect(array1, array2)
Returns an array of elements that are present in both arguments
Parameters:
-
array1 (array): First array
-
array2 (array): Second array
-
-
removeCharacters(string, characters)
Returns a string without characters in the second argument
Parameters:
-
string (string): String to remove characters from
-
characters (array): Array of characters to remove
-