Created
February 29, 2016 01:27
-
-
Save andrewjmead/d9a6309c7198b73d1ed6 to your computer and use it in GitHub Desktop.
TK Object Reference Example
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
| var accounts = []; | |
| function createAccount(userName_, initialBalance_) { | |
| var account = { | |
| balance: initialBalance_ || 0, | |
| userName: userName_ || ' ' | |
| }; | |
| accounts.push(account); | |
| return account; | |
| } | |
| firstAccount = createAccount('Bob', 5); | |
| secondAccount = createAccount('Tom', 10); | |
| console.log(accounts); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment