If I have the following code in Javascript:
var line0 = [["2012-07-01",1.8182],["2012-08-01",1.4000],["2012-09-01",1.7500]];
How can I obtain the first date, which in this case is: "2012-07-01"
Thanks in advance.
这是0
的数组个元素也就是0
的个元素line0
,所以:
line0[0][0]
这是代码:
var date = line0[0][0];
You can do it like that:
<script type="text/javascript">
var line0 = [["2012-07-01",1.8182],["2012-08-01",1.4000],["2012-09-01",1.7500]];
alert(line0[0][0]);
</script>
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.