javascript - Why does hovering in the Chrome debugger actually modify variables rather than evaluating an expression? -
so have code:
var = 3; debugger; console.log(a += > 2) now whatever reason (some type coercion happening i'm not familiar in case) boolean expression combined incremental operator increases a 1.
however, when hover the (a += a>3) in chrome debugger, run operation. if hover on part 5 times, run operation 5 times. instead of normal runtime giving output of 4, 8 because hovered on 5 times.
why doesn't run operation once , check value result of singular operation? if hover block of code 1000 times shouldn't output result of block of code if run once?
as now, have paused vm running against code. paused time , looking @ state is. highlighting operation executing code within state see how evaluate. then, because code does, becomes outcome of execution within vm. done many times cause execution occur again. upon stepping forward in execution, same state had paused pulled forward.
that straightforward answer why system operating does.
as why 1 added, johan's comment on true being converted 1 addition spot on. part of javascript's weak typing system.
Comments
Post a Comment