DEV Community

Discussion on: Functions as First-Class Citizens in Javascript

Collapse
 
jonrandy profile image
Jon Randy 🎖️ • Edited

The function we used here in the above example is an anonymous function.

In actual fact, the function in the example is not anonymous. The act of assigning it to a variable or constant on creation results in it taking that as it's name. Try displaying a.name after the assignment - the function has the name 'a'.

Collapse
 
rakshit profile image
Rakshit

Thanks :)