bevacqua/promisees

Says right code is wrong?

Closed this issue · 2 comments

I'm following along a pluralsight course and copied this code straight out of the video, they are using promises as well to test out AJAX calls and I think the playground is awesome... But his same exact code snippet works while mine says 'echo' is undefined? I'm not a beginner but I'm definitely baffled by this.

`
function echo(message, delay) { };

var log = r => {
console.log(r);
return r;
}

echo('1st echo')
.then(log)
.then(log)
.then(log);
`

Not sure what's baffling here. The echo function doesn't have a .then method. So you get an error because echo#then is not defined. This happens when pasting to the DevTools in any browser as well.

I'm not sure I understand. All I'm doing is typing exactly what I see in a pluralsight training course. I'm not copying and pasting.

A trainer is using promisees and I'm following along, or I was. I just thought I would try and help out as I don't need to follow along but if it gets me used to using promisees then that's like a good thing for the site.

Would it help to explain the issue here if I provided screenshots?