+ 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);

9th Jun 2019, 4:09 AM
Matthew S.
Matthew S. - avatar
2 odpowiedzi
+ 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
9th Jun 2019, 4:33 AM
Calviղ
Calviղ - avatar
+ 1
Thank You very much :)
9th Jun 2019, 4:44 AM
Matthew S.
Matthew S. - avatar