* @description - Return the array of Queue * @returns {Array<*>}
()
| 91 | * @returns {Array<*>} |
| 92 | */ |
| 93 | toArray() { |
| 94 | const array = [] |
| 95 | let node = this.head |
| 96 | |
| 97 | while (node) { |
| 98 | array.push(node.data) |
| 99 | node = node.next |
| 100 | } |
| 101 | |
| 102 | return array |
| 103 | } |
| 104 | |
| 105 | /** |
| 106 | * @description - Return is queue empty or not |