array-into-string

Making an array into a string.

Usage no npm install needed!

<script type="module">
  import arrayIntoString from 'https://cdn.skypack.dev/array-into-string';
</script>

README

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!'