Likely because it's inconsistent with all other parts of the language where trailing commas are not allowed
function foo(x,) {}
def foo(x,): pass
Before anyone questions why anyone would do this, it's for putting arguments (or array elements) on separate lines: function foo(
a,
b,
c,
) {}Also, last I remember in JS a trailing comma meant the creation of an extra array element that’s null so I became conditioned to only use trailing commas for separators in languages where it’s consistent and specified very explicitly like in HCL
w = 0, # w == (0,)
(x) = (0,) # x == (0,)
y, = 0, # y == 0
(z,) = (0,) # z == 0
Though in Rust, parentheses are required for tuple creation and destructuring.Why? Because whenever there's a new value added, git diff shows single line change :)