I'm having trouble with my code that is supposed to push data to an array variable, but instead I'm getting a blank array. Can someone help me figure out what I'm doing wrong?
let users = []
// Here is where I'm looping through an ajax response
for(var i = 0; i < response.length; i++ ) {
users.push(response[i].user_name)
}
When I run console.log, this is the result I get:
console.log(users) // Array[]