Basic Coding Challenge: Mutations_How can I use to modify casing?

I am working on the Mutations problem on For this challenge, we need to return true if the string in the first element of an array contains all of the letters of the string in the second element of the array. Case should be ignored.

To deal with case, I would like to put all letters in lowercase using So far, I have been unsuccessful with this. I’ve tried

function mutation(arr) {{
mutation(["Bye", "by"]);

The console.log test put out [ 'Bye', 'by' ], showing that the array had not been modified. When I tried with

function mutation(arr) {
var arrLowerCase = [];
  for (var i = 0; i < arr.length; i++) {
mutation(["Bye", "by"]);

the console.log test churned out [ 'bye', 'by' ] showing that uppercase letters had been modified and providing the desired output.

Is there a way to use to change casing in arrays as well? Thank you in advance.

Arr map needs a return value. Currently it looks like you’re not returning anything. Try something like this.

function lowerCase(arr){
  let ans ={
    return word.toLowerCase()
  return ans;
1 Like

The code is working now!