How to iterate the recursive loop inside the react UL LI list elementes?
Clash Royale CLAN TAG#URR8PPP
How to iterate the recursive loop inside the react UL LI list elementes?
var obj =
"Response":
"Errors":
"Check":
"ReportingCategoryLabel": [
"Line No 4 Missing Category Report",
"Line No 4 Missing Category Report 1",
"Line No 4 Missing Category Report 2"
],
"_id": "223",
"_name": "error1234"
,
"Success":
"Check":
"_id": "223",
"_name": "success1234"
============================================================================
function iterObj(obj)
for (var key in obj)
console.log(key + ': ' + obj[key]);
if (obj[key] !== null && typeof obj[key] === "object")
iterObj(obj[key]);
iterObj(obj);
=============================================================================
Here are the details
First obj is describing the details of the object.
And second into the function describing the recursive loop to get the items from the object.
Here console.log(key + ': ' + obj[key]);
I want to give this consoles into the UL LI element
How we can iterate this using UL LI element and put the console.log inside the li elements?
My requirement is I have already put the recursive conditions and I want the consolelog into the ul li elements ?
It would be good if we can put the log into the any element other than UL LI
my requirement is only to display log into some elements.
Cheers,
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.