0
Can someone help me understand toString()?
I've been having problems printing arrays and I need some help. I googled it but didn't find a satisfying explanation (more accurately, I understood almost nothing). Can anybody tell me how to use it and give me an example about it, please?
2 Respostas
+ 2
It's pretty straight forward. It does what its name implies, transforms an object into a string.
Imagine we have this:
var arr = [ 0, 1, 2 ];
console.log(arr.toString());
// output: 0,1,2
give it a try, get familiar with it
+ 1
noname, thank you very much!