nosh :fosstodon: · @nosherwan
321 followers · 1417 posts · Server fosstodon.org

:javascript:
Decorators:
Why is there so much fuss about (typescript) when can do the same thing & have been available in forever.

Being a functional or object based language the natural fit is HOF not Decorators.

If you want to simulate OOP in & use the elusion that inheritance is good for js code base then be my guest & use decorators. 😀

#decorators #higherorderfunctions #javascript #js

Last updated 2 years ago

alexanderadam · @alexanderadam
301 followers · 3369 posts · Server ruby.social

Or use a simple shortcut:

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

str.map{|string| string.to_i}

Convert an array of strings to integers in Ruby; more useful in Crystal

🐦🔗: twitter.com/ArityWolf/status/1

#crystal #ruby #higherorderfunctions #coding #programming #crystallang #rubylang

Last updated 4 years ago