# create some hashesh1 = {one: 1, two: 2, three: 3}h2 = {name: "okwudili", stack: "ruby"}h3 = {"foo": 0, "bar": 1}# print all hashesputs h1puts h2puts h3# clear all hashesh1.clearh2.clearh3.clear# Reprint hashesputs h1puts h2puts h3
When we run the code, we see that the hash entries are cleared using the clear
method.