Say I have a parent function that calls some child functions like this:
function parentFn() {
API.greet();
}
parentFn.name = 'john';
const API = {
greet: function() {
console.log(`Hi there ${parentFunc.name}`); // prints out 'Hi there undefined'
}
};
parentFn()
Is there anyway to get a property of the parent function inside the API without adding a parameter to the inner function?