|
|
|
|
|
by mewpmewp2
550 days ago
|
|
function areAllTheirHatsGreen(someone) {
return someone.getHats().every(hat => hat.color === 'green')
}
I wonder if there's a language or programming paradigm where this function wouldn't be determined simlarly.I think best you could do is make a validation check that throws an error if there's no hats at all, but would that make sense? What if you have a function that has to return a boolean and not throw an error. |
|
As to paradigms, I've not seen anything yet, but I haven't seen it all, and corporate America has their legacy systems that limit their explorations.