Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

JS cert: question's answer on functions lecture is misleading #68744

Copy link
Copy link

Description

@behrouziyeh
Issue body actions

Describe the Issue

Hi,
I just did the lecture for working with functions in javascript and in my opinion, one of the question didn't have a fully correct answer and it was kinda misleading. I asked it in the discord server and was told to report it here. here's the question:

Image

as you can see, it asks for for a correct way for invoking the function sum(num1, num2) and it lists sum() as the answer. but, although you can call the function without the arguments/parameteres, but because num1 and num2 does not have a default value, they'll both be undefined and the result will be NaN.

Affected Page

https://www.freecodecamp.org/learn/javascript-v9/lecture-working-with-functions/what-is-the-purpose-of-functions-and-how-do-they-work

Expected behavior

I guess that either the answer should change to something like sum(3, 7) or some default values should be added in sum() function definitions (probably zero) or entirely changing the function with a simpler one that doesn't have arguments at all.

Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Labels

    scope: curriculumLessons, Challenges, Projects and other Curricular Content in curriculum directory.Lessons, Challenges, Projects and other Curricular Content in curriculum directory.status: waiting triageThis issue needs help from moderators and users to reproduce and confirm its validity and fix.This issue needs help from moderators and users to reproduce and confirm its validity and fix.

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    Morty Proxy This is a proxified and sanitized view of the page, visit original site.