The key difference is the Array. See more about arrays here Everything You Wanted to Know About App Lab Arrays, But Were Afraid to Ask Scroll down to “One more thing to know about arrays: How they work as arguments.”
Short answer: App Lab is call by value. If you change the value you change it everywhere. Objects are values that can be changed. An Array is an Object.
Numbers are values too, but they cannot be changed. You can only create a brand new one. Therefore it doesn’t get changed everywhere.