I am trying to understand source code from ionic codePen: http://codepen.io/ionic/pen/rxysG The developer has used the following piece of code in his demo:
$scope.messages = messageOptions.slice(0, messageOptions.length);
Why the developer didn't write:
$scope.messages = messageOptions; //messageOptions is an array defined in the code which you can check from the codepen link that I have pasted.