I have the below in a file and read as
var input = require("./mydata.json");
"User": {
"properties": {
"firstName": {
"type": "string",
"minLength": 1,
"maxLength": 50
},
"lastName": {
"type": "string",
"maxLength": 50
},
"middleName": {
"type": "string"
},
"title": {
"type": "string"
},
"language": {
"type": "string",
"default": "en-US"
}
}
}
I am using the below code to loop through the keys
var item = _.get(input, 'User');
var properties = item.properties;
var allKeys = _.keys(properties);
_.each(allKeys, function(key) {
});
Inside the each loop, I get the firstname, lastname etc, in the same sequence as in the input file. I want to know if I will get it in order always?