Examveda

Which of the following methods is used to check if a key exists in a hash in Ruby?

A. has_key?(key)

B. include_key?(key)

C. key_exists?(key)

D. contains_key?(key)

Answer: Option A


Join The Discussion

Related Questions on Arrays, Hashes and Strings in Ruby