Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
GCD
//Title of this code //V8 3.31.1 function gcd(a,b) { var greatest_divisor = 1; var divisor = 2; if (a<2 || b<2) print(greatest_divisor); else if (a<0 || b<0) print("error"); else { while (a>=divisor && b>=divisor) { if (a%divisor==0 && b%divisor==0) { greatest_divisor = divisor; } divisor++; } print(greatest_divisor); } } gcd(33,55);
run
|
edit
|
history
|
help
0
Javascript reverse string, one index
JS Testing
BinaryGap, javascript - Find longest sequence of zeros in binary representation of an integer.
rotateMatrix
ArraY_ROW addition
ComposeWordsGrid
game green
linq-style in javascript
class Stack
Leaning Java Script