1.0.1 • Published 6 years ago

replace-array-items v1.0.1

Weekly downloads
6
License
MIT
Repository
github
Last release
6 years ago

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.