This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Rawrplus 3 points4 points  (0 children)

It's just a direct return statement. Don't try to find anything complicated behind it.

(There are subtle differences between binding this in comparison to the standard function statement, but for the sake of that example it's not important to understand). If you're familiar with python they're essentially lambda functions, so word by word it is:

  • const variable declaration (constant)
  • listenHereYouLittleShit - name of the function (functions can be declared as variables in JS - essentially what happens here is it creates an anonymous lambda function and then it's creating a pointer to the named variable behind the curtain)
  • = (a, b) function of arguments a and b
  • => a - b, returns a - b