Skip to main content
JavaScript Code Completion Easy +10 XP

Arrow Function

Complete the arrow function that doubles a number.

JavaScriptFill in the blank
const double = (n) ___ n * 2;

Type the missing code

Show answer and explanation

Answer: =>

Arrow functions use => to separate parameters from the body. With a single expression, no braces or return needed.

Hint: Arrow functions use a special operator.

What this challenge tests

Code Completion in JavaScript: arrow-functions, basics.

Related challenges