JavaScript: filter() for Objects
Never ever extend Object.prototype. Horrible things will happen to your code. Things will break. You’re extending all object types, including object literals. Here’s a quick example you can try: Instead create a function that you pass the object.