第一章 基础部分
1. Constants and Variables
1.1 Declaring Constants and Variables ( 声明常量和变量 )
// 声明常量
let maximumNumberOfLoginAttempts = 10
// 声明变量
var currentLoginAttempt = 0
注意事项 :
声明后的常量和变量的读法:
- Declare a new constant called maximumNumberOfLoginAttempts, and give it a value of 10.
- Declare a new variable called currentLoginAttempt, and give it an initial value of 0.
// 声明多个常量写法1 (多行)
let a = 0
let b = 1
let c = 2
// 声明多个常量写法2 (单