Don't use => syntax for anonymous functions
One can write an anonymous function like this in Javascript:
$Button.on('click', (event) => {
alert("button clicked');
});
It’s better not to. It just doubles the amount of syntax one can use to solve this problem which increases cognitive load for the team maintaining the code.
It’s better to use this format:
$Button.on('click', function(event) {
alert("button clicked');
});
The second format is more widely understood. Best to use a subset of the features of Javascript.
Same reasoning as why it’s better not to write static C methods and instead use C functions in C++.