Closed ismail-codar closed 7 years ago
Pease check: http://jsbin.com/kahecu/edit?js,output
var data = Bind({ score: 10, cats: ['dizzy', 'missy', 'ninja'], }, { score: '.score', cats: updateCats }); setInterval(function () { data.score++; //data.cats[1] = Math.random(); // !!! IF THIS LINE UNCOMMENTED IT'S CORRECTLY WORKING !!! data.cats[3] = Math.random(); if (data.score > 100) { data.score = 0; } }, 500); function updateCats(list, old) { document.querySelector('#cats').innerHTML = '<li>' + list.join('<li>'); } data.cats.push('sil')
mind blowing!
Pease check: http://jsbin.com/kahecu/edit?js,output