Substring In Javascript Using Math And Computational Thinking