I am trying to return object from function but it returns nothing any idea?
var todo = [{
id: 'a01',
titre: 'Citation',
message: 'Vous êtes de ceux-là ? Ca tombe bien, je lai été moi aussi !',
completed: false
}];
getById: function(todoId) {
for (var i = 0; i < todo.length; i++) {
if (todo[i].id == todoId) {
return todo;
}
}
}
return todo[i];getByIdmethod?