concat-elements

1.0.2 • Public • Published

Description

concat-elements is an alternative to concat elements in one array.

you can concat strings, number, boolean, arrays and objects similary to default method concat of ECMA 262

Installation

npm

npm install concat-elements

Sample

const concatElements = require("concat-elements");

let food = ["🍔", "🍕", "🍖", "🍗"];
let animals = ["🐜", "🐅", "🐆", "🦙"];

const array = concatElements(1, "s", food, animals, { name: "test" });

//output:  [ 1, 's', '🍔', '🍕', '🍖', '🍗','🐜','🐅','🐆','🦙', { name: 'test' }]


Syntax

concatElements(element1[, element2[, ...[, elementN]]]);

Performance

concat-elements vs concat ecma

sample of time in 1000 iterations

concat-elements:

Example with concat-elements.

concat:

Example with concat.

Keywords

Package Sidebar

Install

npm i concat-elements

Weekly Downloads

5

Version

1.0.2

License

ISC

Unpacked Size

3.17 kB

Total Files

4

Last publish

Collaborators

  • iddge7