I have a basic function, that can be called around my project using different names - tiger, lion, dog.
I'd like to access the name of the triggered name within the function its self.
For example:
I can run demo.tiger('Hello', {1:1}) and like to access the tiger name from within the trigger function.
Thanks
const demo = ({ }) => {
function trigger (message, context) {
console.log(message, context);
}
return {
tiger: trigger,
lion: trigger,
dog: trigger
}
}