I am just wondering why when I call the ‘hasOwnProperty’ method multiple times, I am only being returned one boolean value in the console? It is always the final call that returns. The rest of my code is fully functional and if I switch round the order I call to check on where the 3 properties are it returns whichever
Tag: hasownproperty
Using hasOwnProperty() on an array
Can I use hasOwnProperty() on an array? I have this array of RGBA values: I’d like to create an object that sorts them in order of their frequency in the array. I’m trying a combination of things. First I thought to convert the array into an object using: But that returns something like this: So I’m wondering if I can