A
A
Anton2015-10-10 10:30:43
JavaScript
Anton, 2015-10-10 10:30:43

Why does hasOwnProperty() return false where it should be true?

jsfiddle.net/5kcvgtk7
Why, if you add a property in an instance of a class that shadows the inherited one, hasOwnProperty returns false, although the method description says that "hasOwnProperty() returns true only if the instance has a property with the specified name."

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Vladislav Kopylov, 2015-10-10
@tunikov

name in quotes

I
Ivanq, 2015-10-10
@Ivanq

Put quotes on the last line.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question