Quantcast
Channel: Ionic Framework - Ionic Forum
Viewing all articles
Browse latest Browse all 49186

Absurd behavior of Array.push()

$
0
0

@lucapale wrote:

I have upgraded to the last ionic and angular bundles:

Cordova CLI: 5.3.1
Gulp version:  CLI version 3.9.0
Gulp local:  
Ionic Version: 1.1.0
Ionic CLI Version: 1.6.4
Ionic App Lib Version: 0.3.8
ios-deploy version: 1.7.0 
ios-sim version: 4.1.1 
OS: Mac OS X Yosemite
Node Version: v0.12.7
Xcode version: Xcode 7.0 Build version 7A220

and now my app, which was previously working, has a crazy behavior with all Array.push() function.
In particular it seems that the push does not work anymore on any Array. In fact with this code:

var obj = { arr: [] }
var other_arr = []
for (var i=0;i<10;i++) {
	obj.arr.push(i)
	other_arr.push(i)
}
console.log(obj , obj.arr , other_arr )

In the log I can see the correct array inside the obj variable, but both obj.arr and other_arr return an empty array.

Any idea of what could have happened or how I can debug it??

Thanks
Luca

Posts: 2

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 49186

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>