1.1.6 • Published 5 years ago

jsmp-infrastructure-helpjs v1.1.6

Weekly downloads
-
License
ISC
Repository
-
Last release
5 years ago

help.js

Help.js is a library that contains a few helpful functions.

Dependencies

None

Installation

Use npm install jsmp-infrastructure-helpjs

Usage

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'

  

API

  • 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
1.1.6

5 years ago

1.1.5

5 years ago

1.1.4

5 years ago

1.1.3

5 years ago

1.1.1

5 years ago

1.1.0

5 years ago

1.0.0

5 years ago