文字列の両端にある空白、スペース、タブ、改行文字を削除する trim

console.log('   オレンジ\n');
console.log('   オレンジ\n'.trim());