We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
This was my next attempt. I understand that I want to check if the user is admin on each iteration, but when I ran this it didn't solve the problem. What am I missing?
array.each do |item|
unless user.is_admin? item.update_score
end
end
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Ruby Control Structures - Unless
You are viewing a single comment's thread. Return to all comments →
This was my next attempt. I understand that I want to check if the user is admin on each iteration, but when I ran this it didn't solve the problem. What am I missing?