Synchronous loop in Promise all
问题 I would like to do a synchronous loop in a part of my code. The function saveInDatabase checks if the item title (string) already exists in the database. That's why it can't be resolved in parallel, otherwise the condition will never apply (and would create duplicates). Promise.all(arr.map(item => { saveInDatabase(item).then((myResult) => ... ); })); I tried to encapsulate this function into separate promises, also tried with npm packages (synchronous.js, sync), but it seems that it does not