[].index(nil) returns nil. nil || 0 would give you 0. [].delete_at(0) is a no-op where as [].delete_at(nil) throws an exception.
[].index(nil)
nil || 0
[].delete_at(0)
[].delete_at(nil)
You need to return an integer, not a string.
An articulated and helpful comment, even if it were criticism, is always welcome, thanks! :)
Thanks mate! Im a noob and didn't know that. Will keep it in mind!
Loading collection data...
[].index(nil)
returns nil.nil || 0
would give you 0.[].delete_at(0)
is a no-op where as[].delete_at(nil)
throws an exception.You need to return an integer, not a string.
An articulated and helpful comment, even if it were criticism, is always welcome, thanks! :)
Thanks mate! Im a noob and didn't know that. Will keep it in mind!