How to Work with Collections in Other Programming Languages


show more What type of elements can you store in an array? What's the difference between mutable and immutable? In order to explain these topics, it's helpful to look at how collections are organized in other programming languages. Learn how collections work in languages other than JavaScript in this Lynda.com tutorial. show less
please wait ...

Collections in other languages

It's worth a quick detour to talk briefly about collections in other programming languages. Now I don't need to get super specific about each individual language, but there are a few general things you should be aware of. First off, JavaScript allows anything in any element of the array. Numbers, strings, Booleans, you can even have elements undefined. So it supports this mixed data idea, but many languages only allow specific kinds of data in an array. It is an array of strings or an array of integers. You can't have both in the same array and this is probably more common across languages.

Similarly, JavaScript allows us to create an array with say for example three elements, but we can then add to it or even subtract from it. But other languages may want your arrays to be a fixed size. You have to know how big it is before you make it. If you make an array that's five elements long, you can't change it after it's been made. Now there are a couple of words you ma...

Collections in other languages
Video duration: 3m 25s 4h 47m Beginner

Viewers:

What type of elements can you store in an array? What's the difference between mutable and immutable? In order to explain these topics, it's helpful to look at how collections are organized in other programming languages. Learn how collections work in languages other than JavaScript in this Lynda.com tutorial.

Subjects:
Developer Web
Author:
please wait ...