if - else Statements # statement-1 if item_counts[item_id] == nil item_counts[item_id] = 1 else item_counts[item_id] += 1 end Another way of achieving the same outcome as statement-1 above: # statement-2…
In Ruby, a String is created with double-quotes: "I am a String" String interpolation is done in Ruby with # { }: new_string = "New" "I am a #{new_string}" Return…