Skip to content

Commit 5eecc31

Browse files
committed
fix borrowing a method
1 parent 1d5e72e commit 5eecc31

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

chapter_six.js

+3-4
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ class Group {
4343
return this.members.includes(el);
4444
}
4545
delete(el) {
46-
this.members = this.members.filter((i) => i != el);
46+
this.members = this.members.filter((i) => i !== el);
4747
}
4848
}
4949

@@ -82,8 +82,7 @@ for (let value of Group.from(["a", "b", "c"])) {
8282

8383
//borrowing a method
8484

85-
let hasOwnProperty = Symbol('hasOwnProperty');
86-
let map = {one: true, two: true, [hasOwnProperty]: true};
85+
let map = {one: true, two: true, hasOwnProperty : true};
8786

88-
console.log(map.hasOwnProperty("one"));
87+
console.log(Object.prototype.hasOwnProperty.call(map, 'one'));
8988
// → true

0 commit comments

Comments
 (0)