delete last element of array js

JavaScript
var colors = ["red","blue","green"];
var green = colors.splice(-1,1); //colors is now ["red", "blue"]
arr.splice(-1,1)
Source

Also in JavaScript: