const getSelectedText = () => window.getSelection().toString()
getSelectedText()
3. 打乱一个数组
打乱一个数组?...Math.random() - 0.5)
shuffleArray([ 1, 2,3,4, -1, 0 ]) // [3, 1, 0, 2, 4, -1]
4.将rgba转换为十六进制
我们可以将rgba和十六进制颜色值互相转换...=> [...new Set(arr)]
uniqueArray([ 1, 1, 2, 3, 4, 5, -1, 0 ]) // [1, 2, 3, 4, 5, -1, 0]
9.检查一个对象是否为空对象...const isAppleDevice = () => /Mac|iPod|iPhone|iPad/.test(navigator.platform)
isAppleDevice()
21.随机布尔值