How to convert hexadecimal to number in JavaScript

1 Answer

0 votes
const hex = 'ff'; 
 
const num = parseInt(hex, 16);
 
console.log(num);
 
 
   
     
     
/*
run:
     
255
     
*/

 



answered Jan 27, 2021 by avibootz
edited May 20, 2022 by avibootz

Related questions

1 answer 100 views
1 answer 160 views
2 answers 187 views
1 answer 171 views
1 answer 151 views
1 answer 159 views
...