EDIT: solved, i was missing a bit of code :L

why do you set a variable indexWhereFound?
i think you mean indexFound?

{
    var indexFound = -1;
    for (var position = 0; position < valueArray.length; position = position + 1){
        if (valueArray[position] == value){
            indexFound = position;}
    }
    return indexFound;
}
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.