Remove a Trailing Newline from a String in JavaScript | CodeTrail