change in readme placeholder item
This commit is contained in:
parent
dac420e021
commit
675257febe
1 changed files with 23 additions and 0 deletions
|
@ -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:
|
||||||
|
|
Loading…
Reference in a new issue