Skip to content
Advertisement

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

Advertisement