Out of the following 2 ways of calling a method in JavaScript;
- myFunc(params);
- obj.myFunc();
My questions are;
- For each of them, what exactly is the difference in accessing the values (for params/obj) inside myFunc()
- For the 1st case, when we use "this" inside myFunc(), it would refer to global obj (window). What about the second case?
- What are the use cases for using either of the 2 techniques?
You can add any other significant differences between the two techniques as well.