Heterogeneous arrays

上一篇 / 下一篇  2015-08-03 09:19:29 / 个人分类:JavaScript

Heterogeneous arrays

Now that we've reviewed some array basics, it's time to cover a little new ground.

First, it's not necessary for you to put the same type of data in an array! For instance, you don't have to have

varpronouns = ["I","you","we"];varnumbers = [1,2,3];

You can have a heterogeneous array,which means a mixture of data types, like so:

varmix = [42,true,"towel"];

TAG:

wilber.shinobi的个人空间 引用 删除 wilber.shinobi   /   2015-08-03 09:42:16
var multiDimensionArr = [[1,"towel",true],["hello,world",23,"false"]];
 

评分:0

我来说两句

Open Toolbar