Tell us what’s happening:
Can someone tell me, what is the wrong in this code ? The output throws an error, “s should be equal to [2, 5, 7]”
Your code so far
const s = [5, 7, 2];
function editInPlace() {
"use strict";
// change code below this line
s.push('s.pop()');
console.log(s);
// change code above this line
}
editInPlace();
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36
.
Link to the challenge:
https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/es6/mutate-an-array-declared-with-const/