Use-arrow-functions-to-write-concise-anonymous-functions

Use-arrow-functions-to-write-concise-anonymous-functions
0

#1

Tell us what’s happening:
This code is executing successfully with and without semicolon at the end. But how is this possible .??? any idea

Your code so far



const magic = () =>{
  "use strict";
  return  new Date();
};

OR
const magic = () =>{
  "use strict";
  return  new Date();
}

Link to the challenge:


#2

Semicolons are often not strictly required by JavaScript (unlike other languages).


#3

If we didn’t use a semi colon, FCC compiler is showing an error :x: , but still when we press ctrl+enter, the code is executing, which is so funny…


#4

The linter is telling you that you should use a semicolon.