The instanceof Operator
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 language = ["php", "js", "css", "html"]; var content = 'language is a string Object - ' + (language instanceof String) + '<br>'; content = content + 'language is a Array Object - ' + (language instanceof Array) + '<br>'; content = content + 'language is a Number Object - ' + (language instanceof Number) + '<br>'; content = content + 'language is a Object Object - ' + (language instanceof Object) + '<br>'; content = content + 'language is a Date Object - ' + (language instanceof Date) + '<br>'; document.getElementById("result").innerHTML = content; } </script> </body> </html>
PHÓNG TO