I have an array of objects that I want to convert everything inside in this array to be lowercase. Can someone help with this:
Original:
const array_pairs = [
{
"name": "Master",
"contract": "asxcxcx",
"deployer": "BCCCCCC"
},
{
"name": "Master2",
"contract": "bcxcssDA",
"deployer": "ttttttttTTtttttt"
}]
Desired Format:
const array_pairs = [
{
"name": "master",
"contract": "asxcxcx",
"deployer": "bcccccc"
},
{
"name": "master2",
"contract": "bcxcssda",
"deployer": "tttttttttttttttt"
}]
JSON.parse(JSON.stringify(array_pairs).toLowerCase()). This will work as long as it's fine that your object keys also get lower-cased (in your example there were no upper-case characters in the keys so I guess it's OK).