Anup Bishnoi
Anup Bishnoi

Reputation: 412

How can I reliably tell if a particular object is a Meteor Collection object (on the client side)

I have a function that receives a Meteor Collection object (that generated by new Meteor.Collection("lol_cats"))

How do I reliably tell whether any particular object is such a Meteor Collection object or not?

Upvotes: 2

Views: 80

Answers (1)

David Glasser
David Glasser

Reputation: 1468

Use Javascript's instanceof operator: if (x instanceof Meteor.Collection).

Upvotes: 1

Related Questions