Confusion about brackets vs. parenthesis


If you look down at the code, when I try to delete one of my entries that I already have in my code at the start, it tells me "wrong number of arguments (1 for 0). But when I replace the brackets in else
puts "Title has been removed."

with parenthesis, it works. Why is this?

when "delete"
    puts "Which entry would you like to delete?"
    if movies[title.to_sym].nil?
        puts "There is no entry by that name."
        puts "Title has been removed."


Are square brackets used to call methods? You just have to ask yourself what action you're doing and then consider/look up what the corresponding syntax is


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.