@sadiqevani Arrow functions should be enough obvious because they were introduced in ES6 four years ago. object-shorthand rule of Airbnb configs (that you have chosen in #160) rejects code like:
const t = {
validator: function() {
// ...
}
}
at least should be used:
const t = {
validator() {
// ...
}
}
but arrow functions, in this case, is better because it is shorter:
no need to write return
curly brackets are not necessary
simple validators can be written in a single line
Also, functions starting with () => without curly brackets are easier to read, because:
@sadiqevani Arrow functions should be enough obvious because they were introduced in ES6 four years ago.
object-shorthand
rule of Airbnb configs (that you have chosen in #160) rejects code like:at least should be used:
but arrow functions, in this case, is better because it is shorter:
return
Also, functions starting with
() =>
without curly brackets are easier to read, because:this