The second one is more expensive as you constantly are creating a new variable. In the first one you just constantly change the value of a variable.