Why Chrome’s Developer Console Sometimes Lies
Don’t let lazy evaluation trip up your JavaScript logging code

Let’s start with something straightforward. Here’s a JavaScript snippet that creates a small array of numbers, then changes it. The array is logged to the console, both before and after the change:
const numbers = [2, 3, 4, 5];
console.log(numbers);