But it turns out that this works in JavaScript indeed :D
Just check the code:
Boolean.prototype.ifTrue = function(p) { this.valueOf() && p() }
(1 < 2).ifTrue(() => console.log('hello')) // logs hello
(3 < 2).ifTrue(() => console.log('bye')) // does nothing
I never thought that it could work :) But it does! Thanks!
And thanks for spreading the love for Smalltalk, I do really believe that it is one of the languages that more have contributed to the advance of the software engineering itself.
I wrote my own story like you showing the greatness of smalltalk (some from different points of view, all valid). And, if you don’t mind, I’ll link yours back.
Thanks for sharing!