#3) Consider the following javascript-like program: var x function sub1 ) { document.write (x = function sub2 ( ) { var x

#3) Consider the following javascript-like program: var x function sub1 ) { document.write (“x = ‘ function sub2 ( ) { var x x = 10 subl } /body of main program x = 5; sub2 ) a) What value of x is displayed in function sub1, using static scoping rules? b) What value of x is displayed in function sub1, using dynamic scoping rules?



Source link

Leave a Reply

Your email address will not be published. Required fields are marked *