Skip to content

Instantly share code, notes, and snippets.

@Alfxjx
Last active March 22, 2021 08:13
Show Gist options
  • Save Alfxjx/5ebfb50330e1d935dcdaf67d3b6bd5ab to your computer and use it in GitHub Desktop.
Save Alfxjx/5ebfb50330e1d935dcdaf67d3b6bd5ab to your computer and use it in GitHub Desktop.
// 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