function takes object name and property name and new value

JavaScript
function changeObject(objectName, propertyName, newValue){
   // objectName.propertyName = newValue;   // this line give you error so solve this we use square bracket nottion
   objectName[propertyName] = newValue;
}   
// javascript Note pNo 146
// https://playcode.io/607802/
Source

Also in JavaScript: