Get Max Index Of Array Javascript Push Notifications