Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > it.comp.lang.javascript > #8100
| Path | csiph.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail |
|---|---|
| From | Alessandro Pellizzari <shuriken@amiran.it> |
| Newsgroups | it.comp.lang.javascript |
| Subject | Re: Utilizzo variabili |
| Date | Mon, 21 Nov 2016 10:39:04 +0000 |
| Lines | 53 |
| Message-ID | <e9g168Fnnr1U1@mid.individual.net> (permalink) |
| References | <759470d0-4ddc-4fbc-b54d-71bc70272ba2@googlegroups.com> <e8o1djFlc0U1@mid.individual.net> <ed208245-5d31-4902-acab-76f92f1d2548@googlegroups.com> |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset=utf-8; format=flowed |
| Content-Transfer-Encoding | 8bit |
| X-Trace | individual.net Vw9G5I6eOXOYTF7yEHu6ZwQLTbil8c6v5ybyr2mI27rE01nnI= |
| Cancel-Lock | sha1:+xwo6uzoa8lq6lxWoOzUwnGcwCk= |
| User-Agent | Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 |
| In-Reply-To | <ed208245-5d31-4902-acab-76f92f1d2548@googlegroups.com> |
| Xref | csiph.com it.comp.lang.javascript:8100 |
Show key headers only | View raw
On 19/11/2016 10:05, tres.farc@gmail.com wrote:
>> equipe[1] = ['BAYERN MONACO','Monaco di Baviera','Germania'];
>>
>> avversari[1] = [
>> ['JUVENTUS','REAL MADRID','BARCELLONA'],
>> ['1-0','2-2','1-1']
>> ];
>>
>> var equipe = {};
>> var avversari = {};
Qui ho sbagliato, doveva essere
var equipe = [];
var avversari = [];
> Cosa rappresentano "equipe[1]" e "avversari[1]" ??
> Cioe': sono array con il primo indice fisso?? Non capisco
Sono array multidimensionali.
È coma scrivere:
var equipe = [
[],
[
'BAYERN MONACO',
'Monaco di Baviera',
'Germania'
],
[
'PARIS SAINT GERMAIN',
'Parigi',
'Francia'
]
];
> Non è che se chiami:
>
> equipe[1]
>
> non ti salta fuori "Monaco di Baviera" ?
No, ma se chiami equipe[1][1] sì.
Nell'esempio ho saltato l'indice 0, visto che non lo usavi nel tuo
codice, e al suo posto ho messo un array vuoto, quindi equipe[0][1] ti
darà undefined o qualcosa del genere.
Bye.
Back to it.comp.lang.javascript | Previous | Next — Previous in thread | Find similar
Utilizzo variabili tres.farc@gmail.com - 2016-11-11 05:19 -0800
Re: Utilizzo variabili Alessandro Pellizzari <shuriken@amiran.it> - 2016-11-12 08:15 +0000
Re: Utilizzo variabili tres.farc@gmail.com - 2016-11-19 02:05 -0800
Re: Utilizzo variabili Alessandro Pellizzari <shuriken@amiran.it> - 2016-11-21 10:39 +0000
csiph-web