Businessman and blogger #Javascript, #Python and #PHP. My favorite frameworks/librairies are #React, #Laravel, and #Django. I am also a fan of #TailwindCSS
Thanks a million, I just update the post! I did not even know the union and intersection exist! After 2 years of Ruby I am still impress how easy it is compare to other programming language.
Those are powerful and complex Array operators but Ruby make those so easy to use.
As well as concatinating an array with
+
you can use-
to show you the difference.&
returns the intersection of two arrays. (Items that both arrays contain.)|
returns a union. (A combination of both arrays without duplicates.)Also, the constructor takes a block -- which can be handy.
Thanks a million, I just update the post! I did not even know the union and intersection exist! After 2 years of Ruby I am still impress how easy it is compare to other programming language.
Those are powerful and complex Array operators but Ruby make those so easy to use.
Yes, handling strings and collections in Ruby is a breeze. Those methods are ones I use often so were off the top of my head.