Question: 7. (10 points) Given this JavaScript like code, under static scoping what will be printed out? Under dynamic binding which will be printed out?

7. (10 points) Given this JavaScript like code, under static scoping what

7. (10 points) Given this JavaScript like code, under static scoping what will be printed out? Under dynamic binding which will be printed out? var x; function sub1() { } document.write(x); function sub2() { var x; } x=5; x=10 sub1(); sub2() Static scoping: Dynamic scoping:

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Under static scoping the output will be 5 This is because static scoping also known as lexical s... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Operating System Questions!