Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #35627

Re: Splice array of arrays with objects.

Newsgroups comp.lang.javascript
Date 2018-09-22 03:09 -0700
References <c3fce846-0dec-495b-992b-6a75a1bb974c@googlegroups.com> <a08d4842-238e-4652-b37e-c88ccdd556c0@googlegroups.com> <c4a7b9f8-0c35-44cf-b600-b92a78fca3e9@googlegroups.com>
Message-ID <12005e89-e46e-42b7-a15a-ee21279e4ed2@googlegroups.com> (permalink)
Subject Re: Splice array of arrays with objects.
From Jonas Thörnvall <jonas.thornvall@gmail.com>

Show all headers | View raw


Den lördag 22 september 2018 kl. 12:07:09 UTC+2 skrev Jonas Thörnvall:
> Den lördag 22 september 2018 kl. 11:45:11 UTC+2 skrev Julio Di Egidio:
> > On Saturday, 22 September 2018 11:17:06 UTC+2, Jonas Thörnvall  wrote:
> > 
> > >  track[recTrack].midiMess.splice(trackEvent,1);
> > > track[recTrack].midiMess.data0.splice(trackEvent,0,"144"); //Well how?
> > 
> > > Is there something i miss, because it tells me undefined?
> > 
> > What tells you undefined??  You should get a JS error saying reference undefined or null or something, and where.  Note that your sloppiness is
> > our extra effort...
> > 
> > That said, I just note that above you are splicing midiMess, below you are
> > splicing midiMess.dataN.  Does that make sense?
> > 
> > Julio
> 
> I think so? This is my track object.
> 
> function newTrack(m) {
>    track[m] ={
>      outport:[],
>      portname : [],
>      midichannel:[],
>      program:[],
>      midiMess:[],
>      //CONFIGURATION OF midiMess:[{time:0,data0:0,data1:0,data2:0}]
>    };
>     return track;
> }
> 
> Here is how i update the track.
>  track[tracknr].midiMess.push({time:clock,data0:message.data[0],data1:message.data[1],data2:message.data[2]});
> }
> 
> I mean it make sense to remove the full object "Event element" midiMess.
> But thought i could splice objects of midiMess one at a time, but maybe i must update them all like when doing push new object?

track[tracknr].midiMess.splice({time:clock,data0:message.data[0],data1:message.data[1],data2:message.data[2]});

?

Back to comp.lang.javascript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Splice array of arrays with objects. Jonas Thörnvall <jonas.thornvall@gmail.com> - 2018-09-22 02:16 -0700
  Re: Splice array of arrays with objects. Julio Di Egidio <julio@diegidio.name> - 2018-09-22 02:45 -0700
    Re: Splice array of arrays with objects. Jonas Thörnvall <jonas.thornvall@gmail.com> - 2018-09-22 03:07 -0700
      Re: Splice array of arrays with objects. Jonas Thörnvall <jonas.thornvall@gmail.com> - 2018-09-22 03:09 -0700
        Re: Splice array of arrays with objects. Jonas Thörnvall <jonas.thornvall@gmail.com> - 2018-09-22 03:15 -0700
          Re: Splice array of arrays with objects. JJ <jj4public@vfemail.net> - 2018-09-23 05:44 +0700
            Re: Splice array of arrays with objects. Jonas Thörnvall <jonas.thornvall@gmail.com> - 2018-09-22 15:51 -0700
            Re: Splice array of arrays with objects. Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2018-09-23 09:28 +0200
              Re: Splice array of arrays with objects. Jonas Thörnvall <jonas.thornvall@gmail.com> - 2018-09-23 02:01 -0700
                Re: Splice array of arrays with objects. Jonas Thörnvall <jonas.thornvall@gmail.com> - 2018-09-23 02:03 -0700
      Re: Splice array of arrays with objects. Jonas Thörnvall <jonas.thornvall@gmail.com> - 2018-09-22 03:24 -0700
        Re: Splice array of arrays with objects. Jonas Thörnvall <jonas.thornvall@gmail.com> - 2018-09-22 03:28 -0700
          Re: Splice array of arrays with objects. Jonas Thörnvall <jonas.thornvall@gmail.com> - 2018-09-22 03:43 -0700
        Re: Splice array of arrays with objects. Julio Di Egidio <julio@diegidio.name> - 2018-09-22 03:40 -0700
          Re: Splice array of arrays with objects. Jonas Thörnvall <jonas.thornvall@gmail.com> - 2018-09-22 03:47 -0700
            Re: Splice array of arrays with objects. Julio Di Egidio <julio@diegidio.name> - 2018-09-22 04:00 -0700
              Re: Splice array of arrays with objects. Jonas Thörnvall <jonas.thornvall@gmail.com> - 2018-09-22 04:02 -0700
              Re: Splice array of arrays with objects. Jonas Thörnvall <jonas.thornvall@gmail.com> - 2018-09-22 04:03 -0700
                Re: Splice array of arrays with objects. Julio Di Egidio <julio@diegidio.name> - 2018-09-22 04:09 -0700
                Re: Splice array of arrays with objects. Jonas Thörnvall <jonas.thornvall@gmail.com> - 2018-09-22 04:21 -0700
                Re: Splice array of arrays with objects. Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2018-09-22 16:17 +0200
                Re: Splice array of arrays with objects. Jonas Thörnvall <jonas.thornvall@gmail.com> - 2018-09-22 09:30 -0700
                Re: Splice array of arrays with objects. Jonas Thörnvall <jonas.thornvall@gmail.com> - 2018-09-22 04:45 -0700
              Re: Splice array of arrays with objects. Jonas Thörnvall <jonas.thornvall@gmail.com> - 2018-09-22 04:16 -0700
          Re: Splice array of arrays with objects. Jonas Thörnvall <jonas.thornvall@gmail.com> - 2018-09-22 04:00 -0700

csiph-web