“Fungsi JavaScript ISNumber” Kode Jawaban

Bandingkan Nan di JavaScript jika condititon

// Use isNaN() 
// In javascript compare NaN direct alweys return false
let num1 = Number("Vishal");

// This code never work
if(num1 == NaN){  // Direct compare NaN alweys return false so use isNaN() function
  ....... Your Code .......
}  

// This code work
if(isNaN(num1){
  .........Your Code .......
}
Vishal090

Fungsi JavaScript ISNumber

Line 11 in the code is incorrect.
"if(isNaN(num1){"  is missing the closing parentheses.
It should be "if(isNaN(num1)){" instead.
Vivacious Vendace

Jawaban yang mirip dengan “Fungsi JavaScript ISNumber”

Pertanyaan yang mirip dengan “Fungsi JavaScript ISNumber”

Lebih banyak jawaban terkait untuk “Fungsi JavaScript ISNumber” di JavaScript

Jelajahi jawaban kode populer menurut bahasa

Jelajahi bahasa kode lainnya