Dsa basic doubt

let arr1 = [‘This’,‘is’,‘so’,‘awesome’]
let result2 = arr1.join(’ ‘) // giving space as a seprator
let result3 = arr1.join(’-') // giving - as a seprator

console.log(result2)
console.log(result3)

outputs:
result3=[this-is-so-awesome];
result2=[this is so awesome];

1 Like

the o/p will be :
for result3= [ this is so awesome];
for result3=[ this-is-so-awesome];