• //strings.js
    
    var A="1234567890";
    var B=A;
    console.log(B);console.log(B.length);
    B=B+B;
    console.log(B);console.log(B.length);
    //out of memory if continued
    //B=B+B;
    //console.log(B);console.log(B.length);
    //B=B+B;
    //console.log(B);console.log(B.length);
    
    B=A;
    console.log(B);console.log(B.length);
    B+=B;
    console.log(B);console.log(B.length);
    B+=B;
    console.log(B);console.log(B.length);
    

    Produces:

    >echo(0);
    1234567890
    10
    12345678901234567890
    20
    1234567890
    10
    12345678901234567890
    20
    ERROR: Out of Memory!
    WARNING: Out of memory while appending to array
    Execution Interrupted
    =undefined
    >
    
About