I am building an Object using vanilla JavaScript and one of the key pairs in the Object is an edit button that has a function being called onclick. I want to pass a parameter to this function when building the object but I cannot figure out the correct way to write the string.
You can see what I have tried in the code example below. I have not been able to get it to work properly.
new_projects.push({
'Status': createStatusOrbs(project['Project Status'], 'Status'),
'Edit': "<i class='fa fa-pencil-square-o' aria-hidden='true' onclick='getEditForm("+project['Project']+")'></i>",
'Project Name': project['Project'],
'Last Update': moment(project['Last Update']).format("MMM Do YYYY")
});