示例<!doctype html><html> <body> <script> var val1 = 10; if (val1 == 15) { document.write("prints due to misplaced semi-colon: "+val1); } var val2 = 10; if (val2 == 15) { // this won't get printed document.write(val2); } </script> </body></html>
以上就是如果在javascript中分号放错位置会发生什么?的详细内容。