Javascript – Apply trim function to each string in an array January 10, 2023 by Tarik Or this can be solved with arrow functions: x.map(s => s.trim());