While Loop Structure Javascript Substring Last 4