I need to iterate all values from an Object that I'll use to filter another array.
Searching on Google I found Object.values()
, but it doesn't work on typescript.
There is something equivalent that I can use on typescript?
Object: It describes the functionality, object helps in representing the non-primitive types that is everything except number, string, boolean, big int, symbol, undefined and null. In TypeScript Object(O uppercased) is different from object(o lowercased).
The hasOwnProperty() method returns true if the specified property is a direct property of the object — even if the value is null or undefined . The method returns false if the property is inherited, or has not been declared at all.
Typescript ES5 and ES6 does not have this method, because of this we need this workaround to use the JS method:
(<any>Object).values(yourObject)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With