Skip to main content
rename slightly, so we can give the non-duplicate a good name
Link
mikemaccana
  • 126.1k
  • 113
  • 441
  • 544

Why can I change athis constant object in javascriptJavaScript?

edited title
Link
gear
  • 441
  • 5
  • 15

Why can I edit const'schange a constant object in JavaScriptjavascript?

Post Closed as "Duplicate" by User863, pilchard, jonrsharpe
Source Link
gear
  • 441
  • 5
  • 15

Why can I edit const's in JavaScript?

asuming that a "const" is constant, I wouldn't have thought that this is possible:

const obj = { key1: value1, key2: value2 }; obj["key3"] = value3; obj.key4 = value4; 

Can somebody explain it to me?