We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
生成a-z字母
a-z
new Array(26).fill(97).map((item, index)=>String.fromCharCode(item+index)) // ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"]
去掉数组中值为false的值
false
const arr = [1,0,'',undefined,null]; arr.filter(Boolean); // [1]
数组去重 只针对数字或者字符串
let arr = [1,2,2,3,4,4]; arr = [...new Set(arr)]; // [1,2,3,4]
指定随机数
function selectFrom(lowerValue, upperValue){ var choices = upperValue - lowerValue + 1; return Math.floor(Math.random()*choices + lowerValue); }
比较数组钟的最大值最小值
Math.min.apply(null, array); // min Math.max.apply(nullm array); // max Math.max(...array);
获取全局global对象
var global = function(){ return this }+
The text was updated successfully, but these errors were encountered:
No branches or pull requests
生成
a-z
字母去掉数组中值为
false
的值数组去重 只针对数字或者字符串
指定随机数
比较数组钟的最大值最小值
获取全局global对象
The text was updated successfully, but these errors were encountered: