conversion-library / listNodeToArray
Function: listNodeToArray()
ts
function listNodeToArray<T>(node: null | ListNode<T>): T[]
listNodeToArray
version: v0.0.6+Type Parameters
• T
Parameters
• node: null
| ListNode
<T
>
Enter ListNode or null
Returns
T
[]
Return array
Example
ts
listNodeToArray({ value: { name: 'aaa', age: 1 }, next: { value: { name: 'bbb', age: 2 }, next: null } })
// [{ name: 'aaa', age: 1 }, { name: 'bbb', age: 2 }]