I am trying to do this in node js v8
management variable looks like this:
let management = {
ip: '1.1.1.1',
port: '443',
username: 'admin',
password: 'admin'
}
constructor ({management,system,network,...other}) {
this.management = {
ip ,
port = 443,
username = 'admin',
password = 'admin',
} = { ...management };
}
Any idea why I get the message
ip: ip , ^
ReferenceError: ip is not defined
Shouldn't the evaluation be right to left so management is destructed before trying to assign? Any idea on how to do this in a clear way without any more code?