What will be th output of the following code //object geeks1 var geeks1 = { name : "ABC", article: "C++" } //object geeks2 var geeks2 = { name : "CDE", article: "JAVA" } //object geeks3 var geeks3 = { name : "IJK", article: "C#" } function printVal(){ document.write(this.name+" contributes about "+this.article+"<br>"); } var printFunc2= printVal.bind(geeks1); //using bind() // bind() takes the object "geeks1" as parameter// printFunc2(); var printFunc3= printVal.bind(geeks2); printFunc3(); var printFunc4= printVal.bind(geeks3); printFunc4(); //uniquely defines each objects
(A)
ABC contributes about C++ CDE contributes about JAVA IJK contributes about C#
(B)
ABC contributes about C++ No output IJK contributes about C#
(C)
ABC contributes about C++ CDE contributes about JAVA No output
(D)
None of the above
Answer
Please comment below if you find anything wrong in the above post
Feeling lost in the world of random DSA topics, wasting time without progress? It's time for a change! Join our DSA course, where we'll guide you on an exciting journey to master DSA efficiently and on schedule.
Ready to dive in? Explore our Free Demo Content and join our DSA course, trusted by over 100,000 geeks!