Records collection

I try to use dot notation to access and update the value but…
why CANT i use dont notation to update the value?
and in the solution it used bracket notation instead.
I might be confused or misunderstand something please help me figure this out.

// Only change code below this line
function updateRecords(records, id, prop, value) {

records[id][prop] = value; <<
records.id.prop=value; <<
return records;
}
"

You cannot use dot notation with variables that hold the name of the property you want to access. In that case you must use bracket notation.

1 Like

Ohh okay thank u a lot!

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.