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 :: node js api with mongodb 
Javascript :: ternary javascript 
Javascript :: delete value from an array javascript 
Javascript :: get last element from array javascript 
Javascript :: node express chat app 
Javascript :: javascript dom methods 
Javascript :: js keycodes 
Javascript :: mutation observer 
Javascript :: .then function 
Javascript :: break loop if condition is met 
Javascript :: search as text elastic search 
Javascript :: round to nearest step 
Javascript :: arrays 
Javascript :: javascript function arguments 
Javascript :: file upload with progress bar 
Javascript :: react native image border radius not working 
Javascript :: ReferenceError: document is not defined 
Javascript :: append array in array 
Javascript :: launch json 
Javascript :: js react 
Javascript :: react autocomplete 
Javascript :: props 
Javascript :: javascript map mdn 
Javascript :: javascript number 
Javascript :: js autocomplete 
Javascript :: fetch timeout 
Javascript :: open source code 
Javascript :: jquery check if click to this self not this child 
Javascript :: tooltip in javasrript UI 
Javascript :: functions like once 
ADD CONTENT
Topic
Content
Source link
Name
3+7 =