DEV Community

loading...

Discussion on: Interview Qs Decoded - # 2

Collapse
developmentvargamarcel profile image
development-vargamarcel

A string is an array by default so you also could unshift all elements in an empty array and then join. Right?

Collapse
cat profile image
Cat Author

I thought a string was a string by default. If you unshift() a string, would that throw an error?

I’m not by a computer right now to try it out lol