DEV Community

From JavaScript to Ruby: A few of my favourite features

Harriet on February 01, 2019

Coming from JavaScript to Ruby, I was excited to learn the language that promised to be "friendly to developers" and "designed for developer happ...
Collapse
 
dgm profile image
dgm

It's not really a memory location. It's just an object id. Yes it's useful to see if two objects are really the same exact object, which is kind of similar to a memory location, but for example, there is a object id of 1.

ObjectSpace._id2ref(1).object_id
=> 1

That's hardly a memory location. :)

ObjectSpace can do some interesting things, none of which should probably be used in normal programming.

Collapse
 
wilsonsilva profile image
Wilson Silva

One effect of parentheses-less method calls means we can't pass methods around as values, like we can in JavaScript.

We can. Use


Collapse
 
harri_etty profile image
Harriet

Can't see what you wrote :(

Collapse
 
edgarortegaramirez profile image
Edgar Ortega

And there is more 😃