How to set variable variable like PHP in JS?

  • 0
    I just can't get it to the next one:
    There is a need to organize nesting in js to fill out a huge table form without reloading the page. The problem is this: the first level is easy - ABCD ... Z. Then the problems begin. To make nesting like AaAb, BaBb ... ZaZb, then you need to somehow loop through the alphabet for each letter. Hence the question: how to set a variable so that for each letter it preserves the sequence a-z and does not intersect.

    For one letter:
    var Possibleletters = 'abcdefghijklmnopqrstuvwxyz';
    var currLetter = 'a';
    id - буквы от A до Z
    function add(id,level){
            var nextIndex = Possibleletters.indexOf(сurrLetter) + 1;
            сurrLetter = Possibleletters[nextIndex];
         дальше уже пофик  
        };
    JavaScript Colin Koch, May 8, 2019

  • 1 Answers
  • 0
    for such purposes and those that use maps and sets even better
    Arabella Skinner

Your Answer
To place the code, please use CodePen or similar tool. Thanks you!