The constructor Property
RUN
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> </head> <body> <h1>Học lập trình miễn phí tại freetuts.net</h1> <p id="result"></p> <button onclick="myFunction()">Run</button> <script> function myFunction() { var content = '"Freetut" - ' + "Freetut".constructor + "<br>"; content += "3.14 - " + 3.14.constructor + "<br>"; content += "NaN - " + NaN.constructor + "<br>"; content += "false - " + false.constructor + "<br>"; content += "[1,2,3,4] - " + [1,2,3,4].constructor + "<br>"; content += "{name:'John', age:34} - " + {name:'John', age:34}.constructor + "<br>"; content += "Date() - " + (new Date()).constructor + "<br>"; content += "function () {} - " + (function () {}).constructor + "<br>"; document.getElementById("result").innerHTML = content; } </script> </body> </html>
PHÓNG TO