Skip to content

frosted-javascript/array-concat

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

@frosted/array-at

Ponyfill for Array.prototype.concat

Installation

npm install @frosted/array-concat

Usage

const concat = require("@frosted/array-concat")

console.log(concat([1, 2], [3])) // [1, 2, 3]
console.log(concat()) // []
console.log(concat([1])) // [1]
console.log(concat("not an array")) // Error: concat expects all arguments to be arrays

Shimming Array.prototype.at:

require("@frosted/array-concat/shim")

console.log([1, 2, 3].concat([4, 5, 6])) // [1, 2, 3, 4, 5, 6]

Tests

Simply clone the repo and run npm test

About

concat arrays together

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published