I currently have an object which I want to pass as a parameter to another function inside a template literal:
var template = `<button onclick="onclick(${object})"></button>`;
However, this makes the parameter become a string value: [object Object]
and doesn't pass the parameter. Is there any way to pass this parameter into the function?
Thank you very much in advance.