The ES6 Arrow Hub

Easy+25 XP

Mission Briefing

The Guild's sorcerers have adopted a faster, sleeker way of casting spells. You must upgrade your function syntax to meet the modern standard to determine if a number is even.

The Concept: Arrow Functions

Modern JavaScript introduced a shorter way to write functions called Arrow Functions. They use the => syntax and are the standard for professional development today. Example: const add = (a, b) => a + b; (This is an implicit return!)

The Objective

Your mission is to write an arrow function called checkEven that receives a number num.

  1. Use arrow function syntax (() => {}).
  2. Use the modulo operator (%) to check if the number is perfectly divisible by 2.
  3. Return true if the number is even, and false if it is odd.

01EXAMPLE 1

Inputnum = 10
Outputtrue

02EXAMPLE 2

Inputnum = 7
Outputfalse

Constraints

  • Use arrow function syntax.
FundamentalsES6+Functions
JavaScript
Loading...
3 Hidden

Input Arguments

num10

Expected Output

true

Click RUN to test your solution