Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
find all prime factors of a number
//nodejs v4.2.6 const primeFactors = (number) => { var factors = [], divisor = 2; while(number > 2) { if(number % divisor == 0) { factors.push(divisor); number = number/divisor; } else{ divisor++; } } return factors; } console.log(primeFactors(80))
run
|
edit
|
history
|
help
0
Add property to object
horsevalue
Lowertoupper
Add items on Set
AVL-GO-FLAT
JS - check 2 arrays, add 1 or 2, logical operations
Holyboi
apply
Funny stuff
Rest Params