jsmp-infrastructure-helpjs

1.1.6 • Public • Published

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

Readme

Keywords

Package Sidebar

Install

npm i jsmp-infrastructure-helpjs

Weekly Downloads

7

Version

1.1.6

License

ISC

Unpacked Size

6.84 kB

Total Files

12

Last publish

Collaborators

  • denysbohdan