how get last array value in javascipt code example Example: how get last array value in javascipt arr.slice(-1)[0]