- 创建直接的实例
silen=new Object();
silen.firstname="YoungLee";
silen.age=18;
替代语法
silen{firstname="YoungLee" , age=18};
- 对象构造器
function silen(firstname,age){
this.firstname=firstname;
this.age=age;
}
RegExp
是正则表达式(regular expression)的简写;
var x = 'What rough beast , it's hour come around at last.';
var y = /hOur/i;
document.write(x.match(y));
- test()方法搜索字符串指定的值,根据结果并返回真或假。