0

So, I have seen many JS functions that need two parameters, one of which is specified while calling the function i.e. function(param) and the other is specified using objects i.e. var.function(param) with the function needing var and param. So I want to know how I can get var
  • Please provide a more robust example that demonstrates the issue more explicitly. See [mcve]. `var.function()` isn't even valid syntax – charlietfl Jul 11 '20 at 14:45
  • @charlietfl it is e.g. string.search(tosearch) – Omer Hijazi Jul 11 '20 at 14:54
  • 1
    "Object based functions" are called **methods**. If you are invoking a method on an object, you can access the object [using the `this` keyword](https://stackoverflow.com/q/3127429/1048572) inside the function. – Bergi Jul 11 '20 at 16:58

0 Answers0