Tiny function to get nth last entry from array
$ yarn add array-nth-last
or
$ npm install array-nth-last --save
const last = require('array-nth-last');
const arr = [1, 2, 3, 4, 5];
last(arr); // => 5
last(arr, 3); // => 2
Returns the nth last entry from the array
Type: Array
The array from which to get the nth entry
Type: number
The desired entry of the array to return