I have an array
var arr = [1,2,3,4,5,6,7,8,9,10];
How to display all items of the array using an alert box?
I have tried : alert(arr); and it shows nothing.
Edit: I want display this array like php print_r function.
output needed like: array["key" => "value", "key" => "value", ...];
alert(JSON.stringify(arr))oralert(arr.join(" "))console.log()hasn't been suggested from the very beginning.