JavaScript hasOwn helper