mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2025-12-23 12:03:28 -05:00
1.2 KiB
1.2 KiB
id, title, challengeType, dashedName
| id | title | challengeType | dashedName |
|---|---|---|---|
| 660f0da9bf1035c9097af20a | Step 28 | 1 | step-28 |
--description--
You should have seen "freeCodeCamp" printed to the console. This is because .pop() returns the value that was removed from the array - and you pushed "freeCodeCamp" to the end of the array earlier.
But what does .push() return? Assign your existing rows.push() to a new pushed variable, and log it.
--hints--
You should declare a pushed variable.
assert.match(__helpers.removeJSComments(code), /pushed/);
You should use let to declare your pushed variable.
assert.match(__helpers.removeJSComments(code), /let\s+pushed/);
You should assign rows.push("freeCodeCamp") to your pushed variable.
assert.equal(pushed, 4);
You should log your pushed variable.
assert.match(__helpers.removeJSComments(code), /console\.log\(\s*pushed\s*\)/);
--seed--
--seed-contents--
let character = 'Hello';
let count = 8;
let rows = ["Naomi", "Quincy", "CamperChan"];
--fcc-editable-region--
rows.push("freeCodeCamp");
--fcc-editable-region--
let popped = rows.pop();
console.log(popped);
console.log(rows);