Nodejs Array Except Last exceptLast()

Here you can find the source of exceptLast()

Method Source Code

Array.prototype.exceptLast = function() {
    if (this.length <= 1) return null
    return this.slice(0, this.length - 1)
}