what would help is if unityObjectValue was an array of nth values and then your code would look something like
var checks = ["n","i","space","reg","a","s","space","la","space","homar","o","n"];
for(c=0,testVar=false;c<checks.length;c++)
testVar = unityObjectValue[c] == checks[c]? true : testVar;
if( testVar ){
// we are true, do we do something?
}else{
// were false, do something?
}
which is useful if you want to set a flag then do something if tru value has been reached.
you may want to use something different like
var checks = ["n","i","space","reg","a","s","space","la","space","homar","o","n"];
for(c=0;c<checks.length;c++)
if( unityObjectValue[c] == checks[c]){
// we are true, do we do something?
...
...
}
if you want to do something when you have a matched value
you can easily combine the two...
var checks = ["n","i","space","reg","a","s","space","la","space","homar","o","n"];
for(c=0,testVar=false;c<checks.length;c++){
testVar = unityObjectValue[c] == checks[c]? true : testVar;
if( unityObjectValue[c] == checks[c] ){
// we have a match
...
}
}
// house keeping, do somthing if we have a match
if( testVar ){
// we are true, do we do something?
}else{
// were false, do something?
}
Your choice of methods depends on your needs, going with an array and iterating it is IMHO far better than having lots of variables of a similar name.