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


Groups > comp.lang.javascript > #29419 > unrolled thread

Still trouble with array of arrays.

Started byjonas.thornvall@gmail.com
First post2016-01-23 14:25 -0800
Last post2016-01-23 23:51 +0100
Articles 3 — 2 participants

Back to article view | Back to comp.lang.javascript


Contents

  Still trouble with array of arrays. jonas.thornvall@gmail.com - 2016-01-23 14:25 -0800
    Re: Still trouble with array of arrays. jonas.thornvall@gmail.com - 2016-01-23 14:49 -0800
      Re: Still trouble with array of arrays. Stefan Weiss <krewecherl@gmail.com> - 2016-01-23 23:51 +0100

#29419 — Still trouble with array of arrays.

Fromjonas.thornvall@gmail.com
Date2016-01-23 14:25 -0800
SubjectStill trouble with array of arrays.
Message-ID<8d147825-0837-4f7a-8cb9-bb5607dc0ae1@googlegroups.com>
 for(i = 0; i < operandArr.length; i ++ )
   {
      metaOpArr[i] = operandArr[i].split("").map(Number).reverse();
   }

If operandArr=[12,5,28] will not metaOpAr[8] contain 2,1 and be an array in itself?

[toc] | [next] | [standalone]


#29420

Fromjonas.thornvall@gmail.com
Date2016-01-23 14:49 -0800
Message-ID<c40244a0-013c-4e06-8908-cfeccb96eee0@googlegroups.com>
In reply to#29419
Den lördag 23 januari 2016 kl. 23:25:50 UTC+1 skrev jonas.t...@gmail.com:
> for(i = 0; i < operandArr.length; i ++ )
>    {
>       metaOpArr[i] = operandArr[i].split("").map(Number).reverse();
>    }
> 
> If operandArr=[12,5,28] will not metaOpAr[8] contain 2,1 and be an array in itself?

metaOpArr[0] contain 2,1 and be an array in itself?

[toc] | [prev] | [next] | [standalone]


#29421

FromStefan Weiss <krewecherl@gmail.com>
Date2016-01-23 23:51 +0100
Message-ID<n81063$1bt$1@news.albasani.net>
In reply to#29420
On 01/23/2016 23:49, jonas.thornvall@gmail.com wrote:
> Den lördag 23 januari 2016 kl. 23:25:50 UTC+1 skrev jonas.t...@gmail.com:
>> for(i = 0; i < operandArr.length; i ++ )
>>    {
>>       metaOpArr[i] = operandArr[i].split("").map(Number).reverse();
>>    }
>>
>> If operandArr=[12,5,28] will not metaOpAr[8] contain 2,1 and be an array in itself?
> 
> metaOpArr[0] contain 2,1 and be an array in itself?

No, because numbers don't have a split() method. If operandArr is ["12",
"5", "28"] instead, then metaOpArr[0] is indeed the array [2, 1].

I don't know it that's good or bad, because you forgot to tell us what
your trouble with arrays is, and what you want the code to do.

- stefan

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.javascript


csiph-web