I want javascript function to convert current_object structure to expected_object structure. without predefined reverse function. Im trying to built custom reverse function in my tool. thanks advance.
var current_object = {
“375”: “images/starburst_3.png”,
“768”: “images/Twix_product_image_3.jpg”,
“1440”: “images/Twix_product_image_3.jpg”,
“_keys”: [
“1440”,
“768”,
“375”
]
}
var expected_object = {
“1440”: “images/Twix_product_image_3.jpg”,
“768”: “images/Twix_product_image_3.jpg”,
“375”: “images/starburst_3.png”,
“_keys”: [
“375”,
“768”,
“1440”,
]
}
Tried of using Object.entrie with map functions doesn’ work
user3176077 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.