knockout issue #2450

by fastfasterfastest

HTML

<script src="https://knockoutjs.com/downloads/knockout-3.5.0.debug.js"></script>
<button data-bind="click: triggerBug">Trigger bug</button>
<div data-bind="foreach: array">
  <div data-bind="text: $data"></div>
</div>

JavaScript

function ViewModel(){
   this.array = ko.observableArray([0, 1, 2, 3]);
   this. triggerBug = function(){
    	this.array([1, 3, 10]);
    };
	};
  
 
  ko.applyBindings(new ViewModel());