Following are code with output
var myArray = ["one", "two","three", "four"];
var arr = [myArray];
console.log(arr); //ouput - [Array[4]]
window.document.write(arr); //ouput - one,two,three,four
Why both line gives different output? Thanks in advance.