Skip to content

Instantly share code, notes, and snippets.

@andrewjmead
Created February 29, 2016 01:27
Show Gist options
  • Select an option

  • Save andrewjmead/d9a6309c7198b73d1ed6 to your computer and use it in GitHub Desktop.

Select an option

Save andrewjmead/d9a6309c7198b73d1ed6 to your computer and use it in GitHub Desktop.
TK Object Reference Example
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