by tjallingt · 8y ago · 0 comments
var currentUrl = function(_) {
return window.location.href;
}
the underscore is used so they don't have to type `() =>` insteadThis was a new syntax added to the language spec to reduce the amount of boilerplate required for common tasks.
Also, the "fat arrow function" handles "this" different inside of the function, so it can serve a slightly different function and in many event-handling cases it can be even more terse than traditional JS functions.