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