I'm trying to add an object to the expense array using the addExpense method.
const account = {
expenses: [],
addExpense: function(description, amount){
let addObject = {
description : amount
}
this.expenses.push(addObject)
}
}
account.addExpense('Shopping', 50)
console.log(account.expenses)
I get no errors but the result gives me an object using the parameter name and not the actual string value, 'Shopping'. The amount argument works fine.
[{"description": 50}]