1.0.2 • Published 6 years ago
jsmp-infra-art-test-publish v1.0.2
JSMP INFRA TEST
Description
It is just a package created for test purposes.
Install
Browser
<script src='path/to/jsmp-infra-art-test-publish'></script>
NPM
npm install --save jsmp-infra-art-test-publish
Usage
Require
Function that accepts array and number multiply elements of this array by this number and returns modified array
const { multiplyArray } = require('jsmp-infra-art-test-publish');
multiplyArray([1, 2, 3], 3);
// => [3, 6, 9]
multiplyArray([1, 'a', 2, 'b', 3], 3);
// => [3, 6, 9], all non-numeric elements were removed
multiplyArray([1, 2, 3]);
// => [2, 4, 6], default multiplier is 2
Function that accept string and returns greeting
const { greeting } = require('jsmp-infra-art-test-publish');
greeting('Mike'); // => 'Hello, Mike!'
greeting(); // => 'Hello, Artem!' => 'Artem' is a default value
greeting(123); // => 'Hello, Artem!' => 'Artem' is a default value
ES6 import
Function that accepts array and number multiply elements of this array by this number and returns modified array
import { multiplyArray } from 'jsmp-infra-art-test-publish';
multiplyArray([1, 2, 3], 3);
// => [3, 6, 9]
multiplyArray([1, 'a', 2, 'b', 3], 3);
// => [3, 6, 9], all non-numeric elements were removed
multiplyArray([1, 2, 3]);
// => [2, 4, 6], default multiplier is 2
Function that accept string and returns greeting
import { greeting } from 'jsmp-infra-art-test-publish';
greeting('Mike'); // => 'Hello, Mike!'
greeting(); // => 'Hello, Artem!' => 'Artem' is a default value
greeting(123); // => 'Hello, Artem!' => 'Artem' is a default value