Answer the question
In order to leave comments, you need to log in
Why is a JS class property overwritten?
why can the this.process property be overwritten in the GraphMaker constructor
for (let trunk in trunks) {
if (trunks.hasOwnProperty(trunk)) {
let template = [];
process.name = trunk;
template.push({name: 'in', metric: trunks[trunk].input}, {name: 'out', metric: trunks[trunk].out});
let Graph = new GraphMaker($this.host);
Graph.updateDB(process, template);
Graph.render(process, '12h');
}
}
function GraphMaker(host) {
this.host = host;
const $this = this;
this.updateDB = function(process, metric) {
this.process = process;
this.metric = metric;
let pathToDb = dbPath(process);
console.log(this.process);
fs.access(pathToDb, (err) => {
console.log(this.process);
if (err) {}
})
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question