find first and last occurence in knockout js template

JavaScript
arrayName.indexOf('value')

Source

Also in JavaScript: