Log in from a computer to take this course

You'll need to log in from a computer to start Learn JavaScript. But you can practice or keep up your coding streak with the Codecademy Go app. Download the app to get started.

apple storegoogle store
Learn

ES6 introduced arrow function syntax, a shorter way to write functions by using the special “fat arrow” () => notation.

Arrow functions remove the need to type out the keyword function every time you need to create a function. Instead, you first include the parameters inside the ( ) and then add an arrow => that points to the function body surrounded in { } like this:

const rectangleArea = (width, height) => { let area = width * height; return area; };

It’s important to be familiar with the multiple ways of writing functions because you will come across each of these when reading other JavaScript code.

Instructions

1.

Change plantNeedsWater() to use arrow function syntax.

Take this course for free

Mini Info Outline Icon
By signing up for Codecademy, you agree to Codecademy's Terms of Service & Privacy Policy.

Or sign up using:

Already have an account?