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
- Write an arrow function called
addthat takes two parameters,aandb. - Use the implicit return syntax (no curly braces, no return keyword) to return their sum.
Constraints
FundamentalsES6+
JavaScriptSystem handles I/O — write your function only
Loading...
3 Hidden
Input Arguments
a10
b20
Expected Output
30
Click RUN to test your solution