Skip to content

Instantly share code, notes, and snippets.

abuismaeel / app.js
Created Sep 14, 2017
Practical JavaScript by Gordan Zhu Todo app.
View app.js
//created an object TodosList
var TodosList = {
todos: [],//todos array
displayTodos:function() {//method that displays values in array
console.log('My Todos:');
if(this.todos.length===0){//check if it's empty
console.log('Your array is empty.');
}else {//if it's not empty