I want to create an unsorted JavaScript array object for this I have two arrays
var degree_values = ['Bachelors', 'Doctoral / PhD', 'Masters', 'MBA', 'Professional Certifications'];
var degree_indexes = ["4", "3", "2", "1", "5"];
var values = {};
for(var index in degree_values){
values[degree_indexes[index]] = degree_values[index];
}
console.log(values);
The output is
Object { 1="MBA", 2="Masters", 3="Doctoral / PhD", 4 = 'MBA', 5 = 'Professional Certifications'}
The expected Output is
Object { 4 = 'MBA', 3="Doctoral / PhD", 2="Masters", 1="MBA", 5 = 'Professional Certifications'}