title: why .forEach is not a function ejs api?
body: <p>I have the following error:</p>
  <pre><code>TypeError: C:\Users\40775\Desktop\OSF Project\MyShop1\views\homepage.ejs:40
      38|     &lt;main&gt;
      39| 
   &gt;&gt; 40|             &lt;% categories.foreach(function(category, index){ %&gt;
      41|                &lt;% category.page_title %&gt;
      42|            &lt;% }); %&gt; 
      43| 
  
  categories.foreach is not a function
  </code></pre>
  <p>categoryController:</p>
  <pre><code>const apiService = require('../services/apiService');
  
  
  
  async function getAllCategories() {
          let result = await apiService.getAllCategoriesApi();
              return result;
  }
  
  module.exports = {
      getAllCategories: getAllCategories
    };
  </code></pre>
  <p>Here is my indexRoutes:</p>
  <pre><code>const categoryController = require('../controllers/categoryController');
  
  module.exports = (app) =&gt; {
  
      app.get('/', async (req, res) =&gt; {
        const data = await categoryController.getAllCategories();
        res.render('homepage', {categories : data});
      });
     
      app.use(function onError(err, req, res, next) {
  
        res.statusCode = 500;
        res.end(err + '\n');
      });
  }
  </code></pre>
  <p>Here is my homepage.ejs:</p>
  <pre><code>        &lt;
  
  % categories.foreach(function(category, index){ %&gt;
                 &lt;% category.page_title %&gt;
                      &lt;% }); %&gt; 
  </code></pre>
  <p>I have checked the API connection and it works, I'm getting my object, I will post it anyway, maybe it helps..
  This is the object:</p>
  <pre><code>[
    {
      image: 'categories/mens-accessories-luggage.jpg',
      _id: '5e797c450d754a55dcf9f41e',
      id: 'mens-accessories-luggage',
      name: 'Luggage',
      page_description: &quot;Shop Men's Wheeled Luggage. Versatile, rugged suitcases, baggage, holdalls and shoulder bags. All with famous long-lasting quality.&quot;,
      page_title: &quot;Men's Wheeled Luggage&quot;,
      parent_category_id: 'mens-accessories',
      c_showInMenu: true,
      __v: 0
    }
  ]
  </code></pre>
  <p>Thank you guys in advice!</p>