Simple JavaScript easy to Understand
Firstly iterate the array and make a new array of has new number in string :)\n\nthis will help us to convert it into the new numbers according to the mapping e
Firstly iterate the array and make a new array of has new number in string :)\n\nthis will help us to convert it into the new numbers according to the mapping easy. \nThen onces we have converted it into a new array  with new converted array accoriding to the new mapping then we can sort it easliy in javascript.\n\nAfter sorting is done then just convert these values back to the original values and return it. The deed is done :)\n```\n// to make a clone of original array. so when we make any changes on the main array it won\'t reflect on this one.\n  let newNums = [...nums];\n   let convertedArray = [];\n   \n  // we need to convert array back into the main values so this is just reverse mapping of the original array.\n   let reverseMapping = Array(10);\n    \n    for(let i=0;i<mapping.length;i++){\n        reverseMapping[mapping[i]] = i;\n    }\n\t// the array we will return\n    let finalArray = [];\n    \n\t\n\t// here we are converting the array into the string and them converting them accordinly as per as their mapping\n    for(let i=0;i<nums.length;i++){\n        let temp = \'\';\n        temp += newNums[i];\n        let newNum = "";\n        for(let i=0;i<temp.length;i++){\n          newNum += mapping[temp[i]];  \n        }\n        convertedArray.push(newNum);\n        \n     }\n\t \n    convertedArray.sort(function(a,b){return a-b;});\n    for(let i=0;i<nums.length;i++){\n        let temp = \'\';\n        temp += convertedArray[i];\n        let newNum = "";\n        for(let i=0;i<temp.length;i++){\n          newNum += reverseMapping[temp[i]];  \n        }\n\t\t\n\t// untill now all values in our array is in string but we need to return numbers  adding + to any string converts it into a number.\n        finalArray.push(+newNum);\n        \n     }\n    \n    \n    return finalArray;\n\n```
['JavaScript']