remove second last element from array javascript

JavaScript
var pg_url = array_fragment[array_fragment.length - 2]
Source

Also in JavaScript: