I am storing my query in database like below
While fetching I need to replace the filterId by user inputs.
I tried the below
let filterId = req.body.ids; // filterId is the placeholder in database
fetchQuery(type, function((responseQuery){
console.log(responseQuery) // this still printing the placeholder not the user input
});
Since this is evaluated upon compilation, you should eval()
to accomplish this. It would be kind of fun to try.
var x = 12; var str = 'hello ${x}'; var combined = ( eval ("`" + str + "`") ) console.log(combined)
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.