0

Necesito un array que cuente las letras que ingreso

25th Aug 2017, 11:32 AM
[No Name]
[No Name] - avatar
4 Antworten
+ 3
@Alexito De nada :)
27th Aug 2017, 9:27 PM
Aarón Fortuño Ramos
Aarón Fortuño Ramos - avatar
+ 2
English translation: "I need an array that count the characters that I enter" in JS: var string = prompt('write your sentence here'); var array = []; for (var i=0; i<string.length; i++) { array.push(string[i]); } alert(array.length); Or maybe: var string = prompt('write your sentence here'); var array = string.split(''); // I'm not sure that this works, somebody experienced here? alert(array.length); Do you need to count how many times every character appears? Then is a little larger code.
25th Aug 2017, 12:59 PM
Aarón Fortuño Ramos
Aarón Fortuño Ramos - avatar
0
gracia
27th Aug 2017, 8:21 PM
[No Name]
[No Name] - avatar
0
gracias
27th Aug 2017, 8:21 PM
[No Name]
[No Name] - avatar