This package has been deprecated

Author message:

Use Array#fill instead.

replace-array-items
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

Replace array items Travis CI Build Status

Replace all items in an array with the same value.

NPM Badge

Install

npm install replace-array-items

Usage

const replaceArrayItems = require("replace-array-items");

replaceArrayItems([1, "a", null], "Hello");
//=> ["Hello", "Hello", "Hello"]

API

replaceArrayItems(array, value)

array

Type: array

The array to modify.

value

Type: any

The value to set all the items to.

Readme

Keywords

Package Sidebar

Install

npm i replace-array-items

Weekly Downloads

2

Version

1.0.1

License

MIT

Unpacked Size

3.1 kB

Total Files

6

Last publish

Collaborators

  • richienb