ruby - `<=': comparison of Fixnum with Array failed (ArgumentError) -


in code trying remove last vowel in word. once ran code, received argument error stating "comparison of fixnum array failed(argumenterror). please help!

vowels = %w( e o u)  def hipsterfy(string)    new_string = string.split('')    reversed_string = new_string.reverse    = 0    while <= reversed_string       if vowels.include?[i]          reversed_string[i] = ('')      += 1     end     reversed_string   end    reversed_string.reverse   end  

i sure not glith code, error got came here:

while <= reversed_string 

it should

while < reversed_string.length 

since reversed_array array, , want compare i against it’s length.


Comments

Popular posts from this blog

angular - Is it possible to get native element for formControl? -

unity3d - Rotate an object to face an opposite direction -

javascript - Why jQuery Select box change event is now working? -