執行 ❯
建立您
自己的
網站
×
改變方向
儲存程式碼
改變主題,深色/淺色
前往 Spaces
<!DOCTYPE html> <html> <body> <h1>JavaScript Global Methods</h1> <h2>The String() Method</h2> <p>String() converts a value to a string:</p> <p id="demo"></p> <script> document.getElementById("demo").innerHTML = String(Boolean(0)) + "<br>" + String(Boolean(1)) + "<br>" + String([1,2,3,4]); </script> </body> </html>