Skip to content

Repository files navigation

@frosted/array-at

Ponyfill for Array.prototype.concat

Installation

npm install @frosted/array-concat

Usage

constconcat=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