1// function to convert decimal to hexadecimal
2function convertToHex(element,index,array) {
3 return element.toString(16);
4}
5
6var decArray = new Array(23, 255, 122, 5, 16, 99);
7
8var hexArray = decArray.map(convertToHex);
9alert(hexArray); // 17,ff,a,5,10,63