ThinkingLink 2020-04-26
alert(‘Hello, world!‘);
<script> alert(‘Hello, world!‘); </script>
<script src="../js/HelloWorld.js"></script>
// 单行注释 /* 多行注释 */
var num = 1; var money = 10.0; var name = "yuehun";
if () { } else if () { } else { }
‘use strict‘; for (let i = 0; i < 3; i++) { console.log(i); } let i = 0; while (i < 3) { console.log(i); i++; } i = 0; do { console.log(i); i++; } while (i < 3); let arr = [0, 1, 2]; for (let num in arr) { console.log(arr[num]); } for (let num of arr) { console.log(num); }
‘use strict‘; // 必须写在第一行