Reputation: 3
How should the findOne method be properly used? (http://wellcaffeinated.net/PhysicsJS/docs/#Physics-world-prototype-findOne)
This code returns the error: Uncaught TypeError: Cannot read property 'label' of undefined
var theBall = world.findOne([{ label: ball }];
Upvotes: 0
Views: 114
Reputation: 11953
I think it does not expect an array but an object: world.findOne({ label: ball });
Upvotes: 1