I tried a code to check the postfix increment unary operator and i want the incrementation to be applied to all of the array content. the problem is that when i do so the incrementation is not applied to all of the variables inside the array.
i tried to put the ++ unary operator behiend the NewArray
var array = ["2","mina",false,true,1.1,{Age:28}];
var i = 0;
var NewArray = "";
var text = ""
while(i < array.length){
NewArray = array[i];
text = NewArray++
console.log(text);
i++;
}
I expected the results to be : "3 , NaN ,0, 1 , 2.1 , NaN"
the actual results is : "2 , NaN , 0 , 1 , 1.1 , NaN"