# Use of variable in Julia REPL

**URL:** <https://discourse.julialang.org/t/use-of-variable-in-julia-repl/24843>\
**Category:** General Usage\
**Created:** [June 1, 2019, 11:32pm UTC](https://discourse.julialang.org/t/use-of-variable-in-julia-repl/24843 "2019-06-01T23:32:32Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![kevbonham](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kevbonham/32/216165_2.png) [@kevbonham](https://discourse.julialang.org/u/kevbonham)\
**Post date:** [June 2, 2019, 1:06am UTC](https://discourse.julialang.org/t/use-of-variable-in-julia-repl/24843/2 "2019-06-02T01:06:39Z")

</div>

Loops have their own scope as of Julia 1.0. I’m a bit puzzled about why the first loop works, but there’s tons of discussion about this, cf [this](https://github.com/JuliaLang/julia/issues/28789), [this](https://discourse.julialang.org/t/new-scope-solution/16707), and [this](https://discourse.julialang.org/t/another-possible-solution-to-the-global-scope-debacle/15894). I’ll bet the answer lies somewhere in there, but hopefully someone else can explain.

(Note though that (I don’t think) either of those solutions I linked were implemented)

---

_[View the full topic](https://discourse.julialang.org/t/use-of-variable-in-julia-repl/24843)._
