Description
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:
- Rationale for v3.
- The features of v3
- What are concepts and how they are structured?
- What are concept exercises and how they are structured?
Please also watch the following video:
See the documentation above (general documentation), as well as How to implement a Concept Exercise in JavaScript.
Goal
The goal of this exercise is to teach the student how to compare values in Javascript and then use that in conditional statements.
Concepts
The following concept pages need to be created. You can combine the two introduction.md files from the concepts and use that as introduction.md for the concept exercise. No need to create different content at this point.
comparison
conditionals
Learning Objectives
In the concepts the student should learn about the following operators and statements and then practice them in the concept exercise.
Comparison
<
,>
,>=
,<=
for numbers and strings- strict equality (
===
) - not equal (
!==
)
Conditionals
if(){}
if(){} else{}
if(){} else if(){} else{}
Out of Scope
- Loose equality
==
and truthy/falsy (will be taught once the student learned about type coercion) - Comparing values of different types
- Shallow/deep comparison of objects
- ternary operator
x ? y : z
switch
,for
About.md of the Concept
If there are no pitfalls, advanced usages etc. that you would like to point out, the about.md file can be a copy of the introduction.md of the concept.
For the conditionals
concept here some ideas what to mention in the about.md file.
- multiple
else if
- if statements without a block to execute just one thing (e.g.,
if(...) return ...
)
Prerequisites
basics
booleans
numbers
strings
When the students start this exercise they only know some basics about the primitive types. Keep that in mind when designing the exercise. See this list for details on the learning curve we are aiming for.
Exercise Idea
Julia Conditionals Exercise could be used as template
Help
You can choose to do this solo-style, or collaborate with multiple people on this. The suggested approach is to
- 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).
- Use this issue to write down what you need (collect reference material) and discuss, if necessary, what to write and what not to write.
- Draft a PR and request the feedback from at least one other JavaScript member (you can ping the #maintaining-javascript channel in Slack).