Created
October 15, 2017 16:46
-
-
Save mindmergedesign/bec77a39b89976c47dc7e64038ed4cc1 to your computer and use it in GitHub Desktop.
JS Bin // source https://jsbin.com/sugoluv
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
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta charset="utf-8"> | |
| <meta name="viewport" content="width=device-width"> | |
| <title>JS Bin</title> | |
| </head> | |
| <body> | |
| <script id="jsbin-javascript"> | |
| var todoList={ | |
| todos: ['exercise', 'drink', 'sleep', 'work'], | |
| showTodos: function(){ | |
| console.log(this.todos); | |
| }, | |
| addTodo: function(todo){ | |
| this.todos.push(todo); | |
| this.showTodos(); | |
| }, | |
| editTodo: function(index, newValue){ | |
| this.todos[index] = newValue; | |
| this.showTodos(); | |
| }, | |
| deleteTodo: function(index){ | |
| this.todos.splice(index, 1); | |
| this.showTodos(); | |
| } | |
| }; | |
| </script> | |
| <script id="jsbin-source-javascript" type="text/javascript">var todoList={ | |
| todos: ['exercise', 'drink', 'sleep', 'work'], | |
| showTodos: function(){ | |
| console.log(this.todos); | |
| }, | |
| addTodo: function(todo){ | |
| this.todos.push(todo); | |
| this.showTodos(); | |
| }, | |
| editTodo: function(index, newValue){ | |
| this.todos[index] = newValue; | |
| this.showTodos(); | |
| }, | |
| deleteTodo: function(index){ | |
| this.todos.splice(index, 1); | |
| this.showTodos(); | |
| } | |
| };</script></body> | |
| </html> |
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 todoList={ | |
| todos: ['exercise', 'drink', 'sleep', 'work'], | |
| showTodos: function(){ | |
| console.log(this.todos); | |
| }, | |
| addTodo: function(todo){ | |
| this.todos.push(todo); | |
| this.showTodos(); | |
| }, | |
| editTodo: function(index, newValue){ | |
| this.todos[index] = newValue; | |
| this.showTodos(); | |
| }, | |
| deleteTodo: function(index){ | |
| this.todos.splice(index, 1); | |
| this.showTodos(); | |
| } | |
| }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment