How to Send response after for each loop completed
<p>Response.json should execute after foreach loop completes its execution</p>

<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-js lang-js prettyprint-override"><code>var todoarr = (req.body.data) ? req.body.data : undefined
    todoarr.forEach(function(element) {
         if(element.done == true) {
             TodoService.removeTodo(element, function(success) {
             });   
         }
        }); 
        res.json("success");</code></pre>
</div>
</div>
</p>