If-statements that are not trickering correctly

I have a if statements that I am struggling with and are not giving me the behavour I want.

I am trying to show a text when the user input in a field is not up to the requirement of minimum 3 characters. The text trickers if I have entered 1-2 characters, but not if the if the input field is empty. I am expecting that if the input field is empty it returns a string of “” -meaning it is 0 characters long?

If the value isn’t entered in the field, then it equal ‘undefined’. So you have to check for that value firstly.
something like:

if (searchValue) and (length of serchValue __your condition___)
  then do something