1.

The snippet that filters the filtered set is __________(a) var t=new FilteredSet(s, {function(s) {return !(x instanceof Set);});(b) var t=new FilteredSet{function(s) {return !(x instanceof Set);});(c) var t=new FilteredSet(s, {function(s) {return (x instanceof Set);});(d) var t=new FilteredSet(s, {function(s) {return x;});The question was asked in an interview for internship.I'd like to ask this question from Classes in JavaScript topic in division Classes and Modules in JavaScript of JavaScript

Answer»

The correct answer is (a) var t=new FilteredSet(s, {function(s) {return !(X INSTANCEOF Set);});

Best explanation: The instanceof operator is used to check the type of an object at run TIME. The instanceof operator returns a boolean VALUE that indicates if an object is an instance of a particular class.



Discussion

No Comment Found

Related InterviewSolutions