:javascript:
Decorators:
Why is there so much fuss about #decorators (typescript) when #HigherOrderFunctions can do the same thing & have been available in #javaScript forever.
Being a functional or object based language the natural fit is HOF not Decorators.
If you want to simulate OOP in #js & use the elusion that inheritance is good for js code base then be my guest & use decorators. 😀
#decorators #higherorderfunctions #javascript #js
Or use a simple shortcut:
http://str.map &:to_i
You can find more details in Ary's post.
It has obvious advantages in comparison to the Ruby version.
RT @ArityWolf@twitter.com
Map
http://str.map{|string| http://string.to_i}
Convert an array of strings to integers in Ruby; more useful in Crystal
#crystallang #rubylang #crystal #ruby #higherorderfunctions #coding #programming
🐦🔗: https://twitter.com/ArityWolf/status/1340349568865587206
#crystal #ruby #higherorderfunctions #coding #programming #crystallang #rubylang