Im new to “real” Javascript:ing and I know understand more of functional programming.
It seems that in Javascript you get the best from both worlds: functional and object oriented programming.
But in Ruby, you don’t have first class functions (function as a datatype).
Does this mean that Javascript embraces the best of the both worlds while Ruby only embraces object-oriented programming style?
Ruby does have first class functions. What makes you think it doesn’t?
From wikipedia: A language that has first-class functions is one where:
You’re probably hung up on the fact that Ruby’s Procs/Lambdas need to be invoked via a
call()but this does not impact on their firstclassness. Common Lisp lambdas are invoked with afuncallas well and I do not recall anyone claiming Common Lisp does not have first class functions.