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