I have two object with same method
const obj1 = {
log: () => {
console.log('Call function')
}
}
const obj2 = {
log: () => {
console.log('Call function')
}
}
I want to call this method but with the name of the dynamic object. I have try this but that d’ont work :
let dynamiqueName = "obj1"
dynamiqueName.log()
[dynamiqueName].log()