File tree 1 file changed +6
-6
lines changed
1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -25,7 +25,8 @@ function Set() {
25
25
} ;
26
26
27
27
this . has = function ( value ) {
28
- return value in items ;
28
+ return items . hasOwnProperty ( value ) ;
29
+ //return value in items;
29
30
} ;
30
31
31
32
this . clear = function ( ) {
@@ -49,8 +50,7 @@ function Set() {
49
50
this . sizeLegacy = function ( ) {
50
51
var count = 0 ;
51
52
for ( var prop in items ) {
52
- if ( items . hasOwnProperty ( prop ) )
53
- ++ count ;
53
+ ++ count ;
54
54
}
55
55
return count ;
56
56
} ;
@@ -93,16 +93,16 @@ function Set() {
93
93
} ;
94
94
95
95
this . intersection = function ( otherSet ) {
96
- var insertectionSet = new Set ( ) ; //{1}
96
+ var intersectionSet = new Set ( ) ; //{1}
97
97
98
98
var values = this . values ( ) ;
99
99
for ( var i = 0 ; i < values . length ; i ++ ) { //{2}
100
100
if ( otherSet . has ( values [ i ] ) ) { //{3}
101
- insertectionSet . add ( values [ i ] ) ; //{4}
101
+ intersectionSet . add ( values [ i ] ) ; //{4}
102
102
}
103
103
}
104
104
105
- return insertectionSet ;
105
+ return intersectionSet ;
106
106
} ;
107
107
108
108
this . difference = function ( otherSet ) {
You can’t perform that action at this time.
0 commit comments