Javascript Array Count Elements In A Vector Is Always An Intermediate