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 181 views
1 answer 259 views
2 answers 320 views
1 answer 264 views
1 answer 257 views
1 answer 262 views
...