HISE Logo Forum
    • Categories
    • Register
    • Login
    1. HISE
    2. Tags
    3. array
    Log in to post
    • All categories
    • d.healeyD

      How to merge complex arrays of objects?

      Watching Ignoring Scheduled Pinned Locked Moved Scripting array merge recursive object combine
      4
      0 Votes
      4 Posts
      257 Views
      d.healeyD

      Slightly related, I've added an Object.keys function to the scripting API. Also works on arrays but will return an empty array in that case.

      https://github.com/christophhart/HISE/pull/695?new_mergebox=false

    • ustkU

      Array.find weird result

      Watching Ignoring Scheduled Pinned Locked Moved Scripting array find array.find
      4
      0 Votes
      4 Posts
      336 Views
      d.healeyD

      @ustk

      Yeah I'd just use a loop. I'm not sure why find is not doing what's expected though... Also you don't need to set the second parameter as myArray because that's already there in the third parameter of the test function.

      This is what I would do

      local myArray = [0, 5, 10, 15, 20]; local element; for (x in myArray) { if (sample <= x) { element = x; break; } }