I recieve the correct result in the exercise, but the site does not mark this answer as correct

I have been doing this exercise, and became confused with the code. I have written the code, and recieved the correct answer, but the site did not say my code was correct. When I asked for a solution, i get the code, and logged to the console, I recieved the same result. So, I cannot understand, why my code is not correct? https://www.codecademy.com/paths/web-development/tracks/web-dev-js-arrays-loops-objects/modules/web-dev-intermediate-javascript-practice/lessons/intermediate-javascript-coding-challenge/exercises/decline-accept-everything
This is my code and the result:

%D0%A1%D0%BD%D0%B8%D0%BC%D0%BE%D0%BA

And here is the ‘correct’ code and the same result:

%D1%84

I cannot understand where is my mistake.

If you have a function f, then to use it, you would do:

f()

not

(() => f())()
And definitely not:
((() => () => f())())()

You can wrap things up that way all you want, but it doesn’t gain you anything, so how many times would be the best number of times to wrap it? Once? How about zero?

From the solution I understood, that if we have a function, its better to put it directly, and without wrapping, yes?

Your code is correct but you’ve wrapped the function in a function that calls your function, so yes, use it directly instead.

1 Like

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