作者:mobiledu2502932321 | 来源:互联网 | 2023-06-13 09:19
console.log(Array.prototype.sort)ƒsubstring(){[nativecode]}console.log(String.prototype
console.log(Array.prototype.sort)//ƒ substring() { [native code] }
console.log(String.prototype.substring)
//字符串扩展
String.prototype.addstring = function(){
return this+'字符串扩展'
}
console.log('ff'.addstring())//ff字符串扩展