LinkedIn principal author Doug Winnie explains how to group values together as a single unit called an array. An array allows groups of objects to be referenced using a single name, and each individual item within the array can be uniquely accessed using an element index number. Arrays are one of many types of groups or collections that are part of programming languages.
- View Offline
- When you're working with values…you might want to track something…like a price for a product,…a square for a game, or some other value,…but often you want to store a collection of something…or a group of values that you can refer to as a single name.…In programming there are several ways to create groups.…One of the most common is to create an array.…An array is a collection of individual values.…For instance, I might have a collection of sales numbers…or ID numbers for a group of people.…
In an array these items are grouped together…and are able to be referred to using a single name.…This name represents the entire group,…but each item or element inside…has a unique address within the group…that allows programmers to refer to specific items…in the array.…As you build the array…you can think of it like an egg carton.…Each value you put into it has a slot.…If you take egg carton and give each slot a number…you can then refer to the object that is in that slot…using the number of the slot the value is in.…
So I can have an array that has 12 slots,…
Join Doug Winnie as he explains the principles of programming and helps you connect to core concepts by exploring three ways that programmers perform their jobs. Doug starts by sharing the history of coding and then dives into functions, values, variables, and parameters used to define actions. He covers capturing input from users, creating conditional tests, using loops with arrays, and object-oriented programming basics. He also takes you beyond programming, into processes like debugging, refactoring, and building iteratively.
- Working with values and variables
- Breaking down tasks
- Customizing functions and parameters
- Building conditional tests
- Creating and changing arrays
- Working with objects and classes
- Debugging and refactoring code
- Going beyond the code as a programmer