Skip to main content
added 5 characters in body
Source Link
Andy G
  • 19.4k
  • 5
  • 49
  • 70

They are equivalent, but you cannot use the dot notation when the attribute-name contains a space (or other non-alphanumeric characters):

foo.a space // doesn't work foo['a space'] // does 

They are equivalent, but you cannot use the dot notation when the attribute contains a space (or other non-alphanumeric characters):

foo.a space // doesn't work foo['a space'] // does 

They are equivalent, but you cannot use the dot notation when the attribute-name contains a space (or other non-alphanumeric characters):

foo.a space // doesn't work foo['a space'] // does 
Source Link
Andy G
  • 19.4k
  • 5
  • 49
  • 70

They are equivalent, but you cannot use the dot notation when the attribute contains a space (or other non-alphanumeric characters):

foo.a space // doesn't work foo['a space'] // does