Presently, watch.length is always undefined because objects don't have a length property, so the for loop that follows gets called even when nothing is being watched. Object.keys() gets an array of the object's keys, which provides the length property we're after. Browser support is IE9+.
Presently,
watch.length
is alwaysundefined
because objects don't have alength
property, so thefor
loop that follows gets called even when nothing is being watched.Object.keys()
gets an array of the object's keys, which provides thelength
property we're after. Browser support is IE9+.