The Compact Adder

Easy+15 XP

Mission Briefing

The micro-controller has extremely limited memory. You must write an addition algorithm using the absolute minimum amount of code possible.

The Concept: Implicit Returns

One of the most powerful features of Arrow Functions is the "implicit return". If your function is just one line of logic, you can omit the curly braces {} and the return keyword entirely! Example: const multiply = (x, y) => x * y;

The Objective

  1. Write an arrow function called add that takes two parameters, a and b.
  2. Use the implicit return syntax (no curly braces, no return keyword) to return their sum.

Constraints

    FundamentalsES6+
    JavaScript
    Loading...
    3 Hidden

    Input Arguments

    a10
    b20

    Expected Output

    30

    Click RUN to test your solution