Could someone please explain how exactly '=>' works in JavaScript? I know it is shorthand for an anonymous function, but don't quite understand what it does technically
@keezee the MDN docs are pretty good on this! https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/Arrow_functions
@Eramdam RTFM fucking MDN...haha I'm an idiot. So it seems like it really just saves you the hassle of physically writing 'function' and 'return' when dealing with anonymous functions. Correct? Just trying to talk it out to see if I grasp the basic concept of it
@keezee Yes. But it has some side-effects that you have to be aware of, like the `this` not being bound to the function. But yea in 99% it's a nicer/faster way of writing anonymous functions :p
@Eramdam is this new to JS? I feel it's becoming more and more frequently used in code I read
@keezee Yes. It was added in ES6/ES2015 so it's only supported in modern browsers (read: not IE at all) https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/Arrow_functions#Browser_compatibility
@keezee haha. To be fair IE11 is going to be unsupported very soon (or is it already? I don't remember) so you should be fine :p