forEach executes the callback function once for each element in the Map object. Each value is visited once, except in the case when it was deleted and re-added before forEach has finished. Stack Overflow for Teams is a private, secure spot for you and your coworkers to find and share information. Learn more for each element type in body New values added before forEach has finished will be visited. callback is not invoked for values deleted before being visited.