Synchronous javascript: How to continue script after input value is set?

I have this javascript: function getImage(input) { status++; var base64 = $(‘#edit’).croppie(‘result’, { type: ‘base64’, size: ‘viewport’, format: ‘jpeg’, }).then(function(base64){ …

Nodejs Synchronous For each loop

I want to do a for each loop but have it run synchronously. Each iteration of the loop will do an http.get call and that will return json for it to insert the values into a database. The problem is …