DRAG DROP
You are developing an application by using JavaScript.
You must write a function that returns the sum of the variables named v1, v2, v3, v4.
You need to complete the sum function.
How should you complete the relevant code? (To answer, drag the appropriate code segment or
segments to the correct location or locations in the answer area. Use only code segments that apply.)
How should you complete the relevant code?
DRAG DROP
You are developing an application by using JavaScript.
You must write a function that returns the sum of the variables named v1, v2, v3, v4.
You need to complete the sum function.
How should you complete the relevant code? (To answer, drag the appropriate code segment or
segments to the correct location or locations in the answer area. Use only code segments that apply.)
It is correct
.call passes the object to be taken as ‘This’.
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/call
apply and bind do the same regarding to this?
I’d like to see where this is explained in the exam reference of study guide
I truly love how this is completely not mentioned in the exam reference (and not the only concept btw). Great work microsoft.
function add(v1, v2)
{
return v1 + v2 + this.v3 + this.v4;
}
function addValue() {
var o = { v3: 10, v4: 13 };
var res = add.call(o,15, 3)
document.getElementById(“results”).innerHTML = res;
// return res;
}