var a = ['this','is','test'];
a.map(f=>{ return f.toUpperCase(); });
const string = "A string";
const upperCase = string.toUpperCase();
console.log(upperCase); // -> A STRING
const lowerCase = string.toLowerCase();
console.log(lowerCase); // -> a string
var fruits = ["Banana", "Orange", "Apple", "Mango"];
undefined
string = fruits.join(' ').toUpperCase();
// Output"BANANA ORANGE APPLE MANGO"
array_map('strtoupper', $array);
// how to make all elements of array uppercase using javascript Array prototype
Array.prototype.myUcase = function() {
for (let i = 0; i < this.length; i++) {
this[i] = this[i].toUpperCase();
}
};
const fruits = ["Banana", "Orange", "Apple", "Mango"];
fruits.myUcase();
console.log(fruits); // [ 'BANANA', 'ORANGE', 'APPLE', 'MANGO' ]