1const numbers = [1, 2, 3, 4, 5];
2
3const bigNumbers = numbers.map(number => {
4 return number * 10;
5});
1// A function which returns the last character of a given string
2function returnLast(arr) {
3 return arr.at(-1);
4}
5
6let invoiceRef = 'myinvoice01';
7
8console.log( returnLast(invoiceRef) );
9// Logs: '1'
10
11invoiceRef = 'myinvoice02';
12
13console.log( returnLast(invoiceRef) );
14// Logs: '2'
15