Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- stampa ="la frutta è:<br> \n";
- var frutta = new Array();
- frutta[0] = "banane";
- frutta[1] = "melone";
- frutta[3] = "cocomero";
- frutta[9] = "mela";
- var colori = new Array("verde","rosso","", "blu");
- for(var ind=0; ind<frutta.length; ind++)
- {
- if(frutta[ind])
- {
- stampa += ind + " -> ";
- stampa += frutta[ind];
- stampa += "<br>\n";
- }
- }
- stampa +="<br>i colori sono:<br> \n";
- for(var ind=0; ind<colori.length; ind++)
- {
- if(frutta[ind])
- {
- stampa += ind + " -> ";
- stampa += colori[ind];
- stampa += "<br>\n";
- }
- }
- // ################################### nel file html ############################
- <script type="text/javascript">
- document.write(stampa);
- </script>
Advertisement
Add Comment
Please, Sign In to add comment