convert json object to lowercase
var x = { id: 0, name: "SAMPLe", forms: { formId: 0, id: 0, text: "Sample Text" }};
function lower(obj) {
for (var prop in obj) {
if (typeof obj[prop] === 'string') {
obj[prop] = obj[prop].toLowerCase();
}
if (typeof obj[prop] === 'object') {
lower(obj[prop]);
}
}
return obj;
}
console.log(lower(x));
Also in JavaScript:
- javascript get call stack
- .append js
- vuejs components props pass array
- input onchange react type file
- store console.timeEnd in variable js
- get value in tag with id JS
- How to check if a member has a role discord.js
- 'userprofile/:id', ionic
- device height react native
- preview image file upload javascript
- how to send array to js file in wplms
- js run html in blob
- string.find javascript
- pass argument to event listener javascript
- change url without reloading
- javascript settimeout
- js capitalize first letter of each word
- javascript password max length
- ERROR 3814 (HY000): An expression of a check constraint 'INV_CK1' contains disallowed function: `TO_DATE`.
- chart.js y axis maximum value
- moving letters animation javascript
- Bind Json file into a Datagridview in windows form using C#
- js remove first and last element from array
- javascript how to disable a button