For eg.
searchMissingPositiveInteger([1,4,123]) // should give 2searchMissingPositiveInteger([-12, -3]) // should give 1searchMissingPositiveInteger([1, 2, ... , 999]) // should give 1000
A simple javascript implmentation of promise object. It isn't the best solution but does solve the given problem statement. The probable todo items/improvements would be to refer MDN doc for Promise
Listing a few here:
.all(iterable).reject(promiseInstance).resolve(promiseInstance).finally(callback)