Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- three = (num) => {
- let total = 0;
- let numAr = num.toString(10).split('').map(Number)
- numAr.forEach(elem => {
- total += elem
- })
- const set = new Set(numAr).size
- console.log(set === 1 ? true : false)
- console.log(total)
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement