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

Compound Assignment with Augmented Addition allows unintended solution #292

@robinmetral

Description

@robinmetral

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions