one more Example:
Please visit dartpad.dev/. The default sample code when you open the dart-pad is
void main() { for (int i = 0; i < 5; i++) { print('hello ${i + 1}'); } }
Run the sample code.
Note the line # 3 - print('hello ${i + 1}'); The i + 1 is used because initial value is 0. Now think how to avoid that with our prefix increment ++x.
void main() { for (int i = 0; i < 5;) { print('hello ${++i}'); } }
The output will be same.
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
one more Example:
Please visit dartpad.dev/. The default sample code when you open the dart-pad is
Run the sample code.
Note the line # 3 - print('hello ${i + 1}'); The i + 1 is used because initial value is 0. Now think how to avoid that with our prefix increment ++x.
The output will be same.