I'm trying to pass a promise value to the next promise and wrote the line below to test it out.
Promise.resolve('hey').then(console.log);
simple enough, if I run node(4.3.0) in terminal I get the desired outcome
> Promise.resolve('hey').then(console.log);
Promise { <pending> }
> hey
However this is not the result I'm getting in browsers.
Firefox doesn't error out, but never logs "hey";
Promise.resolve('hey').then(console.log);
Promise { <state>: "pending" }
>
Promise.resolve('hey').then(console.log);
Promise { <state>: "pending" }
>
Chrome bugs out even more
Promise.resolve('hey').then(console.log);
Promise {[[PromiseStatus]]: "pending", [[PromiseValue]]: undefined}
undefined:1 Uncaught (in promise) TypeError: Illegal invocation
With no stack trace.
I tried to see if Babel would translate this code to something else but It does not change this statement at all.
What gives? Will this break if I use these statements in my code too?