mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2025-12-22 11:36:11 -05:00
1.3 KiB
1.3 KiB
id, title, challengeType, dashedName
| id | title | challengeType | dashedName |
|---|---|---|---|
| 660f0ee51d7460ce88cd248d | Step 29 | 1 | step-29 |
--description--
Were you expecting to see 4 in the console? .push() returns the new length of the array, after adding the value you give it.
It is important to be aware of what values a method returns. Take some time to experiment with .push() and .pop(). When you are ready, remove all of your .push() and .pop() calls, and your console.log statements.
--hints--
You should not have a .push() call.
assert.notMatch(__helpers.removeJSComments(code), /\.push\(/);
You should not have a .pop() call.
assert.notMatch(__helpers.removeJSComments(code), /.pull\(/);
You should not have any log statements.
assert.notMatch(__helpers.removeJSComments(code), /console\.log/);
You should not have a popped variable.
assert.notMatch(__helpers.removeJSComments(code), /popped/);
You should not have a pushed variable.
assert.notMatch(__helpers.removeJSComments(code), /pushed/);
--seed--
--seed-contents--
let character = 'Hello';
let count = 8;
let rows = ["Naomi", "Quincy", "CamperChan"];
--fcc-editable-region--
let pushed = rows.push("freeCodeCamp");
console.log(pushed);
let popped = rows.pop();
console.log(popped);
console.log(rows);
--fcc-editable-region--