Hi I am wondering if someone could explain to me why in this exercise, one of the functions is expecting a boolean value as an argument. Am i just missing something to do with the syntax or is there something else going on?
let cookTheBeans = (isSoftened) => {
return new Promise((resolve, reject) => {
console.log(‘Time to cook the beans.’);
setTimeout(()=>{
if (isSoftened) {
console.log(‘… The beans are cooked!’);
resolve(‘\n\nDinner is served!’);
}
}, 1000);
});
}
The exercise is Handling dependent promises, within the Async part of front end development course.
There doesn’t seem to be any other reference to the function itself. it appears self contained. So i am wondering why (isSoftened) a boolean? I understand what the code is doing, i just don’t know why its expecting it to be a boolean and not a variable or something else.