javascript get
myMap.get(key)
javascript get
myMap.get(key)
get js
const obj = {
log: ['a', 'b', 'c'],
get latest() { //get is used to return a value from your object
if (this.log.length === 0) {
return undefined;
}
return this.log[this.log.length - 1];
}
};
console.log(obj.latest);
// expected output: "c"
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