Added (  typeof(obj[key]) == number ) to include elements a JSON object, that were getting omitted.