r/node • • Apr 14 '24

JavaScript Functions - 4 Ways

Post image
208 Upvotes

79 comments sorted by

View all comments

38

u/damnNamesAreTaken Apr 14 '24

As someone who doesn't really use JavaScript much, what was wrong with the function declaration form and why are the rest needed? I learned JS before the newer ways existed and never really kept up.

82

u/travybongos69 Apr 14 '24

Arrow functions don't have their own this which can be useful at times

2

u/Think_Discipline_90 Apr 15 '24

"At times" try 99% of cases.

The only times I use oldschool function declaration is if I want typed overloads

3

u/[deleted] Apr 15 '24 edited Apr 14 '26

Data Brokers don't stand a chance because I mass delete all of my content using Redact - No AI training on my data, thank you very much.

cooing punch encouraging fuzzy longing squash bright fact thought lock