PluginA plugin as far as i hasI read is created for intercepting a phpPHP function call and running code before, after, or around that function call. Is there a way how to accomplish that in js file?
How can i intercept Magento 2 module js file function call with another function that is located in another module?
Example: js generates an array and i want to add additional element into that array with another module, before it gets processed by another js function. Similar to what is done in magento checkout customization tutorials but only using js file(s) (adding layout elements dynamically).
PS: Can it be done and if not then why? What might be cons? Sorry if that is against any js patterns or best practices?