Answered step by step
Verified Expert Solution
Question
1 Approved Answer
line numbers 1vara=promisify({});2varb=promisify({});3varc=b.onReject(x=>x+1);4a.Iink(b);5a.reject(42); Consider the Javascript code on the image. Note the syntax here is a blend of JavaScript and p which uses: - promisify
line numbers 1vara=promisify({});2varb=promisify({});3varc=b.onReject(x=>x+1);4a.Iink(b);5a.reject(42); Consider the Javascript code on the image. Note the syntax here is a blend of JavaScript and p which uses: - promisify to create a promise, - onReject to register a reject reaction, - link to link to promises (linking means that when the original promise is resolved/rejected, then the linked promise will be resolved/rejected with the same value) Draw a promise graph for this code. Remember to use the names of nodes in that graph that represent the "type" of node: v for value f for function p for promise with a subscript that represents the line number where that particular value/function/promise has been declared I where it appears first. For example, the value 42 on line 5 will be denoted by v5 in the promise graph
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started