From: Brian Candler Date: 2012-10-09T04:25:28+09:00 Subject: Re: General Syntax question, Definiting Methods Todd B. wrote in post #1078942: > def remove_from object_array object > object_array.delete(object) > end > > ...returns the object deleted, not the new array. > > def remove_from object_array object > object_array.delete(object) > object_array > end > > ..returns the new array > > Putting object where object_array is to return the object and not the > array may seem redundant Actually it's not the same; consider the case where the object being deleted doesn't exist in the array. >> [1,2,3].delete(4) => nil -- Posted via http://www.ruby-forum.com/.