Okay so in PHP we can call function as dynamic variables something like
$obj = new $class;
$obj->$myFoo($args);
But I am trying the same thing in Javascript but it's not working. The error is
Uncaught TypeError: foo is not a function
My javascript code looks like this
function getId(arr){
for(let i in arr){
console.log("Function getId "+ arr[i]);
}
}
function getMarker(arr){
for(let i in arr){
console.log("Function getMarker "+ arr[i]);
}
}
const PAGEAPP = {
processes:["getId","getMarker"],
init:() => {
for(let foo of PAGEAPP.processes){
foo([1,2,3]);
}
},
}
Is there anyway I can access the same in Javascript.
Thank you in advance for your TIME :)
EDIT
This is what chrome showing