DekGenius.com
Home
(current)
Dictionary
BOOKS
LYRICS
CHORD
SCRIPT & CODE EXAMPLE
Karaoke language
Search
Go
SCRIPT & CODE EXAMPLE
CODE EXAMPLE FOR JAVASCRIPT
javascript gcd
const
gcd
=
(
a
,
b
)
=>
b
===
0
?
a
:
gcd
(
b
,
a
%
b
)
;
// Example
gcd
(
10
,
15
)
;
// 5
PREVIOUS
NEXT
Tagged:
#javascript
#gcd
ADD COMMENT
Topic
COMMENT
Name
9+9 =
Submit