Typescript Get Last Index Of Array Javascript Concat Method