我想在 Quasar 框架中添加自定义属性,但是当我设置它时,ESlint 向我显示了这个错误: Array prototype is read only, properties should not be added
我想为数组添加一个扩展方法:
Array.prototype.extend = function (other_array) {
/* You should include a test to check whether other_array really is an array */
other_array.forEach(function(v) {this.push(v)}, this)
}
呼如林
相关分类