CJCoding With Joseph
← Back to Question List
JavaScript Code Walkthrough #25

Post-Increment as an Array Index

mediumOperators

📄 Code

Read carefully — what does this print?
1let i = 0;
2let arr = [10, 20, 30];
3console.log(arr[i++] + " " + arr[i++]);
4console.log(i);

🎯 Your Answer