You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The last example on the page tells the students how to use the pop() function
let arr = ['a', 'b', 'c', 'd', 'e'];
arr.pop();
console.log(arr);
the output being
e
['a', 'b', 'c', 'd']
Only, that's a typo. the pop() function does not write to the console. You should either use console.log(arr.pop()); or remove the logging of the popped element. Combined with the correct usage of push() makes for confusion when learning the difference between returned values and printed values.
(Optional) Screenshot
The text was updated successfully, but these errors were encountered:
Permalink
https://education.launchcode.org/intro-to-professional-web-dev/appendices/array-method-examples/push-and-pop-examples.html#pop
Issue
The last example on the page tells the students how to use the pop() function
the output being
Only, that's a typo. the pop() function does not write to the console. You should either use
console.log(arr.pop());
or remove the logging of the popped element. Combined with the correct usage of push() makes for confusion when learning the difference between returned values and printed values.(Optional) Screenshot
The text was updated successfully, but these errors were encountered: