how to create an element in js using the map method
const numbers = [1, 2, 3, 4, 5];
const bigNumbers = numbers.map(number => {
return number * 10;
});
how to create an element in js using the map method
const numbers = [1, 2, 3, 4, 5];
const bigNumbers = numbers.map(number => {
return number * 10;
});
.map in js
// A function which returns the last character of a given string
function returnLast(arr) {
return arr.at(-1);
}
let invoiceRef = 'myinvoice01';
console.log( returnLast(invoiceRef) );
// Logs: '1'
invoiceRef = 'myinvoice02';
console.log( returnLast(invoiceRef) );
// Logs: '2'
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us