I'm reading out a text from an HTML element and saving it in an JS array, but if the user puts in more then one empty space it is converted into a non breakable space symbol. Later on if I read out the array it prints out " " instead of an empty space. How can I detect an empty space?
  //instead of an empty space
I tried replace, but it does not work:
myText.replace(/( )*/g," ")