Make all array elements Lowercase in JavaScript

To convert all array elements to lowercase, use the toLowerCase() method on them.

You can do this pretty easily with .map().

Example:

<script>
var arr = ['DOG', 'CAT', "DUCK"];

var arr = arr.map(element => {
  return element.toLowerCase();
});

console.log(arr);
</script>

Output (console):

0: "dog"
1: "cat"
2: "duck"