JSFiddle - React, Tailwind, and code Playground
by neuroflux
JavaScript
var decypher = "782137829431783498892347847823784728934782389";
var systemPass = "789544";
for (var x = 0; x < decypher.length; x++) { //loop through the array
var switcher = 0; //not run this row yet
for (var p = 0; p < systemPass.length; p++) { //loop through each digit in the password
if(eval(decypher[x]) === eval(systemPass[p])) { //if the password digit matches the array digit
if (switcher === 0) { //not run yet...
$('body').append("<p style='color: green; float: left;'>"+decypher[x]+"</p>");
switcher = 1; //finished running
}
} else { //no match
if (switcher === 0) { //not run yet...
$('body').append("<p style='color: silver; float: left;'>"+decypher[x]+"</p>");
switcher = 1; //finished running
}
}
}
}
/**
Why the motherf*ck does this only "highlight" the 7s?
**/