1

Hello I am wondering why the value is not changing in my key, value pair set. I believe its not changing because it looks the same before and after using console.log(). I have a picture of the console. It might be an easy solution that has to do something async happening but I can not think of the solution! The code looks like:

console.log(files[index])

files[index].name = "lol"

console.log(files[index])

1

Sven Eberth
  • 3,057
  • 12
  • 24
  • 29
  • For who someone come here later, below link will be useful. https://stackoverflow.com/questions/17546953/cant-access-object-property-even-though-it-shows-up-in-a-console-log?page=2&tab=scoredesc#tab-top – Coworker Thoth Jun 04 '22 at 04:09
  • Sorry, wrong pages query. https://stackoverflow.com/questions/17546953/cant-access-object-property-even-though-it-shows-up-in-a-console-log?page=1&tab=scoredesc#tab-top – Coworker Thoth Jun 04 '22 at 04:11

1 Answers1

0

I have replicated your issue in the console, and can see it does work.

enter image description here

You need to make sure your 'index' is in quotes.

Sweet Chilly Philly
  • 3,014
  • 2
  • 27
  • 37