Answer the question
In order to leave comments, you need to log in
How to check input in prompt for empty string or space in javascript?
Sorry for the stupid question)
By analogy with checking for NaN
if (isNaN(a)) {
alert('Это - не число!');
continue;
Answer the question
In order to leave comments, you need to log in
if (a === '')
alert('Пустая строка')
if (a === ' ')
alert('Это пробел')
if(!a.trim())
alert('Строка пустая или состоит только из пробелов')
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question