Seems like a simple thing but I cant find anything on it!
var cookie = [1,2,3],
total = cookie.magicMethodThatICantFindThatTotalsTheElements();
total = 3
Property length
specifies the number of elements in array:
var total = cookie.length;