I am trying to concatenate a Javascript variable to the EJS object to make it dynamic. Is there a way to do this with the EJS syntaxes or Javascript?
For example
Backend
res.render('webpage', {bookObj : bookObj})
Frontend
let author = "Shakespeare"
let book = "<%= bookObj['Shakespeare'] %>" // <-- it works
let book = "<%= bookObj['" + author + "'] %>" // <-- it does not work