REPO
So the problem right now really leaves me puzzled, because the contract works fine in the console and in remix and also Unit tests pass. But the frontend will not work:

And when calling the approveVoters function I get this:

I suspect that the code is right, but there is some issue with the network ? I tried to run it on truffle develop as well as ganache.
Any help much appreciated @dan-i, @Malik, @filip, @thecil. I guess you guys are very busy as well. So if you find time, this is my first project I pushed so far on my own and I really learned a lot, from passing values between functions and languages to generating HTML from within javascript and looping async functions to retrieve data from public arrays. But when googling this errors I find very different opinions and solutions. Some say it is a bug in the client (ganache) and that problems with nonces are not easily solvable and so on… I hope to get your feedback on this. Thanks 
Invalid Number SOLVED
This is fixed by:
function setID(id){
console.log(id);
voteID = id;
//voteID = BigInt(parseInt(id));
console.log(voteID);
}
and passing the id to the vote function .
UPDATE 16-03, 11pm
@dan-i, so the Repository is updated once again. I rearranged the voting process a bit so that each candidate will have its own button and the user can vote for the candidate directly by pressing the respective button. The problem now still is, how do I pass the value of the vote to the vote function in the contract.
At the moment I get his err:
web3.min.js:1 Uncaught (in promise) Error: invalid number value (arg="candidate", coderType="uint256", value=null)
at Object.n [as throwError] (web3.min.js:1)
at t.encode (web3.min.js:1)
at web3.min.js:1
at Array.forEach (<anonymous>)
at N (web3.min.js:1)
at t.encode (web3.min.js:1)
at e.encode (web3.min.js:1)
at i.encodeParameters (web3.min.js:1)
at web3.min.js:1
at Array.map (<anonymous>)
If you could give me a hint, I would be very grateful.

old
UPDATE:
@dan-i, I could solve it!! The Repository is updated. The solution was this:
How to get array values from smart contract and printing them to HTML by looping a getter function async!
async function getAllCands() {
const candsLength = await voteApp.methods.candLength().call();
for (let i = 0; i < candsLength; i++){
candsNames.push(
await voteApp.methods.candidates(i).call().then(result => {
return [result[0]];
})
)
candsIds.push(i);
}
$("#name0_out").text(web3.utils.toUtf8(candsNames[1].toString()));
printCands();
console.log(candsNames);
console.log(candsIds);
}
async function printCands(){
const candsLength = await voteApp.methods.candLength().call();
for (var i = 0; i < candsLength; i++){
$('<div class="candsOut" />').text("ID: " + candsIds[i] + ": " + web3.utils.toUtf8(candsNames[i].toString())).appendTo('.CandsOut');
}
}
But if you still want to look into the code, I would be happy to get some help with the “Cast Vote” function. Atm it is throwing this error:
error message Vote function main.js
inpage.js:1 MetaMask - RPC Error: Error: [ethjs-query] while formatting outputs from RPC '{"value":{"code":-32603,"data":{"message":"VM Exception while processing transaction: revert","code":-32000,"data":{"0xbdefcea26f675f626bb40f3815376bb8979c652f9e240492701d13a88d55e17f":{"error":"revert","program_counter":16,"return":"0x"},"stack":"RuntimeError: VM Exception while processing transaction: revert\n at Function.RuntimeError.fromResults (C:\\Users\\sound\\AppData\\Roaming\\npm\\node_modules\\truffle\\build\\webpack:\\node_modules\\ganache-core\\lib\\utils\\runtimeerror.js:94:1)\n at BlockchainDouble.processBlock (C:\\Users\\sound\\AppData\\Roaming\\npm\\node_modules\\truffle\\build\\webpack:\\node_modules\\ganache-core\\lib\\blockchain_double.js:627:1)\n at runMicrotasks (<anonymous>)\n at processTicksAndRejections (internal/process/task_queues.js:93:5)","name":"RuntimeError"}}}}' {code: -32603, message: "Error: [ethjs-query] while formatting outputs from…/task_queues.js:93:5)","name":"RuntimeError"}}}}'"}
(anonymous) @ inpage.js:1
(anonymous) @ inpage.js:17
_runReturnHandlers @ inpage.js:17
_processRequest @ inpage.js:17
async function (async)
_processRequest @ inpage.js:17
_handle @ inpage.js:17
handle @ inpage.js:17
_rpcRequest @ inpage.js:1
sendAsync @ inpage.js:1
s.send @ web3.min.js:1
n @ web3.min.js:1
(anonymous) @ web3.min.js:1
u @ web3.min.js:1
(anonymous) @ web3.min.js:1
_handle @ inpage.js:17
async function (async)
_handle @ inpage.js:17
handle @ inpage.js:17
_rpcRequest @ inpage.js:1
sendAsync @ inpage.js:1
s.send @ web3.min.js:1
n @ web3.min.js:1
t @ web3.min.js:1
t @ web3.min.js:1
o._executeMethod @ web3.min.js:1
castVote @ main.js:24
dispatch @ jquery-3.4.1.min.js:2
v.handle @ jquery-3.4.1.min.js:2
main.js:34 Uncaught (in promise) {code: -32603, message: "Error: [ethjs-query] while formatting outputs from…/task_queues.js:93:5)","name":"RuntimeError"}}}}'", stack: "Error: Error: [ethjs-query] while formatting outpu…/task_queues.js:93:5)","name":"RuntimeError"}}}}'"}

Repository
I could solve the formatting issue with using web3.utils.toUtf8 instead of toAscii,
The issue with looping an async function call still remains.
