Intro. to Ruby | 12. Naming Conventions (Passed the section, but error message)


#1

var name = "Jordin"

undefined method `var' for #

It said that I passed the section, but I want to know why it gave me that error message. If you know, please tell me. Thanks!


#2

There is no reserved word, var in Ruby. Variables are defined when they are instantiated.

name = "Jordin"

We cannot declare a variable without defining it like we can in JS.


#3

Thanks for the help! :slightly_smiling: