convert the existing function to the new style of ES6.

/* Change your code here */
function magic() {
return new Date();

Hi @reyan !

Welcome to the forum!

In order to assist you, we will need the challenge link and your FULL code.

When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.

You can also use the “preformatted text” tool in the editor (</>) to add backticks around text.

See this post to find the backtick on your keyboard.
Note: Backticks (`) are not single quotes (’).

@reyan, @jwilkins.oboe is right. please go through her reply.
. . .

Converting that function to ES6 means using the Arrow Function syntax.

function magic() {
return new Date();

Can be written in ES6 as


Since the function is returning only the Date, we can remove the body braces and word “return” – the return is implied. As shown in the ES6 version

It is great that you solved the challenge, but instead of posting your full working solution, it is best to stay focused on answering the original poster’s question(s) and help guide them with hints and suggestions to solve their own issues with the challenge.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.