Some sample JavaScript code snippets for:
- Creating and populating arrays
- Finding the number of elements in an array with array_name.length
- Reading individual array values with array_name[index_number]
- Iterating through arrays with three loop types: for… next, for… of and forNext.
Instructions for use
- the web page containing the JavaScript code.
- Open the page in Brave or other, lesser web browsers.
- View the JavaScript output by pressing the following keys and selecting the Console tab:
- Ctrl + Shift + i (Windows)
- ⌘ Command + Shift + i (Mac).
- Open the web page in VS Code, VS Code Online or Sublime Text. All are good choices.
- Play around with the JavaScript code. Change things and see what happens.
✅ That’s it.