- 創(chuàng)建直接的實(shí)例
silen=new Object();
silen.firstname="YoungLee";
silen.age=18;
替代語(yǔ)法
silen{firstname="YoungLee" , age=18};
- 對(duì)象構(gòu)造器
function silen(firstname,age){
this.firstname=firstname;
this.age=age;
}
RegExp
是正則表達(dá)式(regular expression)的簡(jiǎn)寫(xiě);
var x = 'What rough beast , it's hour come around at last.';
var y = /hOur/i;
document.write(x.match(y));
- test()方法搜索字符串指定的值,根據(jù)結(jié)果并返回真或假杜窄。