I have a big doubt about the following: suppose we have the following viewmodel and view respectively

```
function TableViewModel() {
    var self = this;

    self.someObservableCollection = ko.observableArray();

    self.doWorkWithObjectInCollection(collectionObject) {
        /* Code to process the collectionObject */
    }
}

ko.applyBindings(new TableViewModel());

```

And the view is like that (supposing we also ran a function to get initial data for the collection):

```
<table>
    <thead> <!-- Table head here --> </thead>
    <tbody data-bind="foreach: someObservableCollection">
        <tr>
            <td data-bind="text: property1"></td>
            <td data-bind="text: property2"></td>
            <!-- ... -->
            <td><a data-bind="click: $parent.doWorkWithObjectInCollection">Do Work</a></td>
        </tr>
    </tbody>
</table>

```

Now, it is very interesting that when one clicks on the Do Work link, the function `doWorkWithObjectInCollection` is called *and* the parameter passed is the object used in the current row.

How does Knockout knows that the parameter we want to pass is the current object in the foreach loop? And in other cases, how can I know what knockout will pass as a parameter to a function called on some event, like click?