Answer to Question #4617 in AJAX | JavaScript | HTML | PHP for Kristy667

Question #4617
What is the difference between arrays and variables?
1
Expert's answer
2011-10-13T10:30:02-0400
A variable is a container for a single number. A variable can be thought of as a box, the number of items in the box determines the value of the box, and the type of items in the box must be uniform.
An array is a collection of such boxes aligned together. The analogy is a medicine box that is specially designed so that it can only hold a specific type of medicine. Each partition in the box can contain any number of medicine (as long as the capacity permits), but you can only put in the medicine that the box is designed for. In an array, we use "index" to address each partition, an index is a number that uniquely identifies each partition in the medicine box.

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
APPROVED BY CLIENTS