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

 

posted @ 2017-03-10 13:02  涵叔  阅读(189)  评论(0)    收藏  举报