Hash new notation whitespace


#1



https://www.codecademy.com/en/courses/ruby-beginner-en-0i8v1/0/2?curriculum_id=5059f8619189a5000201fbcb

Why is this notation not allowed?
I found it confusing that I have to do :"Fight club" => 5 but Memento: 5 is ok.


movies = {
    "Fight club": 5
}


#2
Memento: 5

The above is a symbol. "Fight Club": is not a valid symbol so we need to revert to the syntax that supports quoted strings.


#3

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


#4

#5