For loop vs While loop
For loops are better for incrementing or decrementing to a certain length/order. It is basically a compact while loop. While loops are good for repeated actions until it terminates when the condition is false. Consider while loops to be more general when you want to repeat an action and for loops are more specific in their purpose.
You can even check out their flow charts. You can see some difference in them
count++ vs count+=1
As for the count ++ and count +=1,
count ++: Value is being incremented but the value before the increment is returned.
count += aka ++count: Value is being incremented and the value after the increment is returned.
So basically one returns the value before it is being incremented and then increment and the other one returns the value after it's been incremented. Hence why count ++ goes up to 4 and count +=1 goes to 5.
Reason why you have 2 4s from your while loop
It logs the last expression executed which is count++. Refer back to the count++ definition I have written, it returns the value BEFORE incrementing it, hence why you have an extra 4 instead of a 5. (It did increment to 5 later and so the loop was terminated but that is not the returned value). This is just a console behaviour not much of the while loop behaviour.
When you had count+=1, it returned 5 in the end, hence why you had 5 in your result.