depends if we want this function to work only with plain javascript objects or with all object kinds, that would mean involving setters and getters too.