I'm learning JavaScript and just came across something I'm not understanding.
let x = 3;
const y = x++;
console.log(x);
The console logs 4. Why is x logged as 4, when y is a separate variable and seemingly not affecting x? Is x++ not simply being assigned to y? And in that case, why would the value of x be changed?