The JSHint error "Expected an identifier and instead saw ']'. (E030)" usually occurs when there is a syntax issue in your JavaScript code involving square brackets ([]). The least obvious is that you have to use .push() function to add to the array.
Source code viewer
const children = []; // Adding an object with a key and value using push (works). children.push({ key: 'uniqueKey', value: 'someValue' }); // Attempting to add an object without specifying the index (Does NOT work!). children[] = { key: 'uniqueKey', value: 'someValue' }; console.log(children); // Output: [{ key: 'uniqueKey', value: 'someValue' }]Programming Language: Javascript