I like concise solutions, so come up with this more ES6 way:
const executeByName = (name, originContext, ...args) => { const namespaces = name.split('.'); const func = namespaces.pop(); const funcContext = namespaces.reduce((context, namespace) => context[namespace], originContext); return funcContext[func](...args);};