Open in app
Dler Ari
3.2K Followers
About

Sign in

3.2K Followers
About
Open in app
Dler Ari

Dler Ari

Jun 9, 2018·1 min read

Good question, someone have asked similar question on Stackoverflow.

for (const property in object) works because with each iteration you get a new variable, which is scoped only to that iteration

Dler Ari

Software Engineer sharing interesting tech topics

Here “item” change through the loop. So why is it declared as “const” ?
22
1

Nizar AYED

  • JavaScript
  • ES6

More from Dler Ari

Software Engineer sharing interesting tech topics

More From Medium

Functions in TypeScript

Dler Ari in Better Programming

Manage Form State with React Final Form

gravity well (Rob Tomlin) in JavaScript in Plain English

Casting in C# — Do type conversion the proper way

Dler Ari in Better Programming

A practical ES6 guide on how to perform HTTP requests using the Fetch API

Dler Ari in freeCodeCamp.org

Five Simple Ways to Produce High-Quality Code

Dler Ari in The Startup

What’s So Scary About Recursion?

Adam Henley (He/Him)

Finding Programming Boring? Here Are 5 Ways to Make It Enjoyable

Dler Ari in Better Programming

Interfaces in C# -Write reusable and maintainable code that scales

Dler Ari in codeburst

About

Help

Legal

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