Last active
August 29, 2015 14:06
-
-
Save javaeeeee/f73d95a60c4cfea704f9 to your computer and use it in GitHub Desktop.
function account
This file contains 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 account() { | |
var balance = 10.; | |
function getBalance() { | |
return balance; | |
} | |
return { | |
getBalance: getBalance | |
} | |
} | |
var myAccount = account(); | |
//Here we call a method | |
console.log("balance = " + myAccount.getBalance()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment