Tuesday, January 2, 2018

.IndexOf in C# or .indexOf in JavaScript beyond returning -1 when a match cannot happen will return a number for the position of the first match.

In ["foo","bar",baz","qux"] 2 would be the index of "baz" if that makes sense. Does it? (The indexing is zero based.)

No comments:

Post a Comment