(iterable = [])
| 3 | //======// |
| 4 | export class LinkedList { |
| 5 | constructor(iterable = []) { |
| 6 | this.start = undefined; |
| 7 | this.end = undefined; |
| 8 | this.isEmpty = true; |
| 9 | |
| 10 | for (const item of iterable) { |
| 11 | this.push(item); |
| 12 | } |
| 13 | } |
| 14 | |
| 15 | *[Symbol.iterator]() { |
| 16 | let link = this.start; |