title: how to return an empty array with array.map
body: <p>I need to return an empty array if obj.chk != true
  to check if no checked toDos</p>
  
  <pre><code>function listChk() 
  {
      if (!chkExist('./toDoArr')) {console.log('Please create toDo list first!')}
      else {
  
          let toDoArr = JSON.parse(fs.readFileSync('./toDoArr'))
  
          let chkToDoArr = toDoArr.map(function (obj) {
              if (obj.chk === true){
                 console.log( obj.toDo)
                 return obj.toDo
              }
          });
          console.log(chkToDoArr) // &gt;&gt;  [ undefined, undefined ]
  
          if (chkToDoArr.length &lt; 1) 
          console.log('no checked toDos or empty list');
      }
  }
  </code></pre>
  
  <p>thanks</p>