Use Arrow Functions

Tell us what’s happening:
this is the error message i keep getting,please help me and correct me please
magic() should return correct date.

Your code so far

const magic = () => "date";

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.111 Safari/537.36.

Challenge: Use Arrow Functions to Write Concise Anonymous Functions

Link to the challenge:

Note that "date" is just a string, like “Hello, world!”…
Reset your code, and observe how the function was returning Current Date, and then edit it with arrow function…


Just like @mukeshgurpude pointed out, your function should return what the original function is returning. "date" is not the same as new Date().

1 Like