Last active
March 22, 2021 08:13
-
-
Save Alfxjx/5ebfb50330e1d935dcdaf67d3b6bd5ab to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 190-210元 发票计算 | |
((count)=>{ | |
let arr = []; | |
for(let i=0;i<count;i++){ | |
arr.push( | |
Number((Math.random()*20).toFixed(0))+190, | |
); | |
} | |
console.log(arr); | |
let sum = arr.reduce((acc,curr)=>{return acc+curr},0) | |
console.log(sum); | |
})(14); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment