We know two ways of storing data types. We can use variables or arrays. We use variables to store data (like strings or numbers) that we’d later want to access.
An array is exactly the same as a variable in that it stores data. The difference is that an array can store many more values while a variable can only store one.
To access arrays, we use bracket notation and remember that arrays use 0-based indexing (i.e., the first value in an array is at position 0).
Instructions
Look at the array
multiplesOfEight
, and find the one that doesn't fit.
Replace
X
in line 6 such that the variableanswer
is assigned the Boolean value of true
.
No comments:
Post a Comment