I am using papa parse to get fields from a google csv sheet and parses that information into JSON array. Here is an image of what my code currently returns: https://i.stack.imgur.com/toHlJ.jpg
Here's the code:
parseSites = () => {
var url = "https://docs.google.com/spreadsheets/fakelinklol";
var ForumCSVResults = Papa.parse(url, {
download: true,
header: true,
complete: results => {
results.data.forEach(result => {
ForumData.push(result);
})
}
})
}
console.log('Data without JSON.stringify()')
console.log(ForumData);
console.log('Data with JSON.stringify()')
console.log(JSON.stringify(ForumData))
function validate() {
var newArr = [];
var email = document.getElementById('email').value;
var password = document.getElementById('password').value;
var creds = [email, password];
console.log(creds);
ForumData.forEach(function(element) {
console.log(JSON.stringify(element.email))
})
}
ForumData.forEach doesn't even execute because apparently it is empty? I want to be able too iterate over each JSON object and compare email and password to creds. Appreciate any insight.