javascript after split then trim whitespace

JavaScript
String[] result = Arrays.stream(attributes.split(",")).map(String::trim).toArray(String[]::new);
Source

Also in JavaScript: