Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

convert decimal to hex

// function to convert decimal to hexadecimal
function convertToHex(element,index,array) {
   return element.toString(16);
}

var decArray = new Array(23, 255, 122, 5, 16, 99);

var hexArray = decArray.map(convertToHex);
alert(hexArray); // 17,ff,a,5,10,63
Comment

decimal to hex

function HEX(num) {return num.toString(16)}
//hex is also known as base 16 so you just say var.toBase16String
Comment

PREVIOUS NEXT
Code Example
Javascript :: express-js 
Javascript :: convert javascript to python 
Javascript :: reduce function javascript 
Javascript :: this javascript 
Javascript :: react native version 
Javascript :: TypeError: expressValidator is not a function 
Javascript :: empty array javascript 
Javascript :: js index of 
Javascript :: javascript case insensitive regex 
Javascript :: sort array method 
Javascript :: if else javascript 
Javascript :: nextjs app 
Javascript :: react simple typewriter 
Javascript :: values javascript 
Javascript :: take off element form end of array 
Javascript :: find duplicates array javascript 
Javascript :: mongoose update array push multiple 
Javascript :: unicode in javascript 
Javascript :: date range picker jquery 
Javascript :: how to access value of itself object in javascript 
Javascript :: how to remove an element from an array javascript 
Javascript :: passing data in route react 
Javascript :: is there an api for netflix shows 
Javascript :: es6 hashset 
Javascript :: how to write a factorial function in javascript 
Javascript :: how to declare objects inside arrays in javascript 
Javascript :: js if 
Javascript :: how to remove a variable from an array javascript 
Javascript :: display array javascript 
Javascript :: js loop array back 
ADD CONTENT
Topic
Content
Source link
Name
2+4 =