Below is the way I store the keys and values in my map.
Map<String, Object> mapNew = new Map<String, Object>();
Object obj = record.get(fieldName) != null ? record.get(fieldName) : null;
mapNew.put(fieldMap.get(fieldName).getDescribe().getLabel(), obj); // contains field label and corresponding field value
Response in system.debug is
recordDetail={Account Name=Test, Active=true, Business Phone=null, [email protected], Title=Mr.}
But when I am printing the same map on the javascript side, response looks like this,
Account Name: "Test"
Active: true
Email: "[email protected]"
Title: "Mr."
I want to know why the key with an empty value entry gets omitted automatically and how to handle this issue in javascript side.