Tell us what’s happening:
Hello everyone,
I’m currently working on Exercise 28 of the JavaScript course, and I’m encountering an issue with the instructions. The exercise asks me to assign the return value of rows.push(“freeCodeCamp”) to a variable pushed and log it to the console.
Here’s my code:
let pushed = rows.push(“freeCodeCamp”);
console.log(pushed);
This works as expected and logs the new length of the array (which is 4 in my case). However, I keep getting the feedback that my solution is incorrect?
Your code so far
let character = 'Hello';
let count = 8;
let rows = ["Naomi", "Quincy", "CamperChan"];
// User Editable Region
rows.push("freeCodeCamp");
let pushed = rows.push("freeCodeCamp");
console.log(pushed);
// User Editable Region
let popped = rows.pop();
console.log(popped);
console.log(rows);
Your browser information:
User Agent is: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/135.0.0.0 Safari/537.36
Challenge Information:
Learn Introductory JavaScript by Building a Pyramid Generator - Step 28