petitviolet blog

    typescript (1 posts)

    Written by petitviolet

    Merge sorted arrays with ordering in some manner in TypeScript

    Arrays can be concatnated with Array#concat method but there is no built-in function to concatnating sorted arrays with giving a certain order
    In Rust, iterable objects have peek method to get the next value without advancing the iterator. [Peekable in std::iter - Rust]( This concept could be used to achieve the purpose. In merging 2 arrays with giving a certain order, peek