Why is this NOT considered an anonymous function?

I was wondering why the arrow function:

(() => {
  console.log("A cozy nest is ready");

Is determined as a non anonymous function when i submit, I obviously have amended it to satisfy the examination bot but I am sure the above is no different to the following other than it using less characters and the ES6 arrow functions:

(function() {
  console.log("A cozy nest is ready");

Just wondering as I am certain that the arrow function I posted is also anonymous.


Link to the challenge:

Look like there are so much problems on the currrent challenges because FCC team are working on new curriculum.

Many weird challenges, many new knowledge you only know if you stuck on the challenge and click on the hint button. In the hint section, they say a ton of new things they never show us before.

So in my stupid experience, let finished the challenge ( feel free to click on hint button, dont blame yourself ) and move on next question,

And study more outsite if you feel something not right,

Thanks, I didn’t realise they were working on a new curriculum, I will keep an eye out!

I have noticed it quite a few times and just changed my code to suit the examination bot. It is a great course.

To be honest, I am already very well versed in JS etc I just have been self taught the whole time and the problem I have noticed on a regular basis is blind spots.

As I only research what I need, when I need it, some basic features of the language take me ages to solve as I never learnt them in the first place. A formal education would have instilled the basics from the start.

So I thought a good way to fill my blind spots and refresh my knowledge would be to take the course.

I won’t lie, I am really happy I did. This is been amazing and I have learnt more than I could ever imagine.

1 Like

Take a look on here ; Help us build Version 7.0 of the freeCodeCamp curriculum

Happy Coding !

1 Like

Thank you mate! I will definitely keep an eye on it!

It has been fixed on master (PR) the site just needs to be updated.

1 Like

If you are learning something about IIFE, I think it’s not worth to worry about a function is anonymous or not, because the core of IIFE is just immediately invoke the function and this part is done by the later parentheses pair in the expression. and the former parentheses pair just used to compute the callee, so below expressions also work

(function f() { console.log('a') })();
(f = () => console.log('a'))();

back to your question, yes you did, the word anonymous implies if you don’t use the anonymous function once they’re created you cannot use it later, so every function you create satisfy this situation is anonymous.