1
0
mirror of https://github.com/ruanyf/es6tutorial.git synced 2025-05-28 21:32:20 +00:00

Merge pull request #199 from xcatliu/patch-11

Fix coding style in docs/iterator.md
This commit is contained in:
Ruan YiFeng 2016-05-19 10:29:18 +08:00
commit 5def873ed6

View File

@ -37,7 +37,7 @@ function makeIterator(array){
{value: array[nextIndex++], done: false} :
{value: undefined, done: true};
}
}
};
}
```
@ -60,7 +60,7 @@ function makeIterator(array){
{value: array[nextIndex++]} :
{done: true};
}
}
};
}
```
@ -81,7 +81,7 @@ function idMaker(){
next: function() {
return {value: index++, done: false};
}
}
};
}
```
@ -186,11 +186,11 @@ Obj.prototype[Symbol.iterator] = function(){
return {
done: done,
value: value
}
};
} else {
return {
done: true
}
};
}
}
return iterator;
@ -204,7 +204,7 @@ one.next = two;
two.next = three;
for (var i of one){
console.log(i)
console.log(i);
}
// 1
// 2