Prithviraj Mitra Prithviraj Mitra - 1 year ago 163
Javascript Question

Remove last item from array

I have the following array.

var arr = [1,0,2];

I would like to remove the last element i.e. 2.

I used
but it doesn't remove the value.

Answer Source

Use splice(index,howmany)

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download