Created
February 15, 2016 22:26
-
-
Save andrewjmead/bd58be5392ad118ade21 to your computer and use it in GitHub Desktop.
John - getAccountIndex()
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function getAccountIndex(acctNumber) { | |
| for (var i = 0; i < accounts.length; i++) { | |
| var account = accounts[i]; | |
| if (acctNumber === account.accountNumber) { | |
| var index = accounts.indexOf(account); | |
| console.log("Found it!"); | |
| console.log("Index: " + accounts.indexOf(account)); | |
| return index; | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment