Ruby - Hashes
Which of the following is the correct syntax to define a method using a hash for named parameters in Ruby?
options = {}.options = {} correctly. def greet(name: options = {}) uses invalid syntax. def greet(options: {}) tries to use keyword arguments incorrectly. def greet(options = []) uses an array instead of a hash.15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions