Check out this code snippet
var data={};
data={stdId:"101"};
data={empId:"102"};
data={deptId:"201"};
In my project, I'm receiving data from services into a data object with differing key names such as stdId
or empId
, etc.
I need to set empty values for keys like stdId
or empId
, etc., by doing something like data={stdId:""}
.
The key names are determined dynamically based on the services being used.