Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.javascript > #35656
| Newsgroups | comp.lang.javascript |
|---|---|
| Date | 2018-09-23 02:03 -0700 |
| References | (3 earlier) <12005e89-e46e-42b7-a15a-ee21279e4ed2@googlegroups.com> <f4465779-f23d-4505-abaa-d521a367aa82@googlegroups.com> <1r7wmrgj91rxt.1984rnv8kl648.dlg@40tude.net> <c4b89388-1192-98aa-bff1-aa5e1708b4e2@PointedEars.de> <a7490caa-6cba-4af4-8cf8-f86be77e08c4@googlegroups.com> |
| Message-ID | <e31ed834-df9b-424f-a2bf-3a115fa7114d@googlegroups.com> (permalink) |
| Subject | Re: Splice array of arrays with objects. |
| From | Jonas Thörnvall <jonas.thornvall@gmail.com> |
Den söndag 23 september 2018 kl. 11:01:11 UTC+2 skrev Jonas Thörnvall:
> Den söndag 23 september 2018 kl. 09:28:32 UTC+2 skrev Thomas 'PointedEars' Lahn:
> > JJ wrote:
> > > On Sat, 22 Sep 2018 03:15:18 -0700 (PDT), Jonas Thörnvall wrote:
> > >>> track[tracknr].midiMess.splice({time:clock,data0:message.data[0],data1:message.data[1],data2:message.data[2]});
> > >>>
> > >>> ?
> > >> Uncaught TypeError: Cannot read property 'splice' of undefined
> > >> at noteInsert (listtrack.js:12)
> > >> at HTMLButtonElement.onclick (midi.html:133)
> > >
> > > That's not `splice()` which returns `undefined`. It's the `midiMess` which
> > > is not defined in `track[tracknr]`. Chances are that the `midiMess` property
> > > got reassigned with other value.
> > >
> > > Try adding a setter function to that property, and make the setter function
> > > raise an exception or issue the `debugger` statement, so that whichever code
> > > modifies it (the property, not the array contents), will be known.
> >
> > True. But if “splice” refers to the standard (ECMAScript) method,
> > “Array.prototype.splice”, then it simply does not work this way: the first
> > argument has to be the zero-based *index* where to start modifying an
> > *Array-like* object; i.e., a *Number* value that is *an integer* (and NOT an
> > Object value where the object obviously has no suitable valueOf() method):
> >
> > <https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/splice>
> >
> > JavaScript 101.
> >
> >
> > PointedEars
> > --
> > Prototype.js was written by people who don't know javascript for people
> > who don't know javascript. People who don't know javascript are not
> > the best source of advice on designing systems that use javascript.
> > -- Richard Cornford, cljs, <f806at$ail$1$8300dec7@news.demon.co.uk>
>
> I've already told you i've solved it you lowIQ idiot.
> track[tracknr].midiMess[trackEvent].splice(0,{time:instime,data0:144,data1:insnote,data2:insvel});
But i also told you that the whole syntax is fucked up.
because the index is a property of the array, not of the object you fucking moron.
track[tracknr].midiMess[trackEvent].splice(0,{time:instime,data0:144,data1:insnote,data2:insvel});
Back to comp.lang.javascript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll 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