Below is the JSON object I have in my JavaScript:
[{"hero title":"dsksklj","hero title2":"lsjdlk","hero text":"skjvls"}]
How can I iterate through it and save name and values in different variables?
Below is the JSON object I have in my JavaScript:
[{"hero title":"dsksklj","hero title2":"lsjdlk","hero text":"skjvls"}]
How can I iterate through it and save name and values in different variables?
Just like any other array:
for (var i = 0; i < array.length; i++) {
console.log(array[i]["hero text"]);
}