Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

lowercase or uppercase all strings in array javascript

const names = ['Ali', 'Atta', 'Alex', 'John'];

const lowercased = names.map(name => name.toLowerCase());

console.log(lowercased);
// ['ali', 'atta', 'alex', 'john']

const uppercased = names.map(name => name.toUpperCase());

console.log(uppercased);
// ['ALI', 'ATTA', 'ALEX', 'JOHN']
Source by attacomsian.com #
 
PREVIOUS NEXT
Tagged: #lowercase #uppercase #strings #array #javascript
ADD COMMENT
Topic
Name
1+6 =