Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
Ruby lets you specify default values for a method's arguments---values that will be used if the caller doesn't pass them explicitly. This is done using the assignment operator
=
.Nah, the other solution is why people love Ruby:
This solution is why Ruby is the best lang.
Wait, shouldn't you be asking the opposite question,
what's the benefit of using "==" over "==="?
?Because as everyone knows, you shouldn't be using
==
except in cases you know it won't get wrong.Correct me if I am wrong but I think this solution doesn't pass the test if we pass an array [2, 5, 32] as the argument. The requirement says that the result needs to return 5 since 5 comes before 32, but this solution returns the number 32.
because name of method is 'always'
This comment is hidden because it contains spoiler information about the solution
I don't think this is clever....
Wow, this is a clever way to use the send mehtod!!!
This comment is hidden because it contains spoiler information about the solution
Hi there, I'm not an expert in Ruby, but here you will find a very useful explanation on this matter.
https://blog.newrelic.com/2014/12/10/weird-ruby-2-rescue-interrupt-ensure/
I still get the same result if I relace the "===" with the "==". Hence, what is the benefit of using "===" over the "=="? Could somebody enlighten me?
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
So, this is a recursive method right? And when do I know that I should use a recursive method though?
Yes, I also thought the same think. This solution absolutely is using string operation.
Loading more items...