Search code examples
javascriptbasic

How can i turn BASIC algorithm into javascript?


Do you remember the days when BASIC-S was still used? I was wondering how can I translate this

10 LET a=0
20 LET b=10
30 PRINT a+b
40 LET a=b
50 GOTO 20

into javascript, jquery or something that I can use...


Solution

  • Language are generally interchangeable..

    var a=0;
    
    do
    {
       var b = 10;
       document.write(a+b);
       a=b;
    } while(0)