D
D
deemaagog2018-02-10 01:28:21
Google Chrome
deemaagog, 2018-02-10 01:28:21

VS code debugging, why is this undefined?

When debugging from VS code via chrome debugger extension this is undefined even though the code runs as it should with no errors

class Q {
    constructor() { 
        this.arr = [1,2,3]
    }
    log(e) {
        console.log(e)
    }
    test() {
        this.arr.forEach(e => {
            this.log(e); // this undefined в отладчике!
        })
    }
}

const f = new Q().Test()?

What can be wrong? maybe something needs to be specified in the config file?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question