Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Learn Challenge: Adding a Comment | Getting Started
Introduction to JavaScript

Swipe to show menu

book
Challenge: Adding a Comment

Task

Swipe to start coding

The code from the previous task is given.

In this case we used a mathematical formula inside the statement to calculate the area of a Trapezium. However, looking at the expression, the structure of the formula is not very obvious at first glance. In situations like these it is useful to add a comment so that other people reading the code can know what's going on, or even ourselves in case we revisit this code sometime later.

Add a single-line comment before the console.log statement, containing the following text:

Solution

Switch to desktopSwitch to desktop for real-world practiceContinue from where you are using one of the options below
Everything was clear?

How can we improve it?

Thanks for your feedback!

SectionΒ 1. ChapterΒ 11
single

single

Ask AI

expand

Ask AI

ChatGPT

Ask anything or try one of the suggested questions to begin our chat

close

Awesome!

Completion rate improved to 1.33

book
Challenge: Adding a Comment

Task

Swipe to start coding

The code from the previous task is given.

In this case we used a mathematical formula inside the statement to calculate the area of a Trapezium. However, looking at the expression, the structure of the formula is not very obvious at first glance. In situations like these it is useful to add a comment so that other people reading the code can know what's going on, or even ourselves in case we revisit this code sometime later.

Add a single-line comment before the console.log statement, containing the following text:

Solution

Switch to desktopSwitch to desktop for real-world practiceContinue from where you are using one of the options below
Everything was clear?

How can we improve it?

Thanks for your feedback!

close

Awesome!

Completion rate improved to 1.33

Swipe to show menu

some-alt