# Local x,y makes both x and y local?

**URL:** <https://discourse.julialang.org/t/local-x-y-makes-both-x-and-y-local/16932>\
**Category:** General Usage\
**Tags:** question\
**Created:** [October 29, 2018, 7:30pm UTC](https://discourse.julialang.org/t/local-x-y-makes-both-x-and-y-local/16932 "2018-10-29T19:30:28Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![e3c6](https://avatars.discourse-cdn.com/v4/letter/e/e79b87/32.png) [@e3c6](https://discourse.julialang.org/u/e3c6)\
**Post date:** [October 29, 2018, 7:30pm UTC](https://discourse.julialang.org/t/local-x-y-makes-both-x-and-y-local/16932/1 "2018-10-29T19:30:28Z")

</div>

When I write `local x,y = ...`, this means that _both_ `x` and `y` are `local`? Can someone confirm this? Ideally pointing to somewhere in the documentation where this is clarified. Thanks.

---

<div class="post-metadata">

**Author:** ![fredrikekre](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/fredrikekre/32/1688_2.png) [@fredrikekre](https://discourse.julialang.org/u/fredrikekre)\
**Post date:** [October 29, 2018, 9:24pm UTC](https://discourse.julialang.org/t/local-x-y-makes-both-x-and-y-local/16932/2 "2018-10-29T21:24:45Z")

</div>

Easy to conduct experiment:

```julia
julia> function foo()
           x, y = 0, 0
           for i in 1:2
               local x, y = i, i
           end
           return x, y
       end
foo (generic function with 2 methods)

julia> foo()
(0, 0)

```

so yes.
