This is quite bizarre. I have an object with a boolean property.
I want to see how it's doing so I do a console.warn
, which gives me the expected result. However, if I put a breakpoint on the console.warn
and display the variable through my dev tools console, I get undefined
. What is going on?
This is what my code roughly looks like:
export default class {
constructor () {
this.myProperty = true
}
doStuff () {
return {
doSomething: (...args) => {
console.warn('this.myProperty', this.myProperty) // will display true
// If I put a breakpoint on the console.warn and print it through my dev tools, it will display undefined.
}
}
}
}