This line makes me uncomfortable. I understand that we should not directly copy properties. But converting to string seems a bit too heavy-handed. I'd prefer if we'd just explicitly remember the 'presence' of these property names, by doing originalProperties[k] = true;

That way we know what exactly we're comparing before and after (i.e, presence of property names, so we're 100% accurate about it).