I am trying to invert the values of a string of boolean values so that instead of
inverted([true, false, true, false, true])
it is [false, true, false, true, false]
So far I have come up with this:
function inverted(bools) {
var inversion = [];
var string= [];
while(!bools) {
string.push(bools);
}
return inversion;
}
But my code is not working, any and all help will be much appreciated!