javascript - Push and pass array parameter -
javascript - Push and pass array parameter -
i have little recursion routine, , curious how force array item , pass array item in phone call recurse? this:
function recursefunc(element) { var $ = window.jquery; var walkfunc = function(element, apattern) { if($(element).parents('[pattern]')[0]) { homecoming walkfunc($(element).parents('[pattern]')[0], apattern.push($(element).attr('pattern'))); } homecoming concat(apattern,$(element).attr('pattern')); } homecoming walkfunc(element,[]); }
array.push returns count of array , not array object.
javascript
Comments
Post a Comment