Find Last Index Array Javascript Push Function In Stack In Python