Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class DeviceManager {
- constructor() {
- this.deviceList = [];
- }
- async buildDevices() {
- const deviceNames = await this.getDeviceNames();
- deviceNames.forEach(async name => {
- const device = new Device(name);
- await device.build();
- console.log(device); // This outputs the device as expected!
- this.deviceList.push(device); // However, the device doesn't end up in this array?
- });
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement