I have an array of arrays. I need to set an array of arrays in a case-insensitive way. How to perform this?
I've got this array and I need to set it to lowercase.
var criminals = [
["Paul White", "Roger Night, Peter Llong Jr."],
["Roger Fedexer", "Rob Ford, Pete Lord, Roger McWire"],
["Paul White Jr.", null],
["Red Fortress", "Roger Rabbit, Ross Winter"],
["Redford Fort", "Red Strong, Red Fort"]
];
I've tried this
var sorted = [];
for (let i = 0; i < criminals.length; i++) {
sorted.push(criminals[i].toLowerCase());
console.log(sorted)
}
But I got the following
TypeError: criminals[i].toLowerCase is not a function