JS 奇技淫巧集合(持续更新)

210 阅读1分钟

1.判断集合中是否有符合条件的

` /['cash','contract', 'img']$/.test('img')  // 存在返回 true `

2.获取数字二进制第 bit 位的值

`(num >> (bit -1)) & 1`