![](https://img-blog.csdnimg.cn/20201014180756926.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
javascript
whitehack
这个作者很懒,什么都没留下…
展开
-
javascript 简单检查数组是否有重复值(nodejs )
TS 版// 有重复返回trueexport function checkDuplicationNormal<T>(arr: T[]) { return arr.some((val, idx) => { return arr.includes(val, idx + 1); });}js 版function checkDu...原创 2018-08-02 10:10:11 · 2002 阅读 · 0 评论 -
nodejs和js里的gbk与utf8编码转换
js 与 nodejs 都有 TextEncoder TextDecoder ,可以进行编码之间的转换nodejs 版本需要 >=8.3.0 才支持 util.TextEncoder,util.TextDecoder gbk 转 utf8new TextDecoder('gbk').decode(new Uint8Array([ 47, 63, 214, 208, 20...原创 2019-06-24 11:27:23 · 17519 阅读 · 0 评论