title: When command line order matters?
body: <p>I'm new to coding so apologies (and please correct me) if I use wrong terminology. I was doing the following coding challenge: Given an array with multiple values, write a function that returns a new array that only contains the maximum, minimum, and average values of the original array. </p>
  
  <p>This is the code I came up with during my first attempt: 
  <a href="https://gist.github.com/anonymous/b19bca3754a79b53f43fa556412607ff" rel="nofollow">First attempt</a></p>
  
  <p>Eventually I figured out through trial and error that the problem was the location of my arrnew variable. I also fixed the average Expression and the correct algorithm is: <a href="https://gist.github.com/anonymous/3b8a5a1b52365242d3c3302217a2cc45" rel="nofollow">Correct algorithm</a></p>
  
  <p>I assumed that since the max, min, and avg were changing (is there a better term for this?), the var arrnew would pick up these new values but obviously that wasn't the case. I guess my question is when does line order matter? Or probably more specifically, are there any simple rules or principles I should be aware of to help me better understand command line coding (I dont know if this is called command line coding). </p>
  
  <p>Thanks</p>