yessir i like 2 better cause the plot is better
Answer:
Static scoping: x is 5
Dynamic scoping : x is 10.
Explanation:
Static scoping :
In static scoping the variable of a function take the value within the function.
If there is no values exist within the function then take the global value of the variable.
var x // No value is assigned to x so it check global value of x
function sub1() {
document.write(“x = “ + x + “”); // So it print x = 5
}
function sub2() {
var x;
x = 10;
sub1();
}
x = 5; // It is the global value of x
sub2();
Static scoping: x is 5
Dynamic scoping :
In Dynamic scoping the variable of a function take the value all the calling function ends.
If the global value is the last assigned value of a variable then it take that value.
If there exist some other function after global variable value if that function contain the variable with some assigned value variable take that value.
var x
function sub1() {
document.write(“x = “ + x + “”);
}
x = 5; // At this point x value is 5 and check there exist a function
sub2(); // So now call this function
function sub2() {
var x;
x = 10; // The value of x = 5 is replaced with x = 10
sub1();
}
Dynamic scoping : x is 10.
Answer:
extends
Explanation:
When you create a subclass, you basically say "I'm creating a new class, but for now it will look and behave the same as that other class", then you add its own personality.
The syntax is:
class SubClass extends SuperClass
Where SubClass is your new subclass what inherits methods and variables from the SuperClass.
So, if you add nothing to the SubClass, it will be a carbon copy of the SuperClass. But you can add methods and variables exclusive to this SubClass that the SuperClass won't have.
Answer:
true
Explanation:
because my 8 ball said so