How to loop through objects keys and values in Javascript