While Loop Structure Javascript Substring Negative Pressure