一、填空题
1. false
2. constructor
二、判断题
1. 错。
2. 错。
3. 对。
三、选择题
1. B
2. C
3. D
四、编程题
1.
<script>
String.prototype.trim = function() {
return this.replace(/(^\s*)|(\s*$)/g, '');
};
String.prototype.ltrim = function() {
return this.replace(/(^\s*)/g, '');
};
String.prototype.rtrim = function() {
return this.replace(/(\s*$)/g, '');
};
</script>
2
Object.prototype.create = function(obj) {
if (Object.prototype.create) {
return Object.prototype.create;
}
function F() {}
F.prototype = obj;
return new F();
};