中等ES6
0 1

ES6新增了哪些字符串处理函数?

【概念释义】

ES6 增强 String:模板字符串includes/startsWith/endsWith 语义化查找、repeat 重复、padStart/padEnd 填充、以及 Unicode 感知codePointAtString.fromCodePoint、正则 u 修饰符配套方法。

减少对传统 indexOf、手动 pad 的依赖,代码意图更清晰。

【基础使用】

javascript
const s = 'hello-world';

s.includes('world');     "qb-hl-comment">// true
s.

登录查看完整 1378

回答讨论

暂无讨论,登录后可抢先发言

本题库更多题目(14)