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

Popular posts from this blog

formatting - SAS SQL Datepart function returning odd values -

c++ - Apple Mach-O Linker Error(Duplicate Symbols For Architecture armv7) -

php - Yii 2: Unable to find a class into the extension 'yii2-admin' -