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

[V3] Implement new Concept Exercise: Functions #994

Closed
junedev opened this issue Feb 23, 2021 · 1 comment · Fixed by #1183
Closed

[V3] Implement new Concept Exercise: Functions #994

junedev opened this issue Feb 23, 2021 · 1 comment · Fixed by #1183
Assignees
Labels
new exercise ✨ x:rep/large Large amount of reputation

Comments

@junedev
Copy link
Member

junedev commented Feb 23, 2021

Getting started

Please please please read the docs before starting. Posting PRs without reading these docs will be a lot more frustrating for you during the review cycle, and exhaust Exercism's maintainers' time. So, before diving into the implementation, please read up on the following documents:

Please also watch the following video:

See the documentation above (general documentation), as well as How to implement a Concept Exercise in JavaScript.

Goal

Functions were already briefly mentioned in the basics concept. The goal of this exercise is to give a proper introduction to functions so the student is prepared to get introduced to callbacks in a later concept exercise.

Concepts

The following concept page need to be created. You can use the same content for the introduction.md of the concept and the concept exercise. No need to create different content at this point.

  • functions

Learning Objectives

In the concept/introduction the student should learn about the following things and then practice them in the concept exercise.

  • How to define a function (it is probably ok to repeat the basics in some more detail here)
  • All arguments are optional in JS
  • What happens if the function is called with fewer or more arguments than mentioned in the function definition
  • How to set default parameters
  • Return an object if you want to return multiple values
  • Pass by value vs. pass by reference
  • Functions are first-class objects (can be assigned to variables, passed around etc.)
  • Function Scope
  • What happens if there is no return statement

Out of Scope

The following topics will be introduced later and should therefore not be part of this concept exercise.

  • Rest parameters
  • Callbacks
  • Methods
  • Arrow functions (will be introduced later together with callbacks)
  • Recursion
  • Closures
  • Higher Order Functions

About.md of the Concept

Here some ideas of what could be mentioned.

  • Anonymous functions
  • Talk about hoisting, explain that function declarations are hoisted, function expressions are not
  • Arguments array

Prerequisites

  • objects
  • null-undefined

See this list for details on the learning curve we are aiming for.

Exercise Idea

This concept is very special to JS so there is probably no fitting exercise in other tracks to use as a template and the exercise needs to be created from scratch. As general inspiration for the story, Lasanga Master might help.

Help

You can choose to do this solo-style, or collaborate with multiple people on this. The suggested approach is to

  1. First accept this issue by saying "I'd like to work on this" (you will not get a response, just go with it) and optionally request that someone works with you (and wait for a second person to accept your request).
  2. Use this issue to write down what you need (collect reference material) and discuss, if necessary, what to write and what not to write.
  3. Draft a PR and request the feedback from at least one other JavaScript member (you can ping the #maintaining-javascript channel in Slack).
@junedev
Copy link
Member Author

junedev commented Jun 16, 2021

I will work on this but it will probably take a while as there is quite some ground to cover and exercise tasks to invent.

@junedev junedev added the x:rep/large Large amount of reputation label Apr 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new exercise ✨ x:rep/large Large amount of reputation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants