Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update step 18, 28, 38 hints for calorie counter project #54868

Closed
hbar1st opened this issue May 20, 2024 · 5 comments · Fixed by #54907
Closed

Update step 18, 28, 38 hints for calorie counter project #54868

hbar1st opened this issue May 20, 2024 · 5 comments · Fixed by #54907
Labels
help wanted Open for all. You do not need permission to work on these. new javascript course These are for issues dealing with the new JS curriculum scope: curriculum Lessons, Challenges, Projects and other Curricular Content in curriculum directory. type: bug Issues that need priority attention. Platform, Curriculum tests (if broken completely), etc.

Comments

@hbar1st
Copy link
Contributor

hbar1st commented May 20, 2024

Describe the Issue

The instructions in step 18 of the js beta to build a calorie counter says:

Start by declaring a cleanInputString function that takes a str parameter.

However if you misspell the function's name you receive this hint:

You should declare a cleanInputString variable.

I believe this message should be changed to say "function" instead of "variable"

Affected Page

https://www.freecodecamp.org/learn/javascript-algorithms-and-data-structures-v8/learn-form-validation-by-building-a-calorie-counter/step-18

Your code


function cleanInputStrin(str) {}

Expected behavior

the hint should refer to a function not a variable

Screenshots

No response

System

N/A

Additional context

No response

@hbar1st hbar1st added scope: curriculum Lessons, Challenges, Projects and other Curricular Content in curriculum directory. status: waiting triage This issue needs help from moderators and users to reproduce and confirm its validity and fix. type: bug Issues that need priority attention. Platform, Curriculum tests (if broken completely), etc. labels May 20, 2024
@hbar1st
Copy link
Contributor Author

hbar1st commented May 20, 2024

Similar issue was seen in step 28 where the hint said:
You should declare an isInvalidInput variable.

while the instructions were again to create a function:
Start by creating a function called isInvalidInput – it should take a single str parameter.


And again, similar issue in step38
hint says: You should declare an addEntry variable.
while the step is asking for a function

@ilenia-magoni ilenia-magoni added the new javascript course These are for issues dealing with the new JS curriculum label May 20, 2024
@Supravisor
Copy link
Contributor

From Pyramid Generator
https://www.freecodecamp.org/learn/javascript-algorithms-and-data-structures-v8/learn-introductory-javascript-by-building-a-pyramid-generator/step-42

A function is a block of code that can be reused throughout your application. Functions are declared with the following syntax:

function name(parameter) {

}

The function keyword tells JavaScript that the name variable is going to be a function. parameter is a variable that represents a value that is passed into the function when it is used. A function may have as many, or as few, parameters as you'd like. Like a for loop, the space between the curly braces is the function body.

Here, Campers are introduced to the idea of functions as JavaScript code for a variable.

@hbar1st
Copy link
Contributor Author

hbar1st commented May 21, 2024

Step 42 mentioned in the previous comment should be fixed. It should say: “The function declaration tells JavaScript that the name identifier is going to be a function.”
(Replacing ‘variable’ with ‘identifier’ and ‘keyword’ with ‘declaration’)

My understanding is that a function is actually an object in js but I would be surprised if a js course starts telling learners to “declare an object called myFunction” instead of saying “declare a function called myFunction”.

Edited…

@jdwilkin4
Copy link
Contributor

@hbar1st @Supravisor

Step 42 should be a separate issue IMO.
It shouldn't be lumped in with the corrections being made to the calorie counter steps

@jdwilkin4
Copy link
Contributor

Here the updates for this issue

updates step 18 hints

remove this hint and test

You should declare a `cleanInputString` variable.

```js
assert.isDefined(cleanInputString);
```

the current second hint and test should say this instead

You should declare a `cleanInputString` function.

```js
assert.isFunction(cleanInputString);
```

updates to step 28

remove this hint and test

You should declare an `isInvalidInput` variable.

```js
assert.isDefined(isInvalidInput)
```

updates to step 38 hints

remove this hint and test

You should declare an `addEntry` variable.

```js
assert.isDefined(addEntry);
```

udpate the second hint to the following

You should declare an `addEntry` function.

```js
assert.isFunction(addEntry);
```

@jdwilkin4 jdwilkin4 added help wanted Open for all. You do not need permission to work on these. and removed status: waiting triage This issue needs help from moderators and users to reproduce and confirm its validity and fix. labels May 21, 2024
@jdwilkin4 jdwilkin4 changed the title js beta - build a calorie counter step 18 error message requires correction Update step 18, 28, 38 hints for calorie counter project May 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Open for all. You do not need permission to work on these. new javascript course These are for issues dealing with the new JS curriculum scope: curriculum Lessons, Challenges, Projects and other Curricular Content in curriculum directory. type: bug Issues that need priority attention. Platform, Curriculum tests (if broken completely), etc.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants