看起来很简单,但我找不到任何东西!
var cookie = [1,2,3],
total = cookie.magicMethodThatICantFindThatTotalsTheElements();
total = 3
最佳答案
属性(property)length
指定数组中元素的数量:
var total = cookie.length;
关于jQuery 数组中元素的总数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13001205/