I have an object 'data' and it has some elements, some of them have null value. When i am printing them instead of whitespace null is printed.
Example:
console.log(data.value1);
console.log(data.value2);
console.log(data.value3);
Output is :
null
null
null
But when using
$.trim(data.value1);
$.trim(data.value2);
$.trim(data.value3);
Problem is solved.
Now how can i use trim on object so i dont have to write same code for all the elements.