1
0
mirror of https://github.com/ruanyf/es6tutorial.git synced 2025-05-25 03:02:21 +00:00

Fix coding style in docs/iterator.md

This commit is contained in:
Xcat Liu 2016-05-18 14:49:05 +08:00
parent 307932e155
commit 3c84554957

View File

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