I am trying to use a variable to update the map object but it inserts a new key:value pair. Using task."$key" = value; throws an error.
const task = {
title : 'update UI for Login',
description:'update UI for Login',
status : 'open'
}
const update = (key,value) =>{
task.key = value;
}
console.log(task);
update('title','Sign Up');
console.log(task);