diff --git a/live-examples/js-examples/array/array-reverse.html b/live-examples/js-examples/array/array-reverse.html index 67082c9ec..5148acc71 100644 --- a/live-examples/js-examples/array/array-reverse.html +++ b/live-examples/js-examples/array/array-reverse.html @@ -1,11 +1,15 @@
var array1 = ['one', 'two', 'three'];
-var reversed = array1.reverse();
+console.log('array1: ', array1);
+// expected output: Array ['one', 'two', 'three']
-console.log(array1);
+var reversed = array1.reverse();
+console.log('reversed: ', reversed);
// expected output: Array ['three', 'two', 'one']
-console.log(reversed);
+/* Careful: reverse is destructive. It also changes
+the original array */
+console.log('array1: ', array1);
// expected output: Array ['three', 'two', 'one']