Skip to content

iDDGE7/concat-elements

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

method for concat elements

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published