change in readme placeholder item

This commit is contained in:
rlx 2012-04-17 12:00:57 +00:00
parent dac420e021
commit 675257febe

View file

@ -1,5 +1,28 @@
<h1>Before and After</h1> <h1>Before and After</h1>
<p><pre class="code"> <p><pre class="code">
// before:
for (var i == 0; i < bigArray.length; i++) {
if (bigArray[i].isSelected) {
bigArray[i].onDeselect = (function(i) {
return function() {
doSomething(i);
}
})(i);
}
if (!bigArray[i].isSelectable) {
break;
}
}
// after:
Ox.forEach(bigArray, function(v, i) {
if (v.isSelected) {
v.onDeselect = function() {
doSomething(i);
};
}
return v.isSelectable;
});
// before: // before:
var exists = array.indexOf(value) > -1; var exists = array.indexOf(value) > -1;
// after: // after: