Transcript from the "Promises Q&A" Lesson
>> Will Sentance: All right, let's all thumb on this cause again, it's going to be a bunch of edge cases. What happens if x happens, what happens if y happens? Everyone's thumbs out, you lost me? I'm clear? I have clarification. Everybody's thumbs out. Alex has clarification, Ben's clear, Blessing's clear.
>> Will Sentance: Sean has a clarification. Mike has one. Brian's clear. Let's come to Alex.
>> Alec: Alec.
>> Will Sentance: To Alec apostrophe s.
>> Alec: Yeah.
>> Will Sentance: That's why I was saying Alex.
>> Alec: There we go yep.
>> Will Sentance: That's literally why I was saying. As I said it I thought, that's interesting, if you speak in the possessive sense for someone like Alec it's ambiguous.
[00:00:39] Let's come to Alec's question.
>> Alec: Maybe we were gonna get to this but I guess I was just wondering if it's going to use the event loop like.
>> Will Sentance: Absolutely, it is, but in a really interesting way, Shawn.
>> Sean: So my question was, if the web browser feature directly sets the memory, or if it uses the event loop?
>> Will Sentance: That's a very good question.
>> Will Sentance: It certainly gives precedence of setting that, more interesting is gonna be, when does the function get triggered so let's hold that question for now. Mike?
>> Mike: I was just wondering if future data represents the promise object that's getting value updated, why do we use a const?
[00:01:43] But objects and arrays, as long as you don't literally throw out the entire object and replace it with a brand new one and just add properties to it or add positions to an array, elements in array, that's well within the rights of conts. Conts only says do not throw me out completely, my data, and replace with a brand new thing in memory.
[00:02:01] You're perfectly allowed to add new properties to it, update the values of properties, add new elements to an array.. Does that make sense? And that's why we all default to const now for everything, unless it's a primitive value where you know you wanna change it from three to four, in which case, that's not allowed.
[00:02:16] Or if you know you wanna switch an object completely out in memory, and say, thank you for that object, here's a brand new one, then you would use that. But I don't know when you'd do that particularly, but you might. So it's pretty much default to const now.
[00:02:27] And that's a helpful way of making sure reassignments don't happen unintentionally. Good side question. Okay, further thumbs that were medium? Ben was clear, who else was medium thumb? Yes,
>> Will Sentance: Rick.
>> Rick: Very good, all right. So when the future data's value is set, and it caused the on fulfillment function.
>> Will Sentance: Let's say it triggers the on fulfillment.
>> Rick: Okay, so that-
>> Will Sentance: So we're gonna see in a moment, there's definitely some intermediate steps before it gets called.
[00:03:18] You've teemed something up nicely there, Rick, so let's see.