Javascript Using string methods example