分类: JavaScript
2013-12-23 23:40:41
//基本包装类型
//Boolean
//Number
//String
/*
var box='Mr.Lee';
alert(box.substring(2)); //从第三个位置开始截取字符串
//alert(typeof('Mr.Lee'));
*/
/*
var box='Mr.Lee';
box.name='hans';
box.age=function(){
return 100;
}
alert(box);
alert(typeof(box));//
alert(box.name);//
*/
//String
var box='Mr.Lee';
//alert(box.length);
//charAt()
//charCodeAt()
//concat()
//slice()
//alert(box.charAt(1));
//alert(box.charCodeAt(4));//返回ASII码
//alert(box.concat(' is ',' Theacher ' ,'!'));//字符串拼接
//alert(box.slice(4,6));
//alert(box.substring(4,6));
//alert(box.substr(4,6));