Automatic Type Conversion
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 = '5 + null to number = ' + (5 + null) + "<br>"; content += '"5" + null to number = ' + ("5" + null) + "<br>"; content += '"5" + 2 to number = ' + ("5" + 2) + "<br>"; content += '"5" - 2 to number = ' + ("5" - 2) + "<br>"; content += '"5" * "2" to number = ' + ("5" * "2") + "<br>"; document.getElementById("result").innerHTML = content; } </script> </body> </html>
PHÓNG TO