title: Error: forEach undefined
body: <p>I'm having this forEach issue in my code, but I really don't know what is wrong, because for me it's right.
  I want to create a route where I can upload an Excel file and based on the file, the code validate the file and accept it or not.</p>
  
  <p>This is the code where forEach appears:</p>
  
  <pre><code>router.route('/supply')
      .get(function (req, res, next) {
          res.render('upload');
      })
      .post(function (req, res, next) {
          fs.readdir(tmpDir, function(err,data) {
              if (err) {
                  throw err;
              } else {
                  if(data.length &gt; 0) {
                      data.forEach(deletaArquivo);
                  }
                  upload(req, res, function (err) {
                      if (req.fileValidationError || !req.file) {
                          return res.status(500).send({
                              message: "Upload fail. Please select Excel (xlsx) format",
                              error: {}
                          });
                      } else {
                          if (err) {
                              return res.status(500).send({
                                  message: '',
                                  error: err
                              });
                          } else {
                              tmpData = importxls.loadExcelFile(req.file.filename, req.body.data, req.body.serial);
                              return res.status(200).send({
                                  message: 'Upload succeeded',
                                  error: {},
                                  data: tmpData
                              });
                          }
                      }
                  });
              }
          })
      });
  </code></pre>