es6-1204

转自:https://www.jianshu.com/p/550280d0ff57

repeat

'x'.repeat(3) // "xxx"
// 参数传入角标,返回值为角标对应的字符
'abc'.at(0) // 'a'
'吉'.at(0)  // '吉'
// 与ES5中charAt()不同之处,汉字的话ES5会返回对应Unicode编码,js内部用UTF-16

猜你喜欢

转载自blog.csdn.net/weixin_42153372/article/details/84786308
ES6