Want to trim each string in an array, e.g., given
x = [\' aa \', \' bb \'];
output
[\'aa\', \'bb\']
My fi
Influencing from Bergi's perfect answer, i just would like to add, for those methods which won't take a this argument, you may achieve the same job as follows;
this
var x = [' aa ', ' bb '], y = x.map(Function.prototype.call.bind(String.prototype.trim))