+ 1

Why prefix and postfix necessary?.

what was the real intention behind prefix and postfix

14th Jun 2019, 7:26 PM
Afzal Ali
Afzal Ali - avatar
2 Answers
+ 4
You can live without it, but there are some examples in which it is useful Let's say you want to iterate over an arrays elements with a while loop that only consists of one line of code int[] arr = {1, 2, 3, 4, 5, 6, 7}; int i = 0; while i < 7 console.log(arr[i++]); Next time please make sure to include what language you are using; and spamming the same question twice won't help with anything
14th Jun 2019, 7:29 PM
Airree
Airree - avatar
+ 1
That was by accident posting twice... :(
14th Jun 2019, 7:34 PM
Afzal Ali
Afzal Ali - avatar