Moved List.contains to Sequence.contains, added tests and docs
This commit is contained in:
+9
-9
@@ -1,4 +1,13 @@
|
||||
class Sequence {
|
||||
contains(element) {
|
||||
for (item in this) {
|
||||
if (element == item) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
count {
|
||||
var result = 0
|
||||
for (element in this) {
|
||||
@@ -92,15 +101,6 @@ class List is Sequence {
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
contains(element) {
|
||||
for (item in this) {
|
||||
if (element == item) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
class Map {
|
||||
|
||||
Reference in New Issue
Block a user