Reputation: 431
When the code pauses at a breakpoint, where in devTools are my private class variables displayed? I can see the public ones but not the privates (I mean variables prefixed with #
)
class MyClass {
#myVar;
constructor() {
this.#myVar = 'foo'
debugger
}
}
new MyClass()
Upvotes: 0
Views: 93
Reputation: 782158
WHen you're stopped in the debugger, you can see this
in the Scopes > MyClass section of the sidebar. Expanding it shows the private property #myVar: "foo"
.
More generally, if you're not in a method of the class when you stop, you'll need a variable that contains a class instance. You can enter the variable name in the console, and its properties will be shown.
Upvotes: 0