Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
Hmmph. Stylistically, it reminds me of a lot of Java code I've seen. Getter functions for every property!
-
I wrote a quick unit test for that:
expect(getTrue()).to.equal(true);
Thank me later. -
That's valid and useful when you're using higher-order functions. E.g. You're passing in a function that's expected to return a bool, but you want to always return true.
-
It implies that there might be some optimisation possible, but it's certainly not mad or wrong.
Related Rants

What only relying on JavaScript for HTML form input validation looks like
Found something true as 1 == 1
function getTrue() {
return true;
}
Wut? You serious?
undefined
javascript
js