I think I may be missing something obvious, but I have been beating my head against the wall with this.
Why does this work?
var vibeData = [new Attention.VibeProfile(50, 2000)];
vibeData.add(new Attention.VibeProfile(0, 2000));
vibeData.add(new Attention.VibeProfile(50, 2000));
vibeData.add(new Attention.VibeProfile(0, 2000));
vibeData.add(new Attention.VibeProfile(50, 2000));
vibeData.add(new Attention.VibeProfile(0, 2000));
vibeData.add(new Attention.VibeProfile(50, 2000));
But this does not?
var vibeData = [new Attention.VibeProfile(50, 2000)];
for( var i = 0; i < 3; i++ ) {
vibeData.add(new Attention.VibeProfile(0, 2000));
vibeData.add(new Attention.VibeProfile(50, 2000));
}
I feel like they should both do the same thing, but when I run it, the second thing crashes, but the first does as expected. Really appreciate the help!