Functions can take an object as its argument. Work up an example that illustrated a function consuming an object for its return.
const myData = {
name: 'Dale',
job: 'developer',
age: 44
}
function overTheHill(obj) {
let str = '';
if (obj.age > 45) {
str = `${obj.name} is too damn old to be a ${obj.job}`
} else {
str = `${obj.name} is in the prime of his ${obj.job} career`
}
return str
}
var person = overTheHill(myData);
console.log(person)
Functions can take an object as its argument. Work up an example that illustrated a function consuming an object for its return.