5. String 方法 和 Number 方法
1. String 方法
let theString = 'hello, my name is han and i love coding ';
theString.startWith('hello'); // true theString 从 hello 开始
theString.endWith('code'); // false theString 在 coding结束
theString.includes('name'); // true theString 包含 name
2. Number 方法
a. Number.isFinite(); 检测数值是否是有限的
Number.isFinite(5);// true
b.Number.isNaN(); 检测数值是否为NaN
Number.isNaN(15) // false

浙公网安备 33010602011771号