Ad
Code
Diff
  • const helloWorld = n => `Hello ${n}`
    
    • const helloWorld = n => ('Hello ' + n)
    • const helloWorld = n => `Hello ${n}`

This just looks more readable 🙂

Code
Diff
  • const helloWorld = (name) =>`Hello, ${name}.`
    
    • helloWorld=name=>`Hello, ${name}.`
    • const helloWorld = (name) =>`Hello, ${name}.`
Recursion
Mathematics
Code
Diff
  • function fibonacci(n) {
      return n <= 1 ? n : fibonacci(n - 1) + fibonacci(n - 2)
      
    //     if (n <= 1) return n;
    //     return fibonacci(n - 1) + fibonacci(n - 2);
    }
    • function fibonacci(n) {
    • if (n <= 1) return n;
    • return fibonacci(n - 1) + fibonacci(n - 2);
    • return n <= 1 ? n : fibonacci(n - 1) + fibonacci(n - 2)
    • // if (n <= 1) return n;
    • // return fibonacci(n - 1) + fibonacci(n - 2);
    • }