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 109 views
1 answer 170 views
2 answers 203 views
1 answer 182 views
1 answer 162 views
1 answer 171 views
...