|
|
|
|
|
by sebilasse
4949 days ago
|
|
You can use the same methods in JavaScript that you're using already in Ruby. Same arguments, same behaviour, same return values. No mental overhead switching back and forth from Ruby to JS. Blocks in RubyJS translate to functions (as the last parameter). They work pretty much the same in RubyJS. You can break out of a loop using a breaker object. It's not about the Ruby object model and metaprogramming capabilities but about the core library. Especially as Ruby developer if you switch to JS you spend an inordinate amount relearning a new (IMO not so convenient) standard library. Also RubyJS methods are chainable by design (methods return other RubyJS objects. So you can write: R([1,2,3]).map(...).join(',').capitalize().ljust(50)
|
|