Javascript - NommerDynamiquementDesVariables
Fermé
Denoramco
-
1 juin 2011 à 23:03
Dr.W Messages postés 390 Date d'inscription jeudi 15 avril 2010 Statut Membre Dernière intervention 29 juin 2011 - 1 juin 2011 à 23:11
Dr.W Messages postés 390 Date d'inscription jeudi 15 avril 2010 Statut Membre Dernière intervention 29 juin 2011 - 1 juin 2011 à 23:11
A voir également:
- Javascript - NommerDynamiquementDesVariables
- Telecharger javascript - Télécharger - Langages
- Afficher un tableau javascript en html ✓ - Forum Javascript
- Node.js javascript runtime virus ✓ - Forum Virus
- Erreur #125 javascript - Forum Mozilla Firefox
- A javascript error occurred in the main process - Forum Handicap / Accessibilté
1 réponse
Dr.W
Messages postés
390
Date d'inscription
jeudi 15 avril 2010
Statut
Membre
Dernière intervention
29 juin 2011
40
Modifié par Dr.W le 1/06/2011 à 23:12
Modifié par Dr.W le 1/06/2011 à 23:12
Il faut te faire un tableau et non declarer plein de variable ;)
https://www.commentcamarche.net/contents/587-javascript-les-tableaux
<<<<<< CODE >>>>>>
var tablo
function multiplication(chiffre) {
var i=0
while (i<=10) {
resultat=chiffre*i;
tablo[i]=(chiffre+" x "+i+"="+resultat+"<br>");
i++
}
}
chiffre=prompt("Entrez un chiffre");
multiplication(chiffre);
<<<<<< CODE >>>>>>
https://www.commentcamarche.net/contents/587-javascript-les-tableaux
<<<<<< CODE >>>>>>
var tablo
function multiplication(chiffre) {
var i=0
while (i<=10) {
resultat=chiffre*i;
tablo[i]=(chiffre+" x "+i+"="+resultat+"<br>");
i++
}
}
chiffre=prompt("Entrez un chiffre");
multiplication(chiffre);
<<<<<< CODE >>>>>>