So I have this object for example:
family_background: {
children: [],
spouse_surname: null,
spouse_first_name: null,
spouse_first_name: null,
spouse_middle_name: null,
spouse_occupation: null,
spouse_employer: null,
// so forth and so on
}
The way I set the values to null is like this:
for (var key in family_background) {
family_background[key] = null;
}
But I have a property that is equal to an array and by doing the loop, it would set the property to null also instead of a blank array.
How can I fix this? Am I missing something?