I'm building an array of players which will be added to when solver is not found within the name properties inside players
let players = []
let solver = 'Any Name Given'
// This if statement is the issue : How to check the name properties and compare to solver
// If the solver's name is already in players : add +1 point
if(players.includes(solver)){
// Give The Player +1 point
return console.log('Player Exists')
} else {
// Add The newPlayer to players with a starting point
let newPlayer = [name = solver, points = 1]
players.push(newPlayer)
}
How do I compare solver inside name of players. I've tried players[name] and players.name with no luck