(self: MutableList<A>)
| 239 | * @since 0.0.1 |
| 240 | */ |
| 241 | export const pop = <A>(self: MutableList<A>): A | undefined => { |
| 242 | const tail = self.tail |
| 243 | if (tail !== undefined) { |
| 244 | remove(self, tail) |
| 245 | return tail.value |
| 246 | } |
| 247 | return undefined |
| 248 | } |
| 249 | |
| 250 | /** |
| 251 | * Prepends the specified value to the beginning of the list. |