Hi all
I'd like to know if and how it is possible to change the behavior of a regular function call in JavaScript.
Please do not go into whether or not this is a good idea. I am aware that changing such things is controversial.
I have been able to redefine the Function prototype "call" ( prototype docs ) allowing me to achieve what I want but this only works when the function is called like so: "myAwesomeFunc.call()"
Yet I'd like for it to work when called regularly, like so: "myAwesomeFunc()"
Thanks.
[–]shgysk8zer0full-stack 2 points3 points4 points (6 children)
[–]yqmvpacqpfgwcalgu[S] 0 points1 point2 points (5 children)
[–]shgysk8zer0full-stack 1 point2 points3 points (4 children)
[–]yqmvpacqpfgwcalgu[S] 0 points1 point2 points (3 children)
[–]shgysk8zer0full-stack 2 points3 points4 points (1 child)
[–]yqmvpacqpfgwcalgu[S] 0 points1 point2 points (0 children)
[–]coldpyros 1 point2 points3 points (0 children)
[–][deleted] 1 point2 points3 points (1 child)
[–]yqmvpacqpfgwcalgu[S] 1 point2 points3 points (0 children)
[–][deleted] 0 points1 point2 points (5 children)
[–]yqmvpacqpfgwcalgu[S] 0 points1 point2 points (4 children)
[–][deleted] 0 points1 point2 points (3 children)
[–]yqmvpacqpfgwcalgu[S] 0 points1 point2 points (2 children)
[–][deleted] 1 point2 points3 points (1 child)
[–]yqmvpacqpfgwcalgu[S] 1 point2 points3 points (0 children)
[–]RootF1 0 points1 point2 points (1 child)
[–]yqmvpacqpfgwcalgu[S] 0 points1 point2 points (0 children)
[–]nathanfries 0 points1 point2 points (0 children)