JSON and JS repeat check index number (PURE JAVASCRIPT)

I am making a login site via JSON, and I want to check if a username matches with a password (by using array indexes to match username, password and email) but I can’t figure out how to see if the username matches with any index number and if there is an index in an array that corresponds with it in the passwords section. I can use indexOf with recursion (function that calls itself) but I have to increment the index checked by 1 which I do not know how to do. (searched for any stuff but I can’t find anything)
like this:

{
"usernames": [
"Supa", "Marwan", "Jason", "Jacob",
]
"passwords": [
"placeholder", "placeholder1", "placeholder2", "placeholder3",
]
}
function checkDetails(username, password) {
let message = document.getElementById("placeholder");
let password = document.getElementById("placeholder1");
let username = document.getElementById("placeholder2");

//part I am struggling with
let usernames = json.parse("usernames");
let passwords = json.parse("passwords");
message.innerHTML = (username === usernames[/*i want this to increment to check*/]) ? 
message.innerHTML = (password === indexOf(/*I want this to be the index of the one 
index that IS true to the conditional above*/)) ? m
essage.innerHTML = "Success with logging in" :
 message.innerHTML = "Invalid username or password";