Young Coder
Published in

Young Coder

Why Chrome’s Developer Console Sometimes Lies

Don’t let lazy evaluation trip up your JavaScript logging code

Made with Icons8

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);

--

--

--

Insights into the .NET stack. Thought pieces about the craft of software development. Real advice for teaching kids to code. And a shot of humor.

Recommended from Medium

React + Firebase Hosting + GCP Cloud Build

Difference between minX vs origin.x

Dynamo for Civil Infrastructure

Pros and Cons of BP Logix - with a BP Logix Alternative

Trough of Disillusionment

IBM Data Science certificate alone is not enough to be career ready.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Matthew MacDonald

Matthew MacDonald

Teacher, coder, long-ago Microsoft MVP. Author of heavy books. Join Young Coder for a creative take on science and technology. Queries: matthew@prosetech.com

More from Medium

Fairy Tales, and the Implications of Immutability

Microsoft Edge Deepens Its Integration with VS Code

4 Ways to Remove Changes From Remote Branch in GIT

JavaScript diagram editor that renders diagrams from PNG images (open source)