Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var student = function () {
- var db = {host:"localhost", name:"student", username:"me", password: "adda"};
- return {
- get : function (id) {
- console.log(`Getting Student ${id} from db`);
- if(id){
- return {
- name: 'Oliver Mensah',
- school: 'Ashesi University',
- country: 'Ghana'
- }
- }
- },
- save: function (student) {
- console.log(`Saving ${student.name} to the db`);
- }
- }
- }
- student().get(1)
Add Comment
Please, Sign In to add comment