Using Substring In Javascript Example Code