0

Is there an alternative to the "array_walk_recursive" php function that can be used for node.js?

var test = ['all',{'test':['kest','zest',{'aaa':'bbb'}]},['a',{'b':'c'},{'d':['e','f']}, 'g', ['h', "ı", ['i', 'j', ['k', 'l', {'m': 'n'}]]]]]

something like that data

alp-x
  • 1
  • 3
  • It's not that hard to write one yourself. By the way, are you talking about an ordered array with numbers as keys or not? – D. Pardal Feb 26 '21 at 08:17
  • https://stackoverflow.com/questions/11922383/how-can-i-access-and-process-nested-objects-arrays-or-json – Teemu Feb 26 '21 at 08:17
  • No it is not, I need to see values ​​in a complex structure. Array and Object included. Every value. – alp-x Feb 26 '21 at 08:25
  • 1
    Use [`Array.flat()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/flat) & [`Array.map()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map). Note that "Arrays" in php are "Objects" in js. So you cant compare that 1:1 – Marc Feb 26 '21 at 11:01

0 Answers0