Comment

Comment by trombonechamp

The section on assignment operators is incorrect. x += y modifies the object x, whereas x = x + y doesn't. For example,

  >> a = [1, 2, 3]
  >> b = a
  >> a += [4]
  >> a
  [1, 2, 3, 4]
  >> b
  [1, 2, 3, 4]
By comparison,

  >> a = [1, 2, 3]
  >> b = a
  >> a = a + [4]
  >> a
  [1, 2, 3, 4]
  >> b
  [1, 2, 3]

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton