I'm trying to use a promise but get a type error: Promise is not a constructor.
Here's the promise:
var Promise = new Promise(
function (resolve,error) {
for (var key in excludeValues) {
/* some ifs */
minVal = someValue
........
........
}
resolve(errors)
});
Promise.then(
function(data){
if (minVal > maxVal)
{
errors.minMax.push(
'minMax'
)
}
if (gapVal > minVal * -1)
{
errors.minMax.push(
'gapVal'
)
}
return (errors.minMax.length == 0 && errors.zahl.length == 0 && errors.hoch.length == 0 && errors.niedrig.length == 0)
}
);
Can someone tell me what I'm doing wrong?