提醒少个括号,不理解missing ( before function parameters.求大神更改.function String.prototype.trim(){return this.replace(/(^\s*)|(\s*$)/g,"");};这是源代码

来源:学生作业帮助网 编辑:作业帮 时间:2024/05/15 17:09:39
提醒少个括号,不理解missing ( before function parameters.求大神更改.function String.prototype.trim(){return this.replace(/(^\s*)|(\s*$)/g,

提醒少个括号,不理解missing ( before function parameters.求大神更改.function String.prototype.trim(){return this.replace(/(^\s*)|(\s*$)/g,"");};这是源代码
提醒少个括号,不理解missing ( before function parameters.求大神更改.
function String.prototype.trim(){
return this.replace(/(^\s*)|(\s*$)/g,"");
};这是源代码

提醒少个括号,不理解missing ( before function parameters.求大神更改.function String.prototype.trim(){return this.replace(/(^\s*)|(\s*$)/g,"");};这是源代码
这是什么编程语言呢?
试试把代码改为:
function String.prototype.trim(){
return this.replace(/(^\s*)|(\s*$)/g,"");
}
//就是说去掉{}后面的分号;