Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const process = (value) => value;
- const value = Math.random();
- const do1 = (x) => {
- return new Array(x).fill(null).reduce(process, value);
- }
- const do2 = (x) => {
- let updatedValue = value;
- for (let i = x; i > 0; i--) {
- updatedValue = process(updatedValue);
- }
- return updatedValue;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement