Link to home
Start Free TrialLog in
Avatar of Latitude34
Latitude34

asked on

Javascript hasOwnProperty usage

I've seen hasOwnProperty used as:

if(elem[x].hasOwnProperty){

....
}

Open in new window


I was wondering how this worked and what this if statement was checking since I thought "hasOwnProperty" needed to be followed by a variable inside parantheses.  

Thanks in advance
ASKER CERTIFIED SOLUTION
Avatar of COBOLdinosaur
COBOLdinosaur
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Big Monty
according to here the value with the parenthesis is required.

this doesn't seem to be valid JS