Get array last element - Node.js Array

Node.js examples for Array:Last Element

Description

Get array last element

Demo Code


export function last(a) {
    return a.length > 0 ? a[a.length - 1] : null;
}

Related Tutorials