I have a JavaScript variable containing data that I need to convert into valid JSON format for easier parsing. The current variable structure is as follows:
{
"machines": [{
"category": "Category 1",
"items": [{
"name": "Test 1",
"description": "Lorem Ipsum"
}, {
"name": "Test 2",
"description": "Lorem Ipsum"
}]
}, {
"category": "Category 2",
"items": [{
"name": "Test 3",
"description": "Lorem Ipsum"
}, {
"name": "Test 4",
"description": "Lorem Ipsum"
}]
}]
}
To make this valid JSON, I need to remove the var machines =
part and adjust the structure accordingly.