0

What is the difference between referencing an object with object.key = value and object['key'] = value For example if I had an object call var myObj = {};

H. Lee
  • 67
  • 1
  • 9

1 Answers1

0

I believe the quote notation allows for arbitrary keys, (like console.log({' 1a':3}[' 1a']), whereas the dot syntax can only be used with keys that begin with a letter.

גלעד ברקן
  • 23,602
  • 3
  • 25
  • 61