I am new with the Promise object. When I run the code below in NodeJS
function solution(num){
return getData(num).then(getMax);
}
function getData(num){
return Promise.resolve({
first: 80 * num,
second: 30 * num
});
}
function getMax(numbers){
return Promise.resolve(Math.max(...numbers));
}
solution(10)
I face the error
(node:7814) UnhandledPromiseRejectionWarning: TypeError: Found non-callable @@iterator at getMax
Could you help me to fix it? Thanks