Skip to content

Commit 7bc6b94

Browse files
authored
Merge pull request chuanxshi#120 from zhaber/master
Corrected variable values
2 parents 631ea57 + e50d6e9 commit 7bc6b94

2 files changed

Lines changed: 6 additions & 8 deletions

File tree

design-patterns/iterator.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
*/
1212

1313
var element;
14-
while (element - agg.next()) {
14+
while (element = agg.next()) {
1515
// do something with the element
1616
console.log(element);
1717
}
@@ -68,4 +68,4 @@
6868
// http://shop.oreilly.com/product/9780596806767.do?sortby=publicationDate
6969
</script>
7070
</body>
71-
</html>
71+
</html>

design-patterns/singleton.html

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -111,14 +111,12 @@
111111
// linked to the objects
112112
uni.nothing; // true
113113
uni2.nothing; // true
114-
uni.everything; // undefined
115-
uni2.everything; // undefined
114+
uni.everything; // true
115+
uni2.everything; // true
116116

117117
// that sounds right:
118118
uni.constructor.name; // "Universe"
119-
120-
// but that's odd:
121-
uni.constructor === Universe; // false
119+
uni.constructor === Universe; // true
122120

123121
var Universe;
124122

@@ -145,4 +143,4 @@
145143
// http://shop.oreilly.com/product/9780596806767.do?sortby=publicationDate
146144
</script>
147145
</body>
148-
</html>
146+
</html>

0 commit comments

Comments
 (0)