Question:
Is your feature request related to a problem? Please describe. Building project using docker on macOS is notoriously slow, after some googling, I found that there's some ways to boost the performance of this process. I post the link to the posts I read in here just in case someone want some reference Here's the link to performance comparison Here's the GitHub issue related to the subject In a nutshell, building project with docker on mac is unbearably slow, so, I use flag when run docker, here's the screenshot on how I modified my docker- to make the build process from almost forever to just a few second: (I still modify a section but there's no enough space to include that to the screenshot, anyway, you can tell from the preview pane on the upper right) ! Describe the solution you'd like So, I suggest include this change to yaml file in the project, or(see next) Describe alternatives you've considered Add an extra notice to , letting those who use mac be aware this issue and let them know how to alleviate the pain. PS: I'm also happy to help with this issue
Sure, the docker setup guide has not seen much love lately. Its intial intention was to remove the friction of installing the services like MongoDB, etc. However, it has become painfully slow when setting up from scratch. Please feel free to open a PR for benifit of everyone.
Thanks for the response! So, which option do you recommend? modify the docker- file and make the PR add a new notice in the contribution guide for those who run the project from scratch PS: thanks to the usage of flag , I never hear those crazy fan noise from my old MBP anymore and the CPU usage of the docker is really low now~
Lets start by adding the flag like you have tested. We could merge the PR and keep it under observation for a few days. We could add a warning or remove/overhaul the docker setup if the flags break something, later.
Hey, man, thanks for the advice and sorry for not keeping the update or work on it for several days, I'm currently dealing with some life emergency, and magically, the only thing that can let me feel less painful or pain-free is immerse myself in the world of coding how crazy! Anyway, I just opened a PR and hopefully that can help a lot of people using mac and try to build the project from docker~ PS: I kind of favor adding a note on the guide to remind those with mac to do the flag thing when they build the project, because slow building only happen on mac I think, although this could lead to problems like forgot to remove the flag in the file when they commit so they push to the remote and cause a lot of conflicts... Anyway, adding this flag while building on PC or Linux shouldn't cause any problem I think, because means the change between host and container is not in sync immediately... hmm... sounds like a problem... but for more on it I think you should consult the docker doc I posted above
Hey Benjamin. Hope that you are hanging in well. Stay strong and I wish you the very best in whatever you are dealing with. Keep doing what you love. Thanks a lot for the PR, and your contributions during these hard times. I will take a look at the PR and will check your recommendations. I hope you have a great day ahead. Goodluck.
Thank you so much for the kind words you said, you have no idea what they means to me during this time... thank you!!!! And I am really grateful that I am able to find peace inside the world of code... Also, there seems some problems of the cypress testing of my pr.... dang it... anyway, I will have a look on it as well later. Thank you guys! Stay safe! And have a great day!
Hey I'm glad you're able to find some peace, that's some good news. As for the cypress testing, don't worry about it - I'll investigate. It's almost certainly not your code. It looks like a old bug that I thought I'd squashed.

context: . dockerfile: Dockerfile.tests volumes: <del> - .:/app - node_modules:/app/node_modules - client_node_modules:/app/client/node_modules - server_node_modules:/app/api-server/node_modules - curriculum_node_modules:/app/curriculum/node_modules - challenge_md_parser_node_modules:/app/tools/challenge-md-parser/node_modules - seed_node_modules:/app/tools/scripts/seed/node_modules - client_plugin_nav_data_node_modules:/app/client/plugins/fcc-create-nav-data/node_modules </del> <ins> - .:/app:delegated - node_modules:/app/node_modules:delegated - client_node_modules:/app/client/node_modules:delegated - server_node_modules:/app/api-server/node_modules:delegated - curriculum_node_modules:/app/curriculum/node_modules:delegated - challenge_md_parser_node_modules:/app/tools/challenge-md-parser/node_modules:delegated - seed_node_modules:/app/tools/scripts/seed/node_modules:delegated - client_plugin_nav_data_node_modules:/app/client/plugins/fcc-create-nav-data/node_modules:delegated </ins> working_dir: /app volumes:

- MAILHOG_HOST=mailhog - MONGOHQ_URL=mongodb://db:27017/freecodecamp volumes: <del> - .:/app - node_modules:/app/node_modules - client_node_modules:/app/client/node_modules - server_node_modules:/app/api-server/node_modules - curriculum_node_modules:/app/curriculum/node_modules - challenge_md_parser_node_modules:/app/tools/challenge-md-parser/node_modules - seed_node_modules:/app/tools/scripts/seed/node_modules - client_plugin_nav_data_node_modules:/app/client/plugins/fcc-create-nav-data/node_modules </del> <ins> - .:/app:delegated - node_modules:/app/node_modules:delegated - client_node_modules:/app/client/node_modules:delegated - server_node_modules:/app/api-server/node_modules:delegated - curriculum_node_modules:/app/curriculum/node_modules:delegated - challenge_md_parser_node_modules:/app/tools/challenge-md-parser/node_modules:delegated - seed_node_modules:/app/tools/scripts/seed/node_modules:delegated - client_plugin_nav_data_node_modules:/app/client/plugins/fcc-create-nav-data/node_modules:delegated </ins> working_dir: /app client: image: node:lts

- HOME_LOCATION=http://$DOCKER_HOST_LOCATION:8000 - API_LOCATION=http://$DOCKER_HOST_LOCATION:3000 volumes: <del> - .:/app - node_modules:/app/node_modules - client_node_modules:/app/client/node_modules - server_node_modules:/app/api-server/node_modules - curriculum_node_modules:/app/curriculum/node_modules - challenge_md_parser_node_modules:/app/tools/challenge-md-parser/node_modules - seed_node_modules:/app/tools/scripts/seed/node_modules - client_plugin_nav_data_node_modules:/app/client/plugins/fcc-create-nav-data/node_modules </del> <ins> - .:/app:delegated - node_modules:/app/node_modules:delegated - client_node_modules:/app/client/node_modules:delegated - server_node_modules:/app/api-server/node_modules:delegated - curriculum_node_modules:/app/curriculum/node_modules:delegated - challenge_md_parser_node_modules:/app/tools/challenge-md-parser/node_modules:delegated - seed_node_modules:/app/tools/scripts/seed/node_modules:delegated - client_plugin_nav_data_node_modules:/app/client/plugins/fcc-create-nav-data/node_modules:delegated </ins> working_dir: /app/client command: npm run develop -- -H '0.0.0.0' ports:

- HOME_LOCATION=http://$DOCKER_HOST_LOCATION:8000 - API_LOCATION=http://$DOCKER_HOST_LOCATION:3000 volumes: <del> - .:/app - node_modules:/app/node_modules - client_node_modules:/app/client/node_modules - server_node_modules:/app/api-server/node_modules - curriculum_node_modules:/app/curriculum/node_modules - challenge_md_parser_node_modules:/app/tools/challenge-md-parser/node_modules - seed_node_modules:/app/tools/scripts/seed/node_modules - client_plugin_nav_data_node_modules:/app/client/plugins/fcc-create-nav-data/node_modules </del> <ins> - .:/app:delegated - node_modules:/app/node_modules:delegated - client_node_modules:/app/client/node_modules:delegated - server_node_modules:/app/api-server/node_modules:delegated - curriculum_node_modules:/app/curriculum/node_modules:delegated - challenge_md_parser_node_modules:/app/tools/challenge-md-parser/node_modules:delegated - seed_node_modules:/app/tools/scripts/seed/node_modules:delegated - client_plugin_nav_data_node_modules:/app/client/plugins/fcc-create-nav-data/node_modules:delegated </ins> working_dir: /app/api-server command: npm run develop ports:


Question:
Describe your problem and how to reproduce it: One of the tests in this challenge has wrong result, both in test code and description. It says: This isn't correct. For example: knapsack having 11 panacea, 3 ichor and 15 gold has value , while being within the weight and value constrains: This seems to be case of precision issue. Multiplication input item weights, volumes and max values for those parameters, to start operations without decimals, makes result as it should be, also for the problematic test. Add a Link to the page with the problem:
Yes, it seems you are right - do you want to propose a solution?
Yes, sorry. The least invasive way to correct the seems to be to multiply in function, by the same factor, initial items weights, volumes, and in the first recursive call multiply and . This is enough to make calculations on integers and get correct answers. I don't know if just such change would be okay or if more desirable would be more elaborate rewrite of solution. Or at least changing to / and renaming some variables to better names.
would you be willing to open a PR for it so that the challenge can be changed? you can also contribute to the guide by opening a topic in the #subforum category in the forum
Definitely yes, although I need advice which approach here would be preferred. Considering that the sample solution in code is just used for internal testing and just small change to it can fix the issue.

); ``` <del> `knapsackUnbounded([{ name:"panacea", value:3000, weight:0.3, volume:0.025 }, { name:"ichor", value:1800, weight:0.2, volume:0.015 }, { name:"gold", value:2500, weight:2, volume:0.002 }], 35, 0.35)` should return `75300`. </del> <ins> `knapsackUnbounded([{ name:"panacea", value:3000, weight:0.3, volume:0.025 }, { name:"ichor", value:1800, weight:0.2, volume:0.015 }, { name:"gold", value:2500, weight:2, volume:0.002 }], 35, 0.35)` should return `75900`. </ins> ```js assert.equal(

# --solutions-- ```js <del> function knapsackUnbounded(items, maxweight, maxvolume) { var n = items.length; var best_value = 0; var count = new Array(n); var best = new Array(n); function recurseKnapsack(i, value, weight, volume) { var j, m1, m2, m; if (i == n) { if (value > best_value) { best_value = value; for (j = 0; j < n; j++) { best[j] = count[j]; } } return; </del> <ins> function knapsackUnbounded(items, maxWeight, maxVolume) { function getPickTotals(items, pick) { let totalValue = 0; let totalWeight = 0; let totalVolume = 0; for (let i = 0; i < items.length; i++) { totalValue += pick[i] * items[i].value; totalWeight += pick[i] * items[i].weight; totalVolume += pick[i] * items[i].volume; } return [totalValue, totalWeight, totalVolume]; } function getMaxes(items, maxWeight, maxVolume) { const maxes = []; for (let i = 0; i < items.length; i++) { const maxUnitsInWeight = Math.floor(maxWeight / items[i].weight); const maxUnitsInVolume = Math.floor(maxVolume / items[i].volume); const maxUnitsInLimit = Math.min(maxUnitsInWeight, maxUnitsInVolume); maxes.push(maxUnitsInLimit); </ins> } <del> m1 = Math.floor(weight / items[i].weight); m2 = Math.floor(volume / items[i].volume); m = m1 < m2 ? m1 : m2; for (count[i] = m; count[i] >= 0; count[i]--) { recurseKnapsack( i + 1, value + count[i] * items[i].value, weight - count[i] * items[i].weight, volume - count[i] * items[i].volume ); </del> <ins> return maxes; } function isInLimit(value, limit) { return value <= limit; } function getCombinations(maxValues, curPicks, combinations) { if (maxValues.length === 0) { combinations.push(curPicks); } const curMax = maxValues[0]; const leftMaxValues = maxValues.slice(1); for (let i = 0; i <= curMax; i++) { getCombinations(leftMaxValues, curPicks.concat(i), combinations); } return combinations; } let bestValue = 0; let bestPick = []; const maxes = getMaxes(items, maxWeight, maxVolume); const combinations = getCombinations(maxes, [], []); for (let i = 0; i < combinations.length; i++) { const curPick = combinations[i]; const [curValue, curWeight, curVolume] = getPickTotals(items, curPick); if (!isInLimit(curWeight, maxWeight) || !isInLimit(curVolume, maxVolume)) { continue; } if (curValue > bestValue) { bestValue = curValue; bestPick = [curPick]; } else if (curValue === bestValue) { bestPick.push(curPick); </ins> } } <del> recurseKnapsack(0, 0, maxweight, maxvolume); return best_value; </del> <ins> return bestValue; </ins> } ```


Question:
Describe your problem and how to reproduce it: The following code does not pass, because the test has a variable name which is the same: Solution: Change variable name of from: to To make it less likely someone uses the same variable name.
Hey! I am a beginner in open source programming. Can I take this issue up? Thanks.
, Yes you may have a go at this. To begin, you should go through the , if you have not already. Some things to highlight: We do not typically assign issues If an issue has help wanted or first timers only labels, then they are open for contribution The first PR which closes the issue will be accepted If you have any questions about contributing in general, or setting up fCC locally, the , and the are excellent places to start.

- text: Your incrementer function should take an argument. testString: assert(incrementer.length === 1); - text: Your incrementer function should return a value that is one larger than the fixedValue value.  testString: const newValue = incrementer(fixedValue); assert(newValue === 5);   testString: const __newValue = incrementer(fixedValue); assert(__newValue === 5);  ```


Question:
Describe the bug Sass pages with invalid syntax occasionally timeout To Reproduce Steps to reproduce the behavior: to in in the console (sometimes) Expected behavior The following should appear in the console: Since this is intermittent, here's a gif to demonstrate: ! Additional Context When the error appears it does so very quickly, so it is unlikely that this is due to a genuine timeout.
Hey Oliver, When I clicked on the link, I reset the code, and completed the challenge as it should be completed. I came across a error, and was unable to run the tests. However, after resetting the code, refreshing the page, and pasting in the code you provided (missing ), the error you mention appeared, but does not disappear. So, I suspect it has to do with the page first load, because I can get the error only if I: 1) reset the code 2) Duplicate the tab 3) Input the incorrect code (missing ) !
I tried method but that didn't produce the bug. I am able to reliably reproduce the bug on Chromium & Firefox with the following steps: the page (new tab & refresh can both produce bug). delete & re-add the character from line 9, fast enough that the new state does not display in the console. step 2 on deleting the . If done correctly the message will display instead of an error, even though the console input is incorrect. approximately 3-5 seconds for the timeout message to appear. Note: it can also be reproduced where by in step 2 you end on re-adding the but it's harder to tell if the bug has happened. It must have something to do with the console state change and the output error check conflicting.
I worked on this issue on my old computer that is very slow and on my main PC (with a dual boot). On my old computer I have the same result as regurlaly timeouts. On the new one to have this issue I have to paste 3 times the piece of code to reproduce it. But everytimes, this is a real timeout (5ms, I put 'new Date()' on the code). We can upgrade the source code one "execute-challenge-" with this kind of stuff to have a best message, but still the problem : <prelet errMsg = 'error'; if (err === 'timeout') { // eslint-disable-next-line no-ex-assign errMsg = ; } else if (Array.isArray(err) && err.length0 && err[0] === 'timeout') { // timeout: 5ms errMsg = ; } else { errMsg = err; } (errMsg); yield put(updateConsole(escape(errMsg))); </preso the result will be "Server response timeout"
While this is old, it's still reproducible, unfortunately. A PR to improve the warning would be welcome.
I’m currently taking a look into a possible solution on this!

class WorkerExecutor { constructor( workerName, <del> { location = '/js/', concurrency = 2, terminateWorker = false } = {} </del> <ins> { location = '/js/', maxWorkers = 2, terminateWorker = false } = {} </ins> ) { <del> this._workerName = workerName; this._workers = []; this._queue = []; this._running = 0; this._concurrency = concurrency; </del> <ins> this._workerPool = []; this._taskQueue = []; this._workersInUse = 0; this._maxWorkers = maxWorkers; </ins> this._terminateWorker = terminateWorker; <del> this._location = location; </del> <ins> this._scriptURL = `${location}${workerName}.js`; </ins> this._getWorker = this._getWorker.bind(this); } async _getWorker() { <del> let worker; if (this._workers.length) { worker = this._workers.shift(); } else { worker = await new Promise((resolve, reject) => { const worker = new Worker(`${this._location}${this._workerName}.js`); worker.onmessage = e => { if (e.data && e.data.type && e.data.type === 'contentLoaded') { resolve(worker); } }; worker.onerror = err => reject(err); }); } return worker; </del> <ins> return this._workerPool.length ? this._workerPool.shift() : this._createWorker(); </ins> } <del> _pushTask(task) { this._queue.push(task); this._next(); </del> <ins> _createWorker() { return new Promise((resolve, reject) => { const newWorker = new Worker(this._scriptURL); newWorker.onmessage = e => { if (e.data?.type === 'contentLoaded') { resolve(newWorker); } }; newWorker.onerror = err => reject(err); }); </ins> } _handleTaskEnd(task) { return () => { <del> this._running--; if (task._worker) { const worker = task._worker; </del> <ins> this._workersInUse--; const worker = task._worker; if (worker) { </ins> if (this._terminateWorker) { worker.terminate(); } else { worker.onmessage = null; worker.onerror = null; <del> this._workers.push(worker); </del> <ins> this._workerPool.push(worker); </ins> } } <del> this._next(); </del> <ins> this._processQueue(); </ins> }; } <del> _next() { while (this._running < this._concurrency && this._queue.length) { const task = this._queue.shift(); </del> <ins> _processQueue() { while (this._workersInUse < this._maxWorkers && this._taskQueue.length) { const task = this._taskQueue.shift(); </ins> const handleTaskEnd = this._handleTaskEnd(task); task._execute(this._getWorker).done.then(handleTaskEnd, handleTaskEnd); <del> this._running++; </del> <ins> this._workersInUse++; </ins> } }

}, timeout); worker.onmessage = e => { <del> if (e.data && e.data.type) { </del> <ins> clearTimeout(timeoutId); // data.type is undefined when the message has been processed // successfully and defined when something else has happened (e.g. // an error occurred) if (e.data?.type) { </ins> this.emit(e.data.type, e.data.data); <del> return; </del> <ins> } else { this.emit('done', e.data); </ins> } <del> clearTimeout(timeoutId); this.emit('done', e.data); </del> }; worker.onerror = e => {

.once('error', err => reject(err.message)); }); <del> this._pushTask(task); </del> <ins> this._taskQueue.push(task); this._processQueue(); </ins> return task; } } <ins> // Error and completion handling </ins> const eventify = self => { self._events = {};

// eslint-disable-next-line max-len it('Worker executor should successfully execute 3 tasks in parallel and use 3 workers', async () => { mockWorker(); <del> const testWorker = createWorker('test', { concurrency: 3 }); </del> <ins> const testWorker = createWorker('test', { maxWorkers: 3 }); </ins> const task1 = testWorker.execute('test1'); const task2 = testWorker.execute('test2');

// eslint-disable-next-line max-len it('Worker executor should successfully execute 3 tasks and use 1 worker', async () => { mockWorker(); <del> const testWorker = createWorker('test', { concurrency: 1 }); </del> <ins> const testWorker = createWorker('test', { maxWorkers: 1 }); </ins> const task1 = testWorker.execute('test1'); const task2 = testWorker.execute('test2');


Question:
In , the reader is told" "Note: the then and catch methods can be chained to the promise declaration if you choose." Nothing so far in the Javascript curriculum has explained what it might mean to "chain" methods to the promise declaration. I would propose one of two changes here: a hyperlink to a good resource that describes chaining methods to promises ( is what explained it for me); or add another example that shows what promise chaining would look like. I hesitate to write a PR doing solution (1) because I can imagine there are restrictions on outgoing links. What do you think? Is (1) a good idea? Or (2)? <!-- NOTE: If you're reporting a security issue, don't create a GitHub issue. Instead, email We will look into it immediately. --Describe your problem and how to reproduce it: Add a Link to the page with the problem: Tell us about your browser and operating system: NA If possible, add a screenshot here (you can drag and drop, png, jpg, gif, etc. in this box):
I don't remember coming across a lesson in the javascript section linking to an external site for better explanation. Wouldn't it even be better to add a lesson explaining promise chaining than link to an external site if it has not been explained anywhere in the lesson series? TBH i see promise chaining used a lot.
Yeah, I don't see a lot of external links, so an explanation of promise chaining seems like the way to go. Not sure if it needs another lesson or could be explained here.
Hello there, You are correct, we try as much as possible to avoid links to external resources. One of the main ideas behind the challenges in this version of the curriculum is stated : As for the issue with campers potentially never having heard of "chaining", in my opinion: 1) Campers do not need to know about it to complete the challenge. I suspect the reason the original contributor who wrote the note, did it to give campers something to research, and potentially practice. If a camper already knows about chaining, then they will not give it a second though. If not, then perhaps, like yourself, they will research into it. Either way, the instructions do not ask for chaining to be used. 2) The note could be removed. I would not spend time explaining chaining in this challenge. Obviously number 2 is not my preferred choice of action, because I appreciate the tid-bits of information given in some of the challenges which helped me learn by prompting me to research.
Hi . Well it is understandable to give learners something to research about but my honest opinion is if you decide to do it, then you must clearly state so. Looking at the wording of the note: From the above statement there is a very high likelihood for a learner to ignore the note because it is an alternative to the already explained method. I would most likely ignore it too, given the amount of material i have to learn, if i were the learner. Yes the task at hand may not need someone to know promise chaining to complete but do you think the concept is not important enough to include in the lesson series or as part of this lesson? In fact my very first encounter with promises is with the API which is more often than not implemented via promise chaining. My honest opinion is that ignoring it up to the point of just giving a one line "Note" is an oversight.
I fully understand where you are coming from. My main issue with including anything about chaining in this context or fetch/ASYNC context is and are not a part of this topic - ES6. I would much rather a new lesson be created teaching chaining in another block, and/or TRY/CATCH being taught as the standard with ASYNC/AWAIT in the ES6 block. That being said, I am concerned this topic is going down bike-shedding, as the new curriculum should probably be the platform taking note of these points.
Thanks for weighing in. Your comment about the "new curriculum" is news to me. If that's where this discussion belongs, that's fine with me. On the substance, as a beginner, I think the bare-bones note about promise chaining here does more harm than good. So given that there is no appetite for explaining it here, I would favor deleting the note.
Since you originally created this challenge and included the note, could you share your thoughts on this issue?
, In that case, I highly recommend you take a peak. Starting with these two posts announcing it:
I don't think I would expand this lesson to include teaching method chaining, since it would take away the focus of the lesson. Even an extra example might be much - I know there's many other lessons that are longer with many examples - but that's my opinion. I wouldn't object to an additional lesson about it - but we aren't really adding lessons anymore in favor of the new curriculum. So I think that just leaves either removing the note, or leaving it. I would be fine with either. I'm open to suggestions.
My suggestion is to take it out. This fits best with the contributor guideline quoted by "Campers should never have to google anything during these challenges. " Right now, if a camper wants to understand the note, they have to google promise chaining. I realize that they don't actually have to google promise chaining because it isn't part of the challenge. But that's all the more reason to take the note out. It's just a confusing distraction.
Since we are not going to add an external link on the topic and we are not planning on adding a new challenge to the existing curriculum for the topic being linked, I think we should just remove the note.

``` error is the argument passed in to the reject method.  Note: the then and catch methods can be chained to the promise declaration if you choose.
 ## Instructions


Question:
and found themselves unable to log in locally. Ahmad's issue was fixed by , but Randy's was not. Could you explain a bit in this issue if the problem persists? It might be nothing, but it could be a sign something isn't quite right.
I am able to log in, and save settings. I did however get a bunch of errors on the landing page, which I resolved by adding: Back to Possibly useful to take a look at what changes made, and correct the setup for the changes.
Here are the errors I am getting without the above env vars ! Slightly more verbose: !
Thanks for confirming, we should add some defaulting logic to this actually in dev mode. Speaking of which do you know if we have a test instance of Algolia, I do not see any on the dashboard.
The only way I was able to finally clear up the errors I was seeing, was to clear my cache for localhost. Before that, I had tried: master the following commands: I was not able to just do a hard refresh of the page (Ctrl + F5). I literally had to go into browser history and delete out localhost history. Before clearing my cache, I was getting the "Something is not quite right. A report has been generated and the team have been notified." message and seeing the following in the terminal when the main home page loaded. !
Thanks this additional information helps. The secrets were changed (by me) on the which have led the sessions (in the local db on your end) to go stale. The client is sending the session details to the API, the API is also correctly seeing them in the db, but because the key (which encrypted) the tokens in the first place has changed it is erroring out. This is kind of expected. The fix is to purge the cache on the browser (techically you need to purge the db, where the keys are, but clearing the cache should be enough).
Wouldn't the have purged the db?
Nope. It will only "seed" the user collection if it is not present already. It would not create/remove anything else by design.
Should we add something to that purges the local db and then seeds it?
Like I said, this behaviour is intentional. The DB is not a ephemeral entity. It should not be mutated after intial setup. That is the only way you would catch potential bugs from reaching production. The DX is not the end goal, the production is.
Oh, so because I don't keep my browser cache, it kept requesting a new token?
Yes.
we do have a test instance of Algolia, but I accidentally created it under my account rather than a general team account, so only I have access to it. I'll create a test instance under the team account and create a PR to update the keys in
I am not in favor of adding our keys (although these are client side keys for algolia) to version control. Instead the search feature sould be mocked/disabled in developement.
sure, that sounds good. I think it'll throw errors for now, but there's probably a good way to disable search altogether in development.
Let's mock the search feature. We can test then. What do you guys say?
Hey thank you for all of your help with testing. It's been awesome to see how quickly the test coverage has improved with each of your PRs. I'm all for mocking the search bar. Now that Cypress is in place, it will be good to make sure things like the up and down keys and mouse entering / leaving the dropdown is working as expected. I haven't looked much into it, but it should be possible to pass a mock Algolia response to the component somehow.

const searchClient = algoliaAppId && algoliaAPIKey ? algoliasearch(algoliaAppId, algoliaAPIKey) <del> : {}; </del> <ins> : { search: () => {} }; </ins> const propTypes = { children: PropTypes.any,

key={hit.objectID} > {noHits ? ( <del> <NoHitsSuggestion title={noHitsTitle} /> </del> <ins> <NoHitsSuggestion handleMouseEnter={handleMouseEnter} handleMouseLeave={handleMouseLeave} title={noHitsTitle} /> </ins> ) : ( <Suggestion handleMouseEnter={handleMouseEnter}


Question:
<!-- NOTE: If you're reporting a security issue, don't create a GitHub issue. Instead, email We will look into it immediately. --Describe your problem and how to reproduce it: The tests appear to require specific (albeit conventionally correct) formatting in order for the code to pass. This code block, provided by a user, did not pass: However, if I ran the formatter with ++, the resulting formatted code did pass: Add a Link to the page with the problem: Tell us about your browser and operating system: Browser Name: Chrome Browser Version: 85.0.4183.83 Operating System: Windows 10 v1909
Confirmed. This is due to the extra space between the word else and if. Here is the culprit: Changing the above to this should work: Open up to first-timers?
Sounds good to me!
Hi, I would like to pick this! Thanks for the guide! :)
Welcome! Issues labelled don't require permission for a pull request, as long as its your first pull request with us. If you have not done so already, please give our a read - there are a lot of helpful tips in there to get you started.
Hi, i am a first timer. Is the issue still open?
Hey We typically accept PRs in the order we receive them, so this will be open until we get a working PR.

- text: You should have at least two if statements testString: assert(code.match(/if/g).length > 1); - text: You should have closing and opening curly braces for each if else code block.  testString: assert(code.match(/ifs*((.+))s*{[sS]+}s*else ifs*((.+))s*{[sS]+}s*elses*{[sS]+s*}/));   testString: assert(code.match(/ifs*((.+))s*{[sS]+}s*elses+ifs*((.+))s*{[sS]+}s*elses*{[sS]+s*}/));  - text: testElseIf(0) should return "Smaller than 5" testString: assert(testElseIf(0) === "Smaller than 5"); - text: testElseIf(5) should return "Between 5 and 10"


Question:
<!-- NOTE: If you're reporting a security issue, don't create a GitHub issue. Instead, email We will look into it immediately. --Describe your problem and how to reproduce it: While helping a camper with their work on this solution, I took a look at mine and discovered it passes when it should not. If you paste this code into the editor, you can see that has been modified from to but the test does not catch this fact. I believe it may be due to the tests for array modification calling the function without an parameter: If I assign a default value of in the function, then the tests catch this behaviour as expected. As such, I believe updating these function calls in the tests should correct this error. Add a Link to the page with the problem: Tell us about your browser and operating system: Browser Name: Chrome Browser Version: 85.0.4183.102 Operating System: Windows 10 v 1909 If possible, add a screenshot here (you can drag and drop, png, jpg, gif, etc. in this box): !
I believe so. Essentially if you invoke without , the value of is and from the solution you have given, will be which is . Therefore : As a result and remain unmutated. What i am not sure of is whether invoking the function without was an oversight or intentional.
calling the function without an stops various loop solutions from being accepted. I do not know if it was intentional
Is it to force learners to use / since it is a splice-slice challenge?
There is no requirement to use splice or slice. It is an algorithm challenge. We do not care how they solve the problem.
So, to be clear - you are thinking to put a value in for on those two tests you shared would catch this.
Yes, updating the test call to: should correct this bug

- text: All elements from the first array should be added to the second array in their original order. testString: assert.deepEqual(frankenSplice([1, 2, 3, 4], [], 0), [1, 2, 3, 4]); - text: The first array should remain the same after the function runs. <del> testString: frankenSplice(testArr1, testArr2); assert.deepEqual(testArr1, [1, 2]); </del> <ins> testString: frankenSplice(testArr1, testArr2, 1); assert.deepEqual(testArr1, [1, 2]); </ins> - text: The second array should remain the same after the function runs. <del> testString: frankenSplice(testArr1, testArr2); assert.deepEqual(testArr2, ["a", "b"]); </del> <ins> testString: frankenSplice(testArr1, testArr2, 1); assert.deepEqual(testArr2, ["a", "b"]); </ins> ```


Question:
Challenge: this challenge need instructions on how to actually install the specified version? On if you search for a package it will just give you the latest version. you run it will add the package with the caret in front of the version number but the test does not allow for that. Should the test allow for the caret?
If changing the tests to allow does not cause any of the versioning issues mentioned previously, then we should go with that. Otherwise, we could add a note that the camper should use :
Just bringing this back up: Are we changing the tests, or changing the instructions to be explicit about the versioning?
Personally, I'd say both. Show the npm command for how to install a specific package version and make the test ignore/accept the caret.
I like that. This kind of lesson is so short, I also think it would be useful to add the information about . I am going to open this up for general help
Hi, I do exactly like npm install --save-exact helmet and helmet = require('helmet'); but still not pass the challenge, anyone, please help me, thanks
Hey , Without seeing your code, or being able to test your project, it will be difficult to assist. Please make use of the to open a topic, and provide as much detail as possible. It will be easier to assist that way.
my code: var express = require('express'); var app = express(); const helmet = require('helmet'); { "name": "fcc-infosec-challenges", "version": "0.0.1", "description": "fcc backend boilerplate", "main": "", "scripts": { "start": "node " }, "dependencies": { "express": "^4.14.0", "helmet": "3.21.3" }, "keywords": [ "node", "hyperdev", "express", "freecodecamp" ], "license": "MIT" } and the test result: // running tests helmet version 3.21.3 should be in // tests completed Please help me to solve this. thanks
As mentioned, please use for questions that involve debugging challenge or project solutions. Thank you.

All your code for these lessons goes in the `myApp.js` file between the lines of code we have started you off with. Do not change or delete the code we have added for you. <del> Install Helmet version `3.21.3`, then require it. </del> <ins> Install Helmet version `3.21.3`, then require it. You can install a specific version of a package with `npm install --save-exact package@version`, or by adding it to your `package.json` directly. </ins> # --hints--

(getUserInput) => $.get(getUserInput('url') + '/_api/package.json').then( (data) => { <del> var packJson = JSON.parse(data); assert(packJson.dependencies.helmet === '3.21.3'); </del> <ins> const packJson = JSON.parse(data); const helmet = packJson.dependencies.helmet; assert(helmet === '3.21.3' || helmet === '^3.21.3'); </ins> }, (xhr) => { throw new Error(xhr.responseText);

# --instructions-- <del> In this exercise, use `helmet.contentSecurityPolicy()`, and configure it setting the `defaultSrc directive` to `["self"]` (the list of allowed sources must be in an array), in order to trust only your website address by default. Set also the `scriptSrc` directive so that you will allow scripts to be downloaded from your website, and from the domain 'trusted-cdn.com'. </del> <ins> In this exercise, use `helmet.contentSecurityPolicy()`. Configure it by adding a `directives` object. In the object, set the `defaultSrc` to `["'self'"]` (the list of allowed sources must be in an array), in order to trust only your website address by default. Also set the `scriptSrc` directive so that you only allow scripts to be downloaded from your website (`'self'`), and from the domain `'trusted-cdn.com'`. </ins> <del> Hint: in the `self` keyword, the single quotes are part of the keyword itself, so it needs to be enclosed in double quotes to be working. </del> <ins> Hint: in the `'self'` keyword, the single quotes are part of the keyword itself, so it needs to be enclosed in double quotes to be working. </ins> # --hints-- <del> helmet.csp() middleware should be mounted correctly </del> <ins> helmet.contentSecurityPolicy() middleware should be mounted correctly </ins> ```js (getUserInput) =>


Question:
After some discussion on the forum, it was concluded the following challenges need the removed from the the frontmatter of the challenge files.
I am first timer to contribute it. please help with it. We need to remove the from right.
Yes and the same goes for the other challenge too.
Thank you for your contribution. For future reference, you can make changes to multiple files on the same. Also, you really should make your changes on a different branch than to avoid soiling it. I suggest taking a look at our documentation on when you want to work on more complex PRs.

id: bad87fee1348bd9aede08830 title: Create a Form Element challengeType: 0 <del> videoUrl: 'https://scrimba.com/p/pVMPUv/cmQ3Kfa' </del> forumTopicId: 16817 ---


Question:
After some discussion on the forum, it was concluded the following challenges need the removed from the the frontmatter of the challenge files.
I am first timer to contribute it. please help with it. We need to remove the from right.
Yes and the same goes for the other challenge too.
Thank you for your contribution. For future reference, you can make changes to multiple files on the same. Also, you really should make your changes on a different branch than to avoid soiling it. I suggest taking a look at our documentation on when you want to work on more complex PRs.

id: 587d78a4367417b2b2512ad2 title: Learn about Tertiary Colors challengeType: 0 <del> videoUrl: 'https://scrimba.com/c/c3bRDAb' </del> forumTopicId: 301057 ---


Question: This is a broken link. <img width="1440" alt="Screen Shot 2020-09-21 at 12 43 27 PM" src="https://user-"<img width="1148" alt="Screen Shot 2020-09-21 at 12 43 55 PM" src="https://user-"Recommended fix, suggestions (how would you update it?): Two ideas for fixing this come to mind: In the , we want to change both links to match the current application. Here is the code that should be to fix the issue: Set up routes for the old paths to redirect to the current paths. I'm unsure of exactly how to do this.

**Projects**:  [Random Quote Machine](https://www.freecodecamp.org/learn/front-end-libraries/front-end-libraries-projects/build-a-random-quote-machine), [Markdown Previewer](https://www.freecodecamp.org/learn/front-end-libraries/front-end-libraries-projects/build-a-markdown-previewer), [Drum Machine](https://www.freecodecamp.org/learn/front-end-libraries/front-end-libraries-projects/build-a-drum-machine), [JavaScript Calculator](https://www.freecodecamp.org/learn/front-end-libraries/front-end-libraries-projects/build-a-javascript-calculator), [25 + 5 Clock](https://www.freecodecamp.org/learn/front-end-libraries/front-end-libraries-projects/build-a-25--5-clock) #### 4. Data Visualization Certification - [Data Visualization with D3](https://learn.freecodecamp.org/data-visualization/data-visualization-with-d3)

 **Projects**: [Timestamp Microservice](https://www.freecodecamp.org/learn/apis-and-microservices/apis-and-microservices-projects/timestamp-microservice), [Request Header Parser](https://www.freecodecamp.org/learn/apis-and-microservices/apis-and-microservices-projects/request-header-parser-microservice), [URL Shortener](https://www.freecodecamp.org/learn/apis-and-microservices/apis-and-microservices-projects/url-shortener-microservice), [Exercise Tracker](https://www.freecodecamp.org/learn/apis-and-microservices/apis-and-microservices-projects/exercise-tracker), [File Metadata Microservice](https://www.freecodecamp.org/learn/apis-and-microservices/apis-and-microservices-projects/file-metadata-microservice) #### 6. Quality Assurance Certification  - [Quality Assurance and Testing with Chai](https://learn.freecodecamp.org/information-security-and-quality-assurance/quality-assurance-and-testing-with-chai) - [Advanced Node and Express](https://learn.freecodecamp.org/information-security-and-quality-assurance/advanced-node-and-express)   - [Quality Assurance and Testing with Chai](https://www.freecodecamp.org/learn/quality-assurance/quality-assurance-and-testing-with-chai/) - [Advanced Node and Express](https://www.freecodecamp.org/learn/quality-assurance/advanced-node-and-express/)

 **Projects**:  [Metric-Imperial Converter](https://www.freecodecamp.org/learn/quality-assurance/quality-assurance-projects/metric-imperial-converter), [Issue Tracker](https://www.freecodecamp.org/learn/quality-assurance/quality-assurance-projects/issue-tracker), [Personal Library](https://www.freecodecamp.org/learn/quality-assurance/quality-assurance-projects/personal-library), [Sudoku Solver](https://www.freecodecamp.org/learn/quality-assurance/quality-assurance-projects/sudoku-solver), [American British Translator](https://www.freecodecamp.org/learn/quality-assurance/quality-assurance-projects/american-british-translator) #### 7. Scientific Computing with Python Certification - [Introduction to Python for Everybody](https://learn.freecodecamp.org/scientific-computing-with-python/python-for-everybody)

**Projects**: [Mean-Variance-Standard Deviation Calculator](https://www.freecodecamp.org/learn/data-analysis-with-python/data-analysis-with-python-projects/mean-variance-standard-deviation-calculator), [Demographic Data Analyzer](https://www.freecodecamp.org/learn/data-analysis-with-python/data-analysis-with-python-projects/demographic-data-analyzer), [Medical Data Visualizer](https://www.freecodecamp.org/learn/data-analysis-with-python/data-analysis-with-python-projects/medical-data-visualizer), [Page View Time Series Visualizer](https://www.freecodecamp.org/learn/data-analysis-with-python/data-analysis-with-python-projects/page-view-time-series-visualizer), [Sea Level Predictor](https://www.freecodecamp.org/learn/data-analysis-with-python/data-analysis-with-python-projects/sea-level-predictor) #### 9. Information Security Certification - [Information Security with HelmetJS](https://learn.freecodecamp.org/information-security/information-security-with-helmetjs)

**Projects**:  [Stock Price Checker](https://www.freecodecamp.org/learn/information-security/information-security-projects/stock-price-checker), [Anonymous Message Board](https://www.freecodecamp.org/learn/information-security/information-security-projects/anonymous-message-board), [Port Scanner](https://www.freecodecamp.org/learn/information-security/information-security-projects/port-scanner), [SHA-1 Password Cracker](https://www.freecodecamp.org/learn/information-security/information-security-projects/sha-1-password-cracker), [Secure Real Time Multiplayer Game ](https://www.freecodecamp.org/learn/information-security/information-security-projects/secure-real-time-multiplayer-game) #### 10. Machine Learning with Python Certification - [TensorFlow](https://learn.freecodecamp.org/machine-learning-with-python/tensorflow)

**Projects**: [Rock Paper Scissors](https://www.freecodecamp.org/learn/machine-learning-with-python/machine-learning-with-python-projects/rock-paper-scissors), [Cat and Dog Image Classifier](https://www.freecodecamp.org/learn/machine-learning-with-python/machine-learning-with-python-projects/cat-and-dog-image-classifier), [Book Recommendation Engine using KNN](https://www.freecodecamp.org/learn/machine-learning-with-python/machine-learning-with-python-projects/book-recommendation-engine-using-knn), [Linear Regression Health Costs Calculator](https://www.freecodecamp.org/learn/machine-learning-with-python/machine-learning-with-python-projects/linear-regression-health-costs-calculator), [Neural Network SMS Text Classifier](https://www.freecodecamp.org/learn/machine-learning-with-python/machine-learning-with-python-projects/neural-network-sms-text-classifier) #### Legacy Full Stack Development Certification Once you have earned the Responsive Web Design, Algorithms and Data Structures, Front End Libraries, Data Visualization, APIs and Microservices, and Legacy Information Security and Quality Assurance certifications, you'll be able to claim your freeCodeCamp.org Full Stack Development Certification. This distinction signifies that you've completed around 1,800 hours of coding with a wide range of web development tools.


Question:
<!-- NOTE: If you're reporting a security issue, don't create a GitHub issue. Instead, email We will look into it immediately. --Describe your problem and how to reproduce it: In the challenge that I mentioned in the title there is an issue. Even when the output doesn't match with the challenge requirements but it still passes the challenge. I have linked some gifs so it is more understandable. Add a Link to the page with the problem: Tell us about your browser and operating system: Browser Name: Google Chrome Browser Version: 85.0.4183.121 Operating System: Windows 10 64-bit If possible, add a screenshot here (you can drag and drop, png, jpg, gif, etc. in this box): The output doesn't match with the requirements but it still passes the challenge: While this is the correct code and output: This also passes the challenge:
Good catch! The first test on this page uses: A fun quirk with that I ran in to yesterday is that it returns true on an empty array. This error could likely be fixed by adding an assertion for .
Honestly I didn't know why it passed the challenge. Thank you for the explanation.
Opening this up for contributions. As mentions, we just need an additional condition in the to test that is non-zero (which means it would be truthy).
you can find in stackovervlow

```yml tests: - text: arr2 should be correct copy of arr1.  testString: assert(arr2.every((v, i) => v === arr1[i]));   testString: assert(arr2.every((v, i) => v === arr1[i]) && arr2.length);  - text: ... spread operator should be used to duplicate arr1. testString: assert(code.match(/Array(s*...arr1s*)|[s*...arr1s*]/)); - text: arr2 should remain unchanged when arr1 is changed.


Question:
The tests need to be updated to allow for the two main ways of defining routes: AND Add a Link to the page with the problem:
We need to figure how to test most things without using regex.
We could change the tests to ping the route, to determine if it was defined correctly?

# --hints-- <del> Route /auth/github should be correct. </del> <ins> Route `/auth/github` should be correct. </ins> ```js <del> (getUserInput) => $.get(getUserInput('url') + '/_api/routes.js').then( (data) => { </del> <ins> async (getUserInput) => { try { const res = await fetch(getUserInput('url') + '/_api/routes.js'); if (res.ok) { const data = await res.text(); </ins> assert.match( <del> data.replace(/s/g, ''), /('|")/auth/github/?1[^]*?get.*?passport.authenticate.*?github/gi, 'Route auth/github should only call passport.authenticate with github' ); }, (xhr) => { throw new Error(xhr.statusText); </del> <ins> data.replace(/s/g, ''), /passport.authenticate.*?github/g, 'Route auth/github should only call passport.authenticate with github' ); } else { throw new Error(res.statusText); </ins> } <del> ); </del> <ins> const res2 = await fetch(getUserInput('url') + '/_api/app-stack'); if (res2.ok) { const data2 = JSON.parse(await res2.json()); const dataLayer = data2.find(layer => layer?.route?.path === '/auth/github'); assert.deepInclude(dataLayer?.route, { methods: {get: true}, path: "/auth/github"}); assert.deepInclude(dataLayer?.route?.stack?.[0], {method: "get", name: "authenticate"}); } else { throw new Error(res2.statusText); } } catch (err) { throw new Error(err); } } </ins> ``` <del> Route /auth/github/callback should be correct. </del> <ins> Route `/auth/github/callback` should be correct. </ins> ```js <del> (getUserInput) => $.get(getUserInput('url') + '/_api/routes.js').then( (data) => { </del> <ins> async (getUserInput) => { try { const res = await fetch(getUserInput('url') + '/_api/routes.js'); if (res.ok) { const data = await res.text(); </ins> assert.match( data.replace(/s/g, ''), <del> /('|")/auth/github/callback/?1[^]*?get.*?passport.authenticate.*?github.*?failureRedirect:("|')/2/gi, </del> <ins> /failureRedirect:("|')/1/g, </ins> 'Route auth/github/callback should accept a get request and call passport.authenticate for github with a failure redirect to home' ); <del> }, (xhr) => { throw new Error(xhr.statusText); </del> <ins> } else { throw new Error(res.statusText); } const res2 = await fetch(getUserInput('url') + '/_api/app-stack'); if (res2.ok) { const data2 = JSON.parse(await res2.json()); const dataLayer = data2.find(layer => layer?.route?.path === '/auth/github/callback'); assert.deepInclude(dataLayer?.route, { methods: {get: true}, path: "/auth/github/callback"}); assert.deepInclude(dataLayer?.route?.stack?.[0], {method: "get", name: "authenticate"}); } else { throw new Error(res2.statusText); </ins> } <del> ); </del> <ins> } catch (err) { throw new Error(err); } } </ins> ``` # --solutions--


Question:
!
Dropping Firefox support temporarily with . This was causing me to slow down with the PRs and rapid testing we are doing on the staging. I will let someone else investigate this.
any thoughts on this one? I'll take a look when I can, but I figured you might have some insight.
I'll look into it soon. Will let you know when I get to the bottom of it.
Mrugesh shared two links to the CI runs that failed and both of them failed for the . So, I was looking at the test and saw a lot of explicit timeout increasing... this is probably the reason why it fails on Firefox. Because the timeout were increased by watching the time it took on Chrome and manually adjusting it. But Firefox normally needs a few more seconds to finish running (this is due to ). I think increasing the timeout limit should do the trick.
We do wait for the editor, but everything after that should be basically instantaneous. Thanks for investigating that, but it should be fixed for Firefox 80 () and that's what we run the tests on. Also, suggests we should be using which could be a factor, but would have thought that would make things fail entirely rather than run slowly. That could work, yeah. The strange thing is the dev mode works perfectly locally and the CI should be even faster, since it uses the built site.
The bug is fixed on Firefox but Cypress still manually triggers GC as it is said in the Cypress docs (also when you run the tests locally in Firefox, it'll show you a message about GC. This is because Cypress doesn't manually run GC on but when it's run in CI using then Cypress manually triggers GC). I agree. I don't think this is the reason. I couldn't reproduce the bug locally... maybe we should try to reproduce it in CI by running it repeatedly?
Right, but would this make a test fail? If it runs between tests, which is the default, it should just make the whole run a bit slower. If it's included in the timeout for a particular test, that would be a massive oversight. My assumption is that the only timeout you might hit because of this is the limit for the entire run. Sure. I'll let decide when he wants to do this, though, since it makes deploying a bit of a headache (if you're being bombarded with fail negatives, I mean).
I am open to creating a new branch on the upstream if you need to test it on CI by adding random commits? In theory you should be able to test it on a fork as well.

runs-on: ubuntu-18.04 strategy: matrix: <del> browsers: [chrome] </del> <ins> browsers: [chrome, firefox] </ins> services: mongodb: image: mongo:3.6.19

it('shows test output when the tests are run', () => { cy.visit(locations.index); // first wait for the editor to load <del> cy.get(selectors.editor, { timeout: 10000 }); </del> <ins> cy.get(selectors.editor, { timeout: 15000 }); </ins> cy.get(selectors.runTestsButton) .click() .then(() => {

it('shows test output when the tests are triggered by the keyboard', () => { cy.visit(locations.index); // first wait for the editor to load <del> cy.get(selectors.editor, { timeout: 10000 }); </del> <ins> cy.get(selectors.editor, { timeout: 15000 }); </ins> cy.get(selectors.hotkeys) .focus() .type('{ctrl}{enter}')


Question:
The challenge seed has since been updated, and this paragraph is out of line This should be reworded to not make a line reference. I suggest: Challenge:
I agree.
Can I have a bash at this?

The code editor has two components that are partially defined for you: a parent called GameOfChance, and a child called Results. They are used to create a simple game where the user presses a button to see if they win or lose.  First, you'll need a simple expression that randomly returns a different value every time it is run. You can use Math.random(). This method returns a value between 0 (inclusive) and 1 (exclusive) each time it is called. So for 50/50 odds, use Math.random() >= .5 in your expression. Statistically speaking, this expression will return true 50% of the time, and false the other 50%. On line 30, replace the comment with this expression to complete the variable declaration.   First, you'll need a simple expression that randomly returns a different value every time it is run. You can use Math.random(). This method returns a value between 0 (inclusive) and 1 (exclusive) each time it is called. So for 50/50 odds, use Math.random() >= .5 in your expression. Statistically speaking, this expression will return true 50% of the time, and false the other 50%. In the render method, replace null with the above expression to complete the variable declaration.  Now you have an expression that you can use to make a randomized decision in the code. Next you need to implement this. Render the Results component as a child of GameOfChance, and pass in expression as a prop called fiftyFifty. In the Results component, write a ternary expression to render the h1 element with the text "You Win!" or "You Lose!" based on the fiftyFifty prop that's being passed in from GameOfChance. Finally, make sure the handleClick() method is correctly counting each turn so the user knows how many times they've played. This also serves to let the user know the component has actually updated in case they win or lose twice in a row.


Question:
Under Tests section text and textString do not match properly. If you only forget ' ; ' it still awaits for ' % ' We need a separate test for ' ; ' check or fix the text like ' Do not forget % or ; '
The can be made optional in the regex instead. Leaving the off the end of the line does not affect the code. The test is trying to get the user to implement a "best practice", but all we really care about is the code written is valid and accomplishes the task. Are you interested in creating a PR to make the at he end of the line optional?
While we are at it, can we strip the code of whitespace? I much prefer looking at regex without the everywhere.
I think that is fine. FYI - There are a few helper functions available that can be used in the testString by using . For example, you could use it in the referenced in this issue like:

- text: The value of remainder should be 2 testString: assert(remainder === 2); - text: You should use the % operator  testString: assert(/s+?remainders*?=s*?.*%.*;/.test(code));   testString: assert(/s+?remainders*?=s*?.*%.*;?/.test(code));  ```


Question:
<!-- NOTE: If you're reporting a security issue, don't create a GitHub issue. Instead, email We will look into it immediately. --Describe your problem and how to reproduce it: The exercise “Divide the Grid Into an Area Template” has a section where code is displayed. However, it is in a dull yellow font on a black background, and is difficult to read. I would like to request that the font color be changed to a higher contrast color. Add a Link to the page with the problem: Tell us about your browser and operating system: Browser Name: Chrome Browser Version: 86.0.4240.75 (Official Build) (64-bit) Operating System: Windows 10 If possible, add a screenshot here (you can drag and drop, png, jpg, gif, etc. in this box): See the text below “grid-template-areas:” !
Thanks for pointing this out it is incredibly hard to read. How about the following? ! cc:
Looks a lot better! Does it conform to the 4.5:1 contrast ratio suggested in a previous FCC lesson?
Good question and no, it's not quite enough. I tweaked it a bit further to which looks like this: ! That passes.
Now, It looks a lot better.
I am opening this issue up to . The changes mentioned by are what is expected.
For first timers, this appears to be the lines of code you want to focus on to change based on what is mentioned in
I would like to take this if it's open for grabbing. It will be my first time contributing to an open source project.
HELLO I WOULD LIKE TO WORK IF ITS OK . ITS MY FIRST TIME ,SO PLEASE GUIDE ME THROUGH
I have been attempting to fix this issue. My first attempt to modify the code suggested by was rejected because the file in that location is being removed. My new approach is to use the prism- file. Here is my proposed addition: However, I have some questions. I only noticed the issue with the css code block, but I suspect it may be a problem for other languages as well. I'm not sure how to tell which other languages may have this issue, or which classes to target (do I need to add ?) I also only noticed this issue for , but the css rule that currently applies to this block also targets , , and . I'm not sure if the problem exists for these classes as well, or how to check. Could someone with experience please comment on whether I should go ahead with my proposed changes, or make modifications?
Hi my best guess is that your proposed change is a good one. Reason being, the change hits both the font's colour and the background. So, anywhere that was suffering from poor contrast will be fixed by your change, which is exactly what we want. If you could make that change in your PR, we can QA it there.
I have made the changes here: See lines 49 through 57. How does QA work? Are you able to preview the website directly from GitHub?
Thanks, that looks good. Could you push them onto your PR? Almost, yeah. When you create a PR we can open a version of the site (including the PR's changes) in GitPod and preview it using that. It's neat.
I was able to figure out how to use GitPod. It looks like the changes work. ! I noticed that in prism-, there is already a rule for , , and . None of the others have a background. I tried viewing the string without a background, too, and it looks fine to me. Is there a reason for the background in the first place? My preference would be to remove it for consistency. !
You can see the PR commits here I recommend taking a look at the contribution docs, they cover this sort of thing:
Ah, I see, you mean on FCC. Here it is:
thank you for your interest in contributing to freecodecamp as our contributing docs say: you don't need to ask for permission, the first comprehensive PR is the one reviewed. You could start reading the contributing docs, if you have not yet:

color: #7ec699; } <ins> /* CSS code block strings have low contrast in night mode. This attempts to increase contrast above 4.5:1 */ .night .language-css .token.string, .night .style .token.string { color: #ec9126; background: hsl(0 0% 100% / 0.12); } </ins> .night .token.operator, .night .token.entity, .night .token.url {


Question:
<!-- NOTE: If you're reporting a security issue, don't create a GitHub issue. Instead, email We will look into it immediately. --Describe your problem and how to reproduce it: Correct answer doesn't get evaluated to true. Add a Link to the page with the problem: Tell us about your browser and operating system: Browser Name: Firefox Browser Version: Operating System: Windows 10 Home If possible, add a screenshot here (you can drag and drop, png, jpg, gif, etc. in this box): !
Hello there, You have not done what the lesson has asked. Whilst your code does cause the styling of the element to be what is expected, the lesson is about , your code is not using inline-styles to style the element, and so should not pass the challenge. As such, I am closing this issue. In general, if you have further questions, I recommend you make use of the I hope this clarifies.
Forum thread: I'm reopening this because I don't really understand the reason given for closing the issue. More importantly, I think we can make it more clear where the object is supposed to be located. That or make the tests accept a class field as well (seems unnecessary to allow both though).
I think that the failing example does use inline styles (at least as I understand it), it just does it in a way that doesn't use the typical pattern (but I have declared and modified inline styles dynamically in the component before). But then we're assuming that the learner is already familiar with the pattern we are trying to teach. Perhaps we could add to the instructions: I was thinking about an example, but it might be too similar to the answer. I think the above addition would make it clear with minimal disruption. Addendum: Sorry, I just read lasjorg's answer - that may be better than my suggestion. I could support either.
I think updating the seed code with the example I posted would be fine. But suggestion might work as well. I'm fine with either really. I was thinking that it seems like a good first-time PR but because issues are not visibly bumped up (can you bump issues?), I'm guessing this issue might be buried too far down. I can label it and see what happens, otherwise, we might just have to do it ourselves.
/assign
Hello, I would like to work on this issue. Can it be assigned to me?
Hello An issue with the help wanted or first timers only label is open for contribution. The first comprehensive PR created will be reviewed and merged. We typically do not assign issues to anyone other than long-time contributors. If you would like to contribute, and have not read the contributors docs, please do so here: If you have any issues with contributing, be sure to join us on the , or on the

# --instructions-- <del> If you have a large set of styles, you can assign a style `object` to a constant to keep your code organized. Initialize a `styles` constant and assign an `object` with three style properties and their values to it. Give the `div` a color of `purple`, a font-size of `40`, and a border of `2px solid purple`. Then set the `style` attribute equal to the `styles` constant. </del> <ins> If you have a large set of styles, you can assign a style `object` to a constant to keep your code organized. Declare your styles constant as a global variable at the top of the file. Initialize `styles` constant and assign an `object` with three style properties and their values to it. Give the `div` a color of `purple`, a font-size of `40`, and a border of `2px solid purple`. Then set the `style` attribute equal to the `styles` constant. </ins> # --hints--


Question:
<!-- NOTE: If you're reporting a security issue, don't create a GitHub issue. Instead, email We will look into it immediately. --Describe your problem and how to reproduce it: This was discussed on the forum and it was suggested I submit it to GitHub. The instructions of this challenge introduce the use of a “generic name” (optional) so I used “monospace” in the generic name. font-family: FAMILYNAME, GENERICNAME; . I would then get the error: " You should only use an h2 selector to change your font", which I was doing. It turns out any use of a generic name won't be accepted. Please update question to say "don't use generic for now" or update possible answer to allow for a generic insert. Add a Link to the page with the problem: Tell us about your browser and operating system: Browser Name: Chrome Browser Version:.. Operating System: Win 10 If possible, add a screenshot here (you can drag and drop, png, jpg, gif, etc. in this box): See link above for insight.
. I would support modifying the test to allow for a fallback value as shown in the challenge description. Before opening this up for contribution, though, I'd like some additional feedback to see if there is support for this change.
Thank you, for taking the time to bring this up. Importantly, the instructions do not mention anything about the generic font. In fact, they are quite clear about what is expected. In my opinion, there is no issue here. Also, I do not see this confusion popping up on the forum. Perhaps the point of discussion should be: Is it best-practice to use the generic/fall-back? If so, then we should consider rewriting the instructions, along with the tests. Something to keep in mind: The lesson is about importing a setting the font-family (the next lesson covers this)
I do agree that I haven't seen much confusion for this lesson popping up on the forum. The lesson does ask the camper to set the font-family of the element to - but the next lesson covers the "font degradation" fall-back value. Maybe it would be best to take this note (and the one below it) and move it to the next lesson? !
Yes, I was thinking the same. It is just, this is the type of information I would expect when first encountering a new property.
I'm not sure I would move it to the next lesson - there's already an example there. What about changing the last three paragraphs to this: If you both want to move it to the next lesson, I'm fine with it - but it seems like generic fonts are described there pretty good.


Question:
<!-- NOTE: If you're reporting a security issue, don't create a GitHub issue. Instead, email We will look into it immediately. --Describe your problem and how to reproduce it: The test statement should return doesn’t make sense, since 2008 is after 1977. Add a Link to the page with the problem: Tell us about your browser and operating system: Browser Name: Firefox Browser Version: 81.0.2 Operating System: Linux Mint
there seems to be just an issue in the test text: There is just to make so that the two functions, the one executed and the one written match. I will mark for first timers this is the file:

testString: assert(typeof findXmasSunday === 'function'); - text: findXmasSunday(2000, 2100) should return an array. testString: assert(typeof findXmasSunday(2000, 2100) === 'object');  - text: findXmasSunday(2008, 2121) should return [1977, 1983, 1988, 1994, 2005, 2011, 2016]   - text: findXmasSunday(1970, 2017) should return [1977, 1983, 1988, 1994, 2005, 2011, 2016]  testString: assert.deepEqual(findXmasSunday(1970, 2017), firstSolution); - text: findXmasSunday(2008, 2121) should return [2011, 2016, 2022, 2033, 2039, 2044, 2050, 2061, 2067, 2072, 2078, 2089, 2095, 2101, 2107, 2112, 2118] testString: assert.deepEqual(findXmasSunday(2008, 2121), secondSolution);


Question:
<!-- NOTE: If you're reporting a security issue, don't create a GitHub issue. Instead, email We will look into it immediately. --Describe your problem and how to reproduce it: The sample output in the sidebar has the date . The date should read . Source: and many other websites. Add a Link to the page with the problem: Tell us about your browser and operating system: Browser Name: Firefox Browser Version: 82 Operating System: Linux Mint
Looks like a fix would entail editing the challenge - the tests themselves appear to be accurate. I will open this up to first timers. thanks for the catch!

Return an array with the current date in the formats:

2007-11-23

Sunday, November 23, 2007

Friday, November 23, 2007

  Example output: ['2007-11-23', 'Sunday, November 23, 2007']   Example output: ['2007-11-23', 'Friday, November 23, 2007']
 ## Instructions


Question:
So, I tried submitting the following code: When I ran it through the tests, all but the last one passed. Then I in what I was supposed to do without removing the inline styles: This one passed all the tests! I know we were supposed to put stuff in the style tag, but I discovered this issue because I didn't want to do so much typing. There doesn't seem to be some check in the last test that looks at inline styles, unlike the rest. Can you look into it?
Hello there, Thank you, for taking the time to open this issue. This is expected behaviour. Recently, the test for the element was changed, because the usual method of testing did not work on some browsers (Safari, if I recall). So, unless we find a better method to test all of the elements, I would not advise any of the tests being changed. However, perhaps we could change the instructions to be explicit about requiring campers to not use inline-styles. I will leave this open for others to weigh in on.
I think this is about the only thing we can currently do.
I am good with adding a note there. Something like this: That whole thing could probably be shortened to something like this maybe: I'm fine with it either way.
I like second shortened suggestion.
Any idea why it’s only the h6 that doesn’t work? I’ve made a PR with the above but wonder if removing the h6 altogether from this challenge might be slightly more elegant in lieu of not having a different way to test?

## Instructions

Set the font-size of the h1 tag to 68px.

Set the font-size of the h2 tag to 52px.

Set the font-size of the h3 tag to 40px.

Set the font-size of the h4 tag to 32px.

Set the font-size of the h5 tag to 21px.

Set the font-size of the h6 tag to 14px.

In the style tags, set the font-size of the:

h1 tag to 68px.

h2 tag to 52px.

h3 tag to 40px.

h4 tag to 32px.

h5 tag to 21px.

h6 tag to 14px.

 ## Tests


Question:
Also, if you traverse from a right-to-left language (Arabic, Chinese), then go to English, the text remains right-to-left: ! Originally posted by in
Are translations available ?. Because If I go to the page click on translation and select a language , then the language remains as english , just the LTR or RTL thing changes. <img width="960" alt="issue" src="https://user-"
Not for many of the languages yet. They still need to be translated by contributors.

// Used from https://github.com/ckoliber/docsify-rtl/blob/master/build/docsify-rtl.js, // Currently this is a hack because can't use the plugin as is. <del> if (vm.route.path.search('Arabic') !== -1) { </del> <ins> if (vm.route.path.search('Arabic') !== -1 || vm.route.path.search('Hebrew') !== -1) { </ins> for (var counter = 0, elements = document.getElementsByClassName("markdown-section"); counter < elements.length; counter++) { var item = elements[counter]; item.dir = "rtl"; } }; <ins> if (vm.route.path.search('Arabic') === -1 && vm.route.path.search('Hebrew') === -1) { for (var counter = 0, elements = document.getElementsByClassName("markdown-section"); counter < elements.length; counter++) { var item = elements[counter]; item.dir = "ltr"; } }; </ins> return ( markdown + 'n----n' +


Question:
<!-- NOTE: If you're reporting a security issue, don't create a GitHub issue. Instead, email We will look into it immediately. --Describe your problem and how to reproduce it: The challenge "Testing Object for Properties" passes with wrong code: Add a Link to the page with the problem: users find the old solutions, paste that in the editor, and then add a new property to the object... My proposal is to add a few more tests - even obscured if needed, to avoid these kind of solutions passing
I created a PR to deal with this issue.

testString: 'assert(checkObj({city: "Seattle"}, "city") === "Seattle");' - text: 'checkObj({city: "Seattle"}, "district") should return "Not Found".' testString: 'assert(checkObj({city: "Seattle"}, "district") === "Not Found");'  - text: 'checkObj({pet: "kitten", bed: "sleigh"}, "gift") should return "Not Found".' testString: 'assert(checkObj({pet: "kitten", bed: "sleigh"}, "gift") === "Not Found");'  ```


Question:
To Reproduce Steps to reproduce the behavior: to /learn or /settings with the theme set to dark off internet connection and wait Actual behavior The offline warning message shows up, but the text is quite hard to read. Screenshots <img width="1680" alt="Screen Shot 2020-11-09 at 12 22 16 AM" src="https://user-"
WCAG does say the contrast is only 1.41:
The notification background is hardcoded and the font color is being handled based on theme. We have let bootstrap handle the styling for the notifications since they handle the font color and the background and look well on both themes. So doing the followings should do the trick. Add as a class here: and remove the from here:
I think the best way is to implement luma-corrected calculations. The first obvious implication of going with a luma-corrected approach is that the notification background color needs to switch to an RBG declaration for the backgrounds, calculate the luma from whatever method we choose, and use it on the foreground color declaration, which can (and will) still be HSL color. I am saying this because this would allow the font color to switch based on the contrast of the notification background contrast from to and vice versa.
can I work on this? I might need help. please guide me.
that is a cool trick. Thanks for sharing the link. Since are planning to move off of bootstrap, we should consider luma-corrected calculations in how we implement our dark/light themes during the rewrite process. Meanwhile, I think we could move forward with making the simple change that resolves this issue. sure. Make sure you read this:

} return showWarning ? (

  You appear to be offline, your progress may not be being saved.
 ) : null;

display: flex; justify-content: center; align-items: center; <del> background: lightblue; </del> }


Question:
Describe your problem and how to reproduce it: There is a bad link on the page. The link to 'help by answering coding questions' takes you to which says "Oops! That page doesn’t exist or is private." Add a Link to the page with the problem: Recommended fix, suggestions (how would you update it?): I tried looking around the forum for the page that that used to link to but I am not sure. I would say it could just go to the home page. If possible, add a screenshot here (you can drag and drop, png, jpg, gif, etc. in this box): <img width="1679" alt="Screen Shot 2020-11-20 at 8 48 48 AM" src="https://user-"<img width="1679" alt="Screen Shot 2020-11-20 at 8 49 35 AM" src="https://user-"
Nice catch! This link broke when we restructured our subforum categories, I believe. The link is located in this file: , and could be updated to redirect to the base forum URL I think.
When I click on the link from , it loads the forum in he Project Feedback category. There is not error. We did not change that category on the forum. It is still the same. Any thoughts?
I get the Project Feedback category off the second link ("Give feedback on coding projects"), but on the "Help by answering coding questions" I'm getting a 404.
I agree with adding a link to for . I have opened this issue up for .

## Here are some quick and fun ways you can help the community.  -  [Help by answering coding questions](https://forum.freecodecamp.org/c/help?max_posts=1) on our community forum.   -  [Help by answering coding questions](https://forum.freecodecamp.org) on our community forum.  -  [Give feedback on coding projects](https://forum.freecodecamp.org/c/project-feedback?max_posts=1) built by campers. -  [Help us translate](https://translate.freecodecamp.org) these Contributing Guidelines. -  [Contribute to our open source codebase](/index?id=our-open-source-codebase) on GitHub.


Question:
<!-- NOTE: If you're reporting a security issue, don't create a GitHub issue. Instead, email We will look into it immediately. --Describe your problem and how to reproduce it: This challenge is not aceepting the regex which is valid and matches all the conditions except one condition because it is checking whether 2 is used in the regex or if is used along with or . So, it does not accept the above regex. Add a Link to the page with the problem: Tell us about your browser and operating system: Browser Name: Firefox Browser Version: 83.0 (64-bit) Operating System: macOS 11.0.1 Big Sur If possible, add a screenshot here (you can drag and drop, png, jpg, gif, etc. in this box):
Thank you, for taking the time to raise this issue. I can confirm the issue. I suggest the test in question be removed: javascript assert( (/ (/(s)(?=.*(1|2))/g) ); ` There should be no need for it, as the test conditions satisfy the requirements of the instructions. I am opening this to first timers only
I'm fine with removing that test.
I've went ahead and changed this one to start familiarizing myself with the code and hopefully keep contributing. Please tell me if there's any problem.

assert(reRegex.source.match(/1|2/g).length >= 2); ``` <del> Your regex should have two spaces separating the three numbers. ```js assert( reRegex.source.match(/ |s/g).length === 2 || reRegex.source.match(/(s)(?=.*(1|2))/g) ); ``` </del> Your regex should match `"42 42 42"`. ```js


Question:
This is a dumb problem and I am new to GitHub so please forgive me for any weirdness. Basically, on this page, we see this explanation: This signals to JavaScript that the following quote is not the end of the string, but should instead appear inside the string. So if you were to print this to the console, you would get: Alan said, "Peter is learning JavaScript". and we are asked to make this string: I am a "double quoted" string inside "double quotes". However, I think that the period should be inside the quotations, grammatically. Like "double quotes." Thank you.
Thank you for your bug report, but I think this is in the realm of bike shedding
I do agree with that this is indeed a small typo but I also agree with that it is indeed a grammatical prob. Since this typo got noticed, I'd say let's fix it.
While I think it is fine to correct the typo, I think the tests should be loose enough to accommodate the period inside or outside the last double quote. The point of the challenge is escaping double quotes, so we do not want to get caught up in forcing the user to keep the period inside or outside the quotes. The reason I say this is the new curriculum is going in this direction. We are going to be lenient in the tests when it makes sense to. In my opinion, this is one of those cases.
Sure. Let's keep the tests lenient and fix the typo.
Is this still a first-timers issue now, since the contributor must also modify the test to accommodate both versions of the string?
Ooops. Forgot to update that. Thanks for the catch!
Thank you for your reply. I agree the grammar shouldn’t matter in the challenge. The problem was that when I tried to submit the answer with the “proper grammar,” it told me my answer was wrong, and I had to change it to the “improper” way. I’m an English teacher rather than a programmer, so completing the challenge with the improper grammar hurt my soul a little bit, haha.
Hey , I just made a PR () that fixes the grammar issue and it looks quite simple as there's no need to change the tests. So, let's open this up for , what do you say?
Just to add this: I do not see this as a bug/typo, because I mostly use British-styled English. So, the only reason we might change this is if we are trying to have uniformity about using only American-styled English within the curriculum.
both versions should be allowed, dot inside and dot outside. Your PR just changes wich version is allowed
I didn't knew that it differed in these two styles. If that is the case I'm in favour of closing this issue as it is proper English eitherway. The tests and the sentence in the test question isn't changed in my PR as it is correct. I only changed the example sentence in the PR. (Apologies for the trouble and misunderstanding )
the change discussed here about making both solutions work is not wanted anymore?
Re-opening.

Variable myStr should contain the string: `I am a "double quoted" string inside "double quotes".` ```js <del> assert(myStr === 'I am a "double quoted" string inside "double quotes".'); </del> <ins> assert(/I am a "double quoted" string inside "double quotes(."|".)$/.test(myStr)); </ins> ``` # --seed--


Question:
If I click on a link to a certificate from my settings page, it opens in the same tab. If I click on one from the timeline on my portfolio, it opens in a new tab. We could probably make this consistent. I believe I made the timeline links open in a new tab because there's no nav on the cert pages, so the only way to get back to the site is with the browsers back button. I believe I have also heard an argument that they should open in the same tab so I'm not sure what the better way to go is.
sir.. i would like to solve this i contribute??
please go ahead . No assignment is necessary as described in our . The first comprehensive PR will be considered for review.
So should it open in a new tab or in the same tab? what should happen?
same question as shold happen??
I will double check with the dev team and get back to you.
My vote was to open them in a new tab - like I said, there's no nav on the certs so you have to use the browsers back button to get back to the website.
I agree
I was told, "If the user donates on the certificate, the redux store will not be updated on the other tab and would need a refresh". So, I think that for now, we should open them in the current tab - unless someone has a better solution to that.
Could you clarify this? If the user donates on the certificate opened on a new tab, the redux store will not be opened on the original (settings) tab? This does not sound much like a problem. In fact, I would have said that is expected behaviour, from past experience.
So If a user donates on their certificate the store on that tab gets updated (isDonating: true). When the user goes back to the previous tab to work on the challenges, she will see the donation modal. (unless refresh). Solutions: 1) keep a navigation on the certs and keep them in the same tab 2) open certs in new tab but sync state across tabs, Might find this one helpful.
What is the chosen path to solve this issue? Or am I missing something?
We have not come to an agreement regarding the way to move forward yet. The options are listed . Once we reach an agreement, we should make the experience consistent across the app.

<Col className='certifications' sm={10} smPush={1}> <Link className='btn btn-lg btn-primary btn-block' <del> external={true} </del> to={`/certification/${username}/${cert.certSlug}`} > View {cert.title}

{certPath ? ( <Link className='timeline-cert-link' <del> external={true} to={`certification/${username}/${certPath}`} </del> <ins> to={`/certification/${username}/${certPath}`} </ins> > {challengeTitle} <CertificationIcon />


Question:
<!-- NOTE: If you're reporting a security issue, don't create a GitHub issue. Instead, email We will look into it immediately. --Describe your problem and how to reproduce it: using the code in this file: the challenge is passable by uncommenting lines 56-59 if (curr === null) { (curr, "curr") return null } The wording of the test is "Trying to remove an element that does not exist should return null." yet the assertions only test for removing a node that does not exist in an empty tree. What about removing nodes that do not exist in a tree that has nodes? ` Add a Link to the page with the problem: My pull request: Tell us about your browser and operating system: Browser Name: Browser Version: Operating System: If possible, add a screenshot here (you can drag and drop, png, jpg, gif, etc. in this box):
To summarize the issue: Test checks only if trying to remove non-existing element from empty tree will return null. It doesn't check if the same happens for removing non-existing element from non-empty tree. This can lead to implementation, which doesn't handle the second case at all (and even as in example above can end up with error), and still pass challenge.

); ``` <ins> Trying to remove an element from an empty tree should return `null`. ```js assert( (function () { var test = false; if (typeof BinarySearchTree !== 'undefined') { test = new BinarySearchTree(); } else { return false; } if (typeof test.remove !== 'function') { return false; } return test.remove(100) == null; })() ); ``` </ins> Trying to remove an element that does not exist should return `null`. ```js

if (typeof test.remove !== 'function') { return false; } <ins> test.add(15); test.add(30); </ins> return test.remove(100) == null; })() );


Question: <!-- NOTE: If you're reporting a security issue, don't create a GitHub issue. Instead, email We will look into it immediately. --Describe your problem and how to reproduce it: Load challenge. Observe that there are two instances of "{/ Change code below this line /}". The second should be {/ Change code above this line /} Could lead to confusion with users unsure if there's more to do in the challenge after adding the correct code to the challenge. Add a Link to the page with the problem: Tell us about your browser and operating system: Browser Name: Chrome Browser Version: 87.0.4280.88 Operating System: MacOS If possible, add a screenshot here (you can drag and drop, png, jpg, gif, etc. in this box): <img width="481" alt="Screen Shot 2020-12-12 at 10 26 49 PM" src="https://user-"

<div> {/* Change code below this line */} <h1>Active Users: </h1> <del> {/* Change code below this line */} </del> <ins> {/* Change code above this line */} </ins> </div> ); }


Question:
<!-- NOTE: If you're reporting a security issue, don't create a GitHub issue. Instead, email We will look into it immediately. --Describe your problem and how to reproduce it: In the first Helmet challenge it is said that to hide the X-powered-By set by default in some servers, can help to avoid attacks. I'm not saying this isn't true, but this is an extract from Helmet: They have an interesting side note for express:
Hello there, Thank you, for taking the time to open this. I am not sure I understand what you are saying needs to happen/ be changed? The current boilerplate file has what you mentioned: The idea behind the lesson is not how to use Helmetjs for Express apps, but what security measures exist, and what do they do.
You're welcome. I'd just include or link to helmet npm at least, or include that paragraph, because it's not really useful for security, as far as I can see. I mean, the exercise is to include Feel free to close it if it doesn't really help, no problem. I've read the boilerplate, it was great to see that :+1:
Ok, after doing more searching into this, I agree there are two things we might benefit from doing: 1) With the version we have set to be installed and used, can take arguements, but version cannot. So, I would suggest a camper not use an option. I.e. remove 2) Add some information along the lines of:
Yes, that'd be great, I was puzzled by the option too, cause they don't include it in the home page at least. Also, 3.21.3 isn't passing the exercise (the first one), don't know if this is just me, or there is some other update to do. Oops, just found out we need to remove from
I dunno, I really don't see much of a problem here. The challenge says that "Hackers can exploit known vulnerabilities in Express/Node if they see that your site is powered by Express." So it doesn't really claim that it adds security, more that it throws people off. Certainly, a determined person could figure out what is powering the app, this just makes it a little harder. Since the version of helmet we are using allows for the option to set the header, I don't mind leaving that in - I suppose removing would probably be better at this point - although, only slightly. It's certainly nice to update lessons when a package changes, but it's also difficult to keep things up to date. The method works with helmet v3 and v4 so I'm not sure why it's suggested to use that. One thing that does bother me here is that the boilerplate has the that pointed out. So if you want to actually see the header, you can't without removing that line no matter what method or options you use. My vote goes to just removing that line from the boilerplate. I actually don't mind making adjustments to this, but I don't think it's particularly necessary or that the current lesson is inaccurate. Part of my suggestion has to do with the translation effort taking place with the curriculum. When a lesson changes, we will need to start updating it in across all languages. So a minor fix like this becomes a significant effort. All that being said - if the consensus is to make some changes, I won't fight it. If we do end up changing it, I would say to switch to the method. Side note: the method that's used a few lessons after this was removed in helmet v4.
That's not true just initiate the app, you'll see the header. Indeed, they use app.disable(...) cause that's what they recommend in Helmet, which is another reason to leave that header out, mostly when most users are using express, and the exercise itself. (To see the header just include the route in , instead of ) My point is: you don't want people to learn a useless setting. Idk, seems to me the whole section is rather weak.

As a reminder, this project is being built upon the following starter project on [Repl.it](https://repl.it/github/freeCodeCamp/boilerplate-infosec), or cloned from [GitHub](https://github.com/freeCodeCamp/boilerplate-infosec/). <del> Hackers can exploit known vulnerabilities in Express/Node if they see that your site is powered by Express. X-Powered-By: Express is sent in every request coming from Express by default. The `helmet.hidePoweredBy()` middleware will remove the X-Powered-By header. You can also explicitly set the header to something else, to throw people off. e.g. `app.use(helmet.hidePoweredBy({ setTo: 'PHP 4.2.0' }))` </del> <ins> Hackers can exploit known vulnerabilities in Express/Node if they see that your site is powered by Express. `X-Powered-By: Express` is sent in every request coming from Express by default. Use the `helmet.hidePoweredBy()` middleware to remove the X-Powered-By header. </ins> # --hints--


Question:
<!-- NOTE: If you're reporting a security issue, don't create a GitHub issue. Instead, email We will look into it immediately. --There is a problem with the test for the telephone validator. They pass validators which do not check for proper spacing or dashing. (i. e. my validator will return true for 55 55-55-555-5). This is the my code which passed the test, but really shouldn't have: I'd recommend adding some extra tests to the exercise. Here is a link to the Tell us about your browser and operating system: Browser Name: Chrome Browser Version: Version 87.0.4280.88 Operating System: Windows 10 If possible, add a screenshot here (you can drag and drop, png, jpg, gif, etc. in this box):
Link to Link to
I guess a simple fix would be to add this test. should be false

assert(telephoneCheck('(555)5(55?)-5555') === false); ``` <ins> `telephoneCheck("55 55-55-555-5")` should return `false`. ```js assert(telephoneCheck('55 55-55-555-5') === false); ``` </ins> # --seed-- ## --seed-contents--


Question:
<!-- NOTE: If you're reporting a security issue, don't create a GitHub issue. Instead, email We will look into it immediately. --Describe your problem and how to reproduce it: In the description, it said "Nest three elements within each of your elements." I think it would be clearer to change it to the following: Nest three elements within each of your elements with class . Add a Link to the page with the problem: Tell us about your browser and operating system: Browser Name: Chrome Browser Version: 87.0.4280.88 Operating System: Mac OS If possible, add a screenshot here (you can drag and drop, png, jpg, gif, etc. in this box): !
What about the following?
That's even better, thank you.
Would you like to create a PR with this change?
Yes, I would like to do this.

Now we're several `div` elements deep on each column of our row. This is as deep as we'll need to go. Now we can add our `button` elements. <del> Nest three `button` elements within each of your `well` `div` elements. </del> <ins> Nest three `button` elements within each of your `div` elements having the class name `well`. </ins> # --hints--


Question:
<!-- NOTE: If you're reporting a security issue, don't create a GitHub issue. Instead, email We will look into it immediately. --Describe your problem and how to reproduce it: The challenge description says there is not a commented out array there I wouldn't know how to change that other than deleting the paragraph entirely Add a Link to the page with the problem: Tell us about your browser and operating system: Browser Name: Google Chrome Browser Version: 87.0.4280.77 Operating System: iOS 14.1 If possible, add a screenshot here (you can drag and drop, png, jpg, gif, etc. in this box):
Description is wrong. Code placeholder was changed in - test array moved from comment to function call argument, but description stayed same without any edits.
This seems quite reasonable. I will open this up to first timers
An issue with the help wanted or first timers only label is open for contribution. The first comprehensive PR created will be reviewed and merged. If you would like to contribute, and have not read the contributors docs, please do so here: If you have any issues with contributing, be sure to join us on the , or on the
I would Like to contribute to your cause i am a first timer and have not yet worked in big project but i want to start by freecodecamp
thank you for wanting to contribute, this issue has already a linked PR. Take a look at other issues with label "first timers only" and "help wanted" that do not have already a linked PR

**Instructions:** Write a function `bubbleSort` which takes an array of integers as input and returns an array of these integers in sorted order from least to greatest. <del> **Note:** We are calling this function from behind the scenes; the test array we are using is commented out in the editor. Try logging `array` to see your sorting algorithm in action! </del> # --hints-- `bubbleSort` should be a function.

**Instructions:** Write a function `insertionSort` which takes an array of integers as input and returns an array of these integers in sorted order from least to greatest. <del> **Note:** We are calling this function from behind the scenes; the test array we are using is commented out in the editor. Try logging `array` to see your sorting algorithm in action! </del> # --hints-- `insertionSort` should be a function.

**Instructions:** Write a function `mergeSort` which takes an array of integers as input and returns an array of these integers in sorted order from least to greatest. A good way to implement this is to write one function, for instance `merge`, which is responsible for merging two sorted arrays, and another function, for instance `mergeSort`, which is responsible for the recursion that produces single-item arrays to feed into merge. Good luck! <del> **Note:** We are calling this function from behind the scenes; the test array we are using is commented out in the editor. Try logging `array` to see your sorting algorithm in action! </del> # --hints-- `mergeSort` should be a function.

**Instructions**: Write a function `selectionSort` which takes an array of integers as input and returns an array of these integers in sorted order from least to greatest. <del> **Note:** We are calling this function from behind the scenes; the test array we are using is commented out in the editor. Try logging `array` to see your sorting algorithm in action! </del> # --hints-- `selectionSort` should be a function.


Question: Describe your problem and how to reproduce it: Data with test cases is in wrong place in challenge template. This makes it inaccessible when tests are run and makes challenge virtually unsolvable, unless test data is manually copied to the user code. Tests in this challenge uses three arrays, containing two inputs for the function and function outcome - arrays , , . They are called this way: Those variables are currently at the end of sample solution in challenge template. Simple moving them to more appropriate place - or section in the section - as shown in the , would deal with the issue. Add a Link to the page with the problem:


Question:
Challenge: Forum: Right now you can pass the challenge using a for loop with no conditionals. for both the presence and absence of properties (includes && !includes). change assert messages from "should include" to "should only contain".
Sounds good to me We could possibly use a deepEqual to make sure there aren't any other properties .

# --hints-- <del> The `ownProps` array should include `"name"`. </del> <ins> The `ownProps` array should only contain `"name"`. </ins> ```js <del> assert(ownProps.indexOf('name') !== -1); </del> <ins> assert.deepEqual(ownProps, ['name']); </ins> ``` <del> The `prototypeProps` array should include `"numLegs"`. </del> <ins> The `prototypeProps` array should only contain `"numLegs"`. </ins> ```js <del> assert(prototypeProps.indexOf('numLegs') !== -1); </del> <ins> assert.deepEqual(prototypeProps, ['numLegs']); </ins> ``` You should solve this challenge without using the built in method `Object.keys()`.