1.0.5 • Published 6 years ago

replace-item-in-array v1.0.5

Weekly downloads
5
License
MIT
Repository
-
Last release
6 years ago

About

Replace first of the search element with the replacement other element. This function returns boolean.

ParamTypeDescription
FirstArrayYour array
SecondAnySearched element
ThirdAnyReplaced element

Example:

import replaceItemInArray from 'replace-item-in-array'

const myArray = ["red","black","yellow","white","blue"]
const search = "yellow"
const replace = "green"

const result = replaceItemInArray(myArray, search, replace)
console.log(result)
// true
console.log(myArray)
// ["red","black","green","white","blue"]
1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago