Created
March 16, 2017 01:48
-
-
Save pycraft114/1cb473d2f533ba066911e4e5d57948eb to your computer and use it in GitHub Desktop.
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 Health(name,lastname){ | |
this.name = name; | |
this.lastname = lastname; | |
} | |
var a = Health("chanwoo","park"); //return값이 없기때문에 a는 언디파인드, 윈도우에 네임 변수를 생성했기때문에 'chanwoo'출력 | |
console.log(name); | |
var allFuntions = { | |
addtask:function(task){ | |
this.todolist.push(task); | |
}, | |
completedTask:function(task){ | |
var index = this.todolist.indexOf(task); | |
this.completed.push(task); | |
this.todolist.splice(index,1); | |
}, | |
showList:function(){ | |
console.log(this.todolist); | |
} | |
}; | |
var firstTodolist = Object.create(allFuntions); | |
firstTodolist.todolist = []; | |
firstTodolist.completed = []; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment