Skip to content

Richienb/replace-array-items

Repository files navigation

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.

About

Replace all items in an array with the same value.

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published