Advertisement
Guest User

Untitled

a guest
Dec 7th, 2019
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const todos = [
  2.     {
  3.         text: 'Order cat food',
  4.         completed: true
  5.     },
  6.     {
  7.         text: 'Clean kitchen',
  8.         completed: false
  9.     },
  10.     {
  11.         text: 'Buy food',
  12.         completed: true
  13.     },
  14.     {
  15.         text: 'Do work',
  16.         completed: false
  17.     },
  18.     {
  19.         text: 'Exercise',
  20.         completed: true
  21.     }
  22. ];
  23.  
  24. const showPendingNotes = function(notes) {
  25.     return notes.filter(function(note, index) {
  26.         if(note.completed === false) {
  27.             return note.text
  28.         }
  29.     })
  30. };
  31.  
  32. console.log(showPendingNotes(todos));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement