I have a textbox collecting user input in my JS code. I would like to filter junk input, like strings that contain whitespaces only.
In C#, I would use the following code:
if (inputString.Trim() == "") Console.WriteLine("white junk");
else Console.WriteLine("Valid input");
Do you have any recommendation, how to do the same in JavaScript?