5.0.0 • Published 4 years ago

array-into-string v5.0.0

Weekly downloads
4
License
ISC
Repository
-
Last release
4 years ago

Install

npm i array-into-string

Usage:

The old way:

let arr = ['oh', 'hey', 'there!']
let result;
let firstGo = 0
arr.forEach(item => {
if(firstGo === 0){
firstGo++
result = item.toString()
}else{
result = `${result} ${item}`
})

console.log(result) //Out-puts: 'oh hey there!'

The New way:

const { ArrToStr }= require('array-into-string')

let arr = ['oh', 'hey', 'there!']

console.log(ArrToStr(arr)) //Out-puts: 'oh hey there!'