I guess the best way to tell the user that something is wrong is to throw a new error like that :
throw new Error('Wrong object type');
But it really depend on your goal.
Example, jQuery doesn't trow an error when you pass invalid argument to his constructor, it just return an empty object and the code continue.
After seeing Cal Markham answer, i am a little bit confused about your question.
If your are looking why your code doesn't work, just comment and ill delete that answer since it does answer your current question.