Advertisement
Guest User

Untitled

a guest
Jun 24th, 2019
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. class DeviceManager {
  2. constructor() {
  3. this.deviceList = [];
  4. }
  5.  
  6. async buildDevices() {
  7. const deviceNames = await this.getDeviceNames();
  8.  
  9. deviceNames.forEach(async name => {
  10. const device = new Device(name);
  11. await device.build();
  12. console.log(device); // This outputs the device as expected!
  13. this.deviceList.push(device); // However, the device doesn't end up in this array?
  14. });
  15. }
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement