Skip to content
This repository has been archived by the owner on Sep 25, 2019. It is now read-only.

Compound Assignment with Augmented Addition allows unintended solution #292

Open
robinmetral opened this issue Aug 31, 2018 · 0 comments
Open

Comments

@robinmetral
Copy link
Contributor

Describe the bug

The Basic Javascript challenge "Compound Assignment with Augmented Addition" basically asks learners to change:
a = a += 12;
to:
a += 12;

However the testing also allows for this solution:
a = a += 12
(which is the one I used because it's quicker to simply add an = sign)

Shouldn't it return an error for this? It should be clear that this compound assignment is intended to remove the first = sign and simplify the code.

Note: this also applies to the three subsequent compound assignment challenges

To Reproduce

Steps to reproduce the behavior:

  1. Go to Compound Assignment with Augmented Addition
  2. Solve the challenge with this code:
a = a += 12;
b = b += 9;
c = c += 7;
  1. See that the tests pass

Expected behavior

Tests to fail.

Desktop (please complete the following information):

  • OS: Ubuntu
  • Browser: Firefox
  • Version 61.0.1
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant