+ 3
Numbering sentences
Today I am trying to number the sentences of a text, what is missing? : var text = "ABC.DEF.XYZ"; for (i = 0, i < text.length, i++) { var response = text.split(".").join(" i "); } alert(response);
2 Answers
+ 2
var text = "ABC.DEF.XYZ";
var arr = text.split(".");
var response = "";
for (i = 0;i<arr.length;i++) {
response += i + arr[i];
}
alert(response);
https://code.sololearn.com/WbOBS0Ss7WW2/?ref=app
+ 1
Thank You very much :)