Skip to content

Commit

Permalink
Merge pull request chuanxshi#120 from zhaber/master
Browse files Browse the repository at this point in the history
Corrected variable values
  • Loading branch information
chuanxshi committed Jun 9, 2018
2 parents 631ea57 + e50d6e9 commit 7bc6b94
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
4 changes: 2 additions & 2 deletions design-patterns/iterator.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
*/

var element;
while (element - agg.next()) {
while (element = agg.next()) {
// do something with the element
console.log(element);
}
Expand Down Expand Up @@ -68,4 +68,4 @@
// http:https://shop.oreilly.com/product/9780596806767.do?sortby=publicationDate
</script>
</body>
</html>
</html>
10 changes: 4 additions & 6 deletions design-patterns/singleton.html
Original file line number Diff line number Diff line change
Expand Up @@ -111,14 +111,12 @@
// linked to the objects
uni.nothing; // true
uni2.nothing; // true
uni.everything; // undefined
uni2.everything; // undefined
uni.everything; // true
uni2.everything; // true

// that sounds right:
uni.constructor.name; // "Universe"

// but that's odd:
uni.constructor === Universe; // false
uni.constructor === Universe; // true

var Universe;

Expand All @@ -145,4 +143,4 @@
// http:https://shop.oreilly.com/product/9780596806767.do?sortby=publicationDate
</script>
</body>
</html>
</html>

0 comments on commit 7bc6b94

Please sign in to comment.