Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function sum(param) {
- let result = 0;
- for (let i = 0; i < param.length; i += 1) {
- if (typeof param[i] == 'function') {
- result += param[i]();
- }
- if (!Number.isNaN(Number(param[i]))) {
- result += param[i];
- }
- }
- console.log(result);
- }
Advertisement
Add Comment
Please, Sign In to add comment