Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

124
Views
I'd like to ask the user to input a number again when entering a string using the while, but it comes out as NaN and the while.. does not work
let getInch = prompt('Cm로 바꾸고 싶은 Inch 값을 넣으세요','숫자만 입력하세요');

let numInch = Number(getInch);

while (numInch == NaN) {
  alert(`숫자만을 입력하세요`);
  getInch = prompt('Cm로 바꾸고 싶은 Inch 값을 넣으세요');}

let numCm = Math.round(numInch * 25.4) / 10;

alert(`${numInch}인치는 대략 ${numCm}센치미터 입니다`);
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Use isNAN() method instead of == NaN

https://developer.mozilla.org/de/docs/Web/JavaScript/Reference/Global_Objects/isNaN

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!