const str = 'abcdefg'
//在原型上添加一个方法原来是这么写的
String.prototype.foo = function(){
// 这里是一个合并的写法
return this.split('').sort(()=>Math.random() - 0.5).join('')
}
console.log(str.foo())
const str = 'abcdefg'
//在原型上添加一个方法原来是这么写的
String.prototype.foo = function(){
// 这里是一个合并的写法
return this.split('').sort(()=>Math.random() - 0.5).join('')
}
console.log(str.foo())