Convert array into upper case
you should use handler function in map:
var array2 = ["melon","banana","apple","orange","lemon"];
array2 = array2.map(function(x){ return x.toUpperCase(); })
for more information about map
edit: yes you can do
toUpper = function(x){
return x.toUpperCase();
};
array2 = array2.map(toUpper);
you can use this :
var a = ['this','is','test'];
a.map(f=>{ return f.toUpperCase(); });
toUpperCase()
do not change the value.
Try
array2 = array2.map(function (e) {
return e.toUpperCase()
});