title: How to convert hex to decimal WITH A LOOP in JavaScript
body: <p>Is it possible to convert a hex number to a decimal number with a loop?</p>
  
  <p><em>Example:</em> input "FE" output "254"</p>
  
  <p>I looked at those questions :</p>
  
  <p><a href="https://stackoverflow.com/questions/57803/how-to-convert-decimal-to-hex-in-javascript?rq=1">How to convert decimal to hex in JavaScript?</a></p>
  
  <p><a href="https://stackoverflow.com/questions/19605408/writing-a-function-to-convert-hex-to-decimal">Writing a function to convert hex to decimal</a>
  <a href="https://stackoverflow.com/questions/19605408/writing-a-function-to-convert-hex-to-decimal">Writing a function to convert hex to decimal</a></p>
  
  <p><a href="https://stackoverflow.com/questions/19605408/writing-a-function-to-convert-hex-to-decimal">Writing a function to convert hex to decimal</a></p>
  
  <p><a href="https://stackoverflow.com/questions/19502092/how-to-convert-hex-to-decimal-in-r">How to convert hex to decimal in R</a></p>
  
  <p><a href="https://stackoverflow.com/questions/28321924/how-to-convert-hex-to-decimal-in-c-net">How to convert hex to decimal in c#.net?</a></p>
  
  <p>And a few more that were not related to JS or loops. I searched for a solution in other languages too in case that I find a way to do it,but I didn't. The first one was the most useful one. Maybe I can devide by 16,compare the result to preset values and print the result, but I want to try with loops. How can I do it? </p>