JSFiddle - React, Tailwind, and code Playground
by ChrisStanyon
JavaScript
const myObj = {
test : function() {
return "Testing";
}
}
let varName = "myObj";
console.log(eval(varName))
//console.log({[varName]}.test())
by ChrisStanyon
const myObj = {
test : function() {
return "Testing";
}
}
let varName = "myObj";
console.log(eval(varName))
//console.log({[varName]}.test())