|
|
|
|
|
by pekk
4012 days ago
|
|
Just eliminating the words "function" and "return" doesn't make the code clearer. Anyone competent with Javascript can easily read the first form. The difference in time to read the expression may not even be measurable. If you want to argue that it makes the code neater that's fine, but the meaning is not made clearer by the substitution of sigils for words. |
|
And anyone competent with any language implementing map can easily read:
...without having to do any "skimming over" the noise. It's not a big difference, you're right, but it's the kind of little thing that, when you let it build up over time, gives you the "write-everything-in-triplicate" feel of Java 6.Further, you have to be intimately familiar with Javascript to understand why this is necessary:
or even this: as opposed to simply writing: