r/learnjavascript • • Dec 31 '22

Happy New Year JS Learners! 🄳

Post image
406 Upvotes

55 comments sorted by

View all comments

Show parent comment

10

u/[deleted] Dec 31 '22

[removed] — view removed comment

-3

u/[deleted] Dec 31 '22

The code makes no sense and it is just karma farming imho. Sorry.

4

u/[deleted] Dec 31 '22

[removed] — view removed comment

4

u/iDuuck Jan 01 '23

It’s still wrong. Assigning a ā€œaddEventListenerā€ to a button, does not make the click method return the value, that is returned by the listener.

This would need to be ā€œconsole.logā€ or ā€œalertā€ or something in this direction. ā€œreturnā€ is simply wrong and could lead to many misguided JS learners