摘要: const str = '你好,世界!'; const length = Array.from(str).reduce((acc, cur) => acc + (cur.charCodeAt(0) > 255 ? 2 : 1), 0); console.log(length); // Output: 阅读全文
posted @ 2023-03-23 14:30 微风吹过~ 阅读(31) 评论(0) 推荐(0) 编辑