- #1
deltapapazulu
- 84
- 12
Thread moved from the technical forums to the schoolwork forums
Summary:: I need to loop through a number of strings replacing the numerals in them with an array element so that e.g.: flos1Field, flos2Field, flos3Field, etc. become flosAField, flosBField, flosCField. The array would be something like: const letters = ["A", "B", "C"];
I put the question in title that way b/c easier to understand as a forum post title BUT this is actually what I need.
In the following code (see at bottom), how would I replace the underscore bounded 'a' in:
'flosType_a_withMacron()'
with array element:
?
Also how replace the 'ā' in:
putMacronedLetter("ā");
with:
?
Thank you. Sorry had to use code tags for those because the bracket with 'i' in it was disappearing. How do I type a bracket with 'i' in it in regular formatted text here without it disappearing?
I put the question in title that way b/c easier to understand as a forum post title BUT this is actually what I need.
In the following code (see at bottom), how would I replace the underscore bounded 'a' in:
'flosType_a_withMacron()'
with array element:
JavaScript:
flos_Vowels[i]
Also how replace the 'ā' in:
putMacronedLetter("ā");
with:
JavaScript:
flos_MacronedVowels[i]
Thank you. Sorry had to use code tags for those because the bracket with 'i' in it was disappearing. How do I type a bracket with 'i' in it in regular formatted text here without it disappearing?
JavaScript:
const flos_Vowels = ["a","b","c","d","e"];
const flos_MacronedVowels = ["ā","ē","ī","ō","ū"];
for(let i = 0;i < 5;i++ )
{
function flosType_a_withMacron()
{
putMacronedLetter("ā");
moveCursorToEnd(element);
}
}