Run Code
|
API
|
Code Wall
|
Users
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Blog
Count digits
//nodejs v4.2.6 function count_digits(number) { number = "" + number; var obj = {}; for(var digit of number) { if(obj[digit]) obj[digit] += 1; else obj[digit] = 1; } return obj; } var n = 14576560723341337089; console.log(count_digits(n));
run
|
edit
|
history
|
help
0
Please
log in
to post a comment.
neural spam network
demo.js
example for node promises
Funny stuff
find all prime factors of a number
fast function to reverse unsigned integer
Sort based on keys
Compare 2 arrays and fill 1 or 2
Tree Structure
localhost:8080/?name=2017&lname=July
stackse - search stackoverflow differently
Please log in to post a comment.