Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function amazingNumbers(num) {
- num = num.toString();
- let sum = 0;
- for (let i = 0; i < num.length; i++) {
- sum += Number(num[i]);
- }
- let result = sum.toString().includes('9');
- console.log(result? `${num} Amazing? True` : `${num} Amazing? False`);
- }
Advertisement
Add Comment
Please, Sign In to add comment