This can be simplified: 

```js
var value  = contact[field][k];

if (typeof value !== 'string') {
  value = value.value
}

...
```