Chomp removes record separator characters (ex \n, \r, \r\n) from the end of a string.
string(string): input string[separator](string): separator removed from end of string *(default '\r' | '\n' | '\r\n')*
(string): does the input end with the substring?
const result = strings.chomp('Goldy\n\r\n');
console.log(result);
> 'Goldy\n'