I changed 'javascript' in 'js'
This commit is contained in:
Christian Bender
2017-12-14 13:48:57 +01:00
committed by GitHub
parent f92c6d4079
commit e44fef2a2a

View File

@ -3,7 +3,7 @@
If n even then returns **n/2** otherwise (n is odd) **3n+1**. If n even then returns **n/2** otherwise (n is odd) **3n+1**.
It uses the ternary operator. It uses the ternary operator.
``` javascript ``` js
const collatz = n => (n % 2 == 0) ? (n/2) : (3*n+1); const collatz = n => (n % 2 == 0) ? (n/2) : (3*n+1);
// collatz(8) --> 4 // collatz(8) --> 4
// collatz(5) --> 16 // collatz(5) --> 16