LiJell's 성장기

Conditional 본문

Front-End/JavaScript

Conditional

All_is_LiJell 2022. 5. 18. 00:15
반응형
// 요즘은 prompt 잘 안씀
// parseInt is a converter: string to number
const age = parseInt(prompt("How old are you?"));

if (isNaN(age)){
    console.log("Please write a number");
} else {
    console.log("Thank you for writing your age")
}


반응형

'Front-End > JavaScript' 카테고리의 다른 글

Events Control  (0) 2022.05.18
Events  (0) 2022.05.17
Function  (0) 2022.05.17
Data Type  (0) 2022.05.17
Booleans  (0) 2022.05.13
Comments