# İonic for loop don't stop localstorage get line

**URL:** <https://forum.ionicframework.com/t/ionic-for-loop-dont-stop-localstorage-get-line/99438>\
**Category:** ionic-v3\
**Created:** [July 25, 2017, 8:58am UTC](https://forum.ionicframework.com/t/ionic-for-loop-dont-stop-localstorage-get-line/99438 "2017-07-25T08:58:30Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Asocialcoder](https://avatars.discourse-cdn.com/v4/letter/a/a698b9/32.png) [@Asocialcoder](https://forum.ionicframework.com/u/Asocialcoder)\
**Post date:** [July 25, 2017, 8:58am UTC](https://forum.ionicframework.com/t/ionic-for-loop-dont-stop-localstorage-get-line/99438/1 "2017-07-25T08:58:30Z")

</div>

Hi guys. my problem is ;

for loop dont stop this.storage.get line , storage got me veriable when i=3 , how can i stop this.storage.get line for loop

```auto
for(var i = 0 ;;i++)
          {
              if(!this.veri.element_list['element_name_' + (i)])
                    break;   
              
               this.storage.get(this.veri.element_list['element_id_' + (i)]).then(datas=>{
               this.veriler.push({elementname: this.veri.element_list['element_name_' + (i)],elementid: this.veri.element_list['element_id_' + (i)], gorunum: datas});  
                console.log(this.veri.element_list['element_name_' + (i)]);
              });            
          }

```

---

<div class="post-metadata">

**Author:** ![FnnHuman](https://avatars.discourse-cdn.com/v4/letter/f/5f8ce5/32.png) [@FnnHuman](https://forum.ionicframework.com/u/FnnHuman)\
**Post date:** [July 25, 2017, 10:58am UTC](https://forum.ionicframework.com/t/ionic-for-loop-dont-stop-localstorage-get-line/99438/2 "2017-07-25T10:58:36Z")

</div>

i dont understand your question

---

<div class="post-metadata">

**Author:** ![rapropos](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/rapropos/32/100227_2.png) [@rapropos](https://forum.ionicframework.com/u/rapropos)\
**Post date:** [July 25, 2017, 8:28pm UTC](https://forum.ionicframework.com/t/ionic-for-loop-dont-stop-localstorage-get-line/99438/3 "2017-07-25T20:28:08Z")

</div>

Can you back up and explain the larger goal? The code sample you have provided strikes me as extremely odd.
