Typescript Get Last Index Of Array Javascript Push Notifications