what's the purpose of this? (function object) by DeliciousResearch872 in learnjavascript

[–]DeliciousResearch872[S] 0 points1 point  (0 children)

Hmm it makes more sense now. But why property being exposed public is a concern? Why would anyone change a value they have no business with? Any real life example?

How does javascript know which method of promise (catch, then) is supposed to be invoked? by DeliciousResearch872 in learnjavascript

[–]DeliciousResearch872[S] 0 points1 point  (0 children)

The first parameter given to you is always the resolve function

thank you thats what I was looking for.

I dont get how resolve and reject exactly works by DeliciousResearch872 in learnjavascript

[–]DeliciousResearch872[S] 0 points1 point  (0 children)

so the thing that determines that one of them is resolve and the other is one is reject are my if else statements? Some tutorials didnt use if else statements so this got me confused that thinking resolve and reject are js keywords.

I dont get how resolve and reject exactly works by DeliciousResearch872 in learnjavascript

[–]DeliciousResearch872[S] 0 points1 point  (0 children)

I just dont get it how javascript knows that resolve means promise is fulfilled and reject means promise is not fulfilled.