prepare JavaScript variable scope decrease