My project contains an ES6 class whose constructor is defined as follows:
constructor() {
this.campaignName = 'United Way';
this.campaign = {};
this.questions = {};
this.benefits = {};
this.assistors = {};
this.locations = {};
this.buildDataObjects = this.buildDataObjects.bind(this);
this.retrieve();
}
Later in the code, the properties with default values of empty objects are given new values using Object.assign; however, I do not believe that code has any relevance for solving the problem at hand, so it is not included.
Elsewhere in the project's codebase, an instance of the class is being output using console.info:
As evident from the screenshot, there is seemingly nothing unusual about the object.
Next, the object's "questions" property is output:
The first line in the screenshot is an empty object, even though the output below includes the object's properties. However, those properties are inaccessible, as evident by the fact that calling Object.keys
with the given object produces an empty array.
I am at a total loss as to the cause of this behavior and would appreciate some insight. Thanks in advance!