I tried a basic Blink example and I found a strange case where :
Can someone explain me what is happening ?
Arduino Stack Exchange is a question and answer site for developers of open-source hardware and software that is compatible with Arduino. It only takes a minute to sign up.Sign up to join this community
It is because the rail in the middle breaks the vertical connections. So the positive leg in the first example is not connected to the negative leg of the LED.
In your second example both the negative leg and the positive leg are connected on the same rail, because of the that the power is not flowing through the LED but directly back to the GND pin of your arduino.
Same for the resistor. Since both legs are connected to the same rail, the resistor has no effect.