Formatting error in JS