Carolyn Van Slyck

Knockout Observables

I sometimes run into a bug where can't figure out why Knockout is changing the value of my variables. After digging around, it always is caused by me passing an object in the constructor when newing up an observable or changing its value. When setting the value of an observable or observableArray, remember that if you pass it an array, date or object, when your observable is changed, the value of your variable will also be changed.

If you don't want that to happen, pass a copy of your variable.