Skip to main content
replaced http://stackoverflow.com/ with https://stackoverflow.com/
Source Link

A couple of observations around these lines…

if fizzBuzz == "" {
    fizzBuzz += "\(i)"
}
  • This seems like an unjustified use of string interpolation. String(i)String(i) would be more direct.
  • Why bother concatenating to an empty string?

With those two changes…

if fizzBuzz == "" {
    fizzBuzz = String(i)
}

A couple of observations around these lines…

if fizzBuzz == "" {
    fizzBuzz += "\(i)"
}
  • This seems like an unjustified use of string interpolation. String(i) would be more direct.
  • Why bother concatenating to an empty string?

With those two changes…

if fizzBuzz == "" {
    fizzBuzz = String(i)
}

A couple of observations around these lines…

if fizzBuzz == "" {
    fizzBuzz += "\(i)"
}
  • This seems like an unjustified use of string interpolation. String(i) would be more direct.
  • Why bother concatenating to an empty string?

With those two changes…

if fizzBuzz == "" {
    fizzBuzz = String(i)
}
Source Link
200_success
  • 145.6k
  • 22
  • 191
  • 481

A couple of observations around these lines…

if fizzBuzz == "" {
    fizzBuzz += "\(i)"
}
  • This seems like an unjustified use of string interpolation. String(i) would be more direct.
  • Why bother concatenating to an empty string?

With those two changes…

if fizzBuzz == "" {
    fizzBuzz = String(i)
}