Ruby - Methods
You want to create two Ruby methods: one that checks if an array is empty, and another that empties the array. Which method names follow Ruby conventions?
?, so empty? is correct.!, so clear! is correct.empty? and clear!. Other options misuse suffixes or use non-conventional names.15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions