title: Loop though json key to check if its value is empty
body: <p>I have this json object. Json key <code>remarks</code> and <code>address</code> is empty. If its empty then json prints <code>undefine</code> when extracting json. But i want replace empty json with <code>-</code> sign. I know I can use:</p>
  
  <pre><code> if(msg.hasOwnProperty('remarks')== ""){
          alert("A");
     }
  </code></pre>
  
  <p>But how to loop through all the keys and check if its empty and replace with <code>-</code> rather than checking it individually.</p>
  
  <pre><code>[
  {
      "id": "224",
      "booking_id": "1",
      "room_type": null,
      "no_of_rooms_booked": null,
      "check_in_date": "2014-12-23",
      "check_out_date": "2014-12-24",
      "room_id": "93",
      "hotel_id": "9",
      "status": "1",
      "user_id": "15",
      "payment_type": "",
      "payment_status": "",
      "hotelname": "sample hotel",
      "hoteladdress": "sample address",
      "hotelcontact": "056533977",
      "Id": "224",
      "full_name": "Hom Nath Bagale",
      "address": "",
      "occupation": "Student",
      "nationality": "Nepali",
      "contact_no": "9845214140",
      "email": "bhomnath@salyani.com.np",
      "remarks": "",
      "total_amount": "5000",
      "child": "0",
      "adult": "1",
      "verification_code": null,
      "roomname": "sample room2",
      "roomprice": "1.5",
      "roomdescription": "this is for demo",
      "roomimage": "2.jpg"
  }]
  </code></pre>