brk brk - 11 months ago 104
Javascript Question

Why document.write not writing in array format?

I am trying to write a nested array using

document.write
but it is writing only
4
instead of
[[4]]
. What can be the reason for this?



document.write([[4]])




wow wow
Answer Source

According to this article

A string containing the text to be written to the document.

It converts the response of write function into String

and String of [[4]] is 4

console.log(String([[4]]));

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download