Advertisement
Guest User

Untitled

a guest
Sep 21st, 2019
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.25 KB | None | 0 0
  1. three = (num) => {
  2. let total = 0;
  3. let numAr = num.toString(10).split('').map(Number)
  4. numAr.forEach(elem => {
  5. total += elem
  6. })
  7. const set = new Set(numAr).size
  8. console.log(set === 1 ? true : false)
  9. console.log(total)
  10. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement