• You're just executing a string of code, so you're just adding strings together to make one big bit of text (which happens to also be a JavaScript command) - it's like you'd have if you were working with Strings in any language:

    i=0;
    print('digitalWrite(segs[i], 0)') prints digitalWrite(segs[i], 0)
    print('digitalWrite(segs['+i+'], 0)') prints digitalWrite(segs[0], 0)
    
About

Avatar for Gordon @Gordon started