freeCodeCamp icon indicating copy to clipboard operation
freeCodeCamp copied to clipboard

Remove `apply` example from spread operator challenge.

Open naomi-lgbt opened this issue 1 year ago • 4 comments

The spread challenge uses .apply(), which hasn't (and I think isn't) been taught to campers yet.

Do we want to replace this with an example that doesn't throw a random new concept at campers?

naomi-lgbt avatar May 18 '23 19:05 naomi-lgbt

Yes.

jeremylt avatar May 19 '23 15:05 jeremylt

Yes. I'm sure we can come up with a simple example of using spread for arguments.

Here is the MDN example

function sum(x, y, z) {
  return x + y + z;
}

const numbers = [1, 2, 3];

console.log(sum(...numbers)); // 6

They do also show apply but they can (and do) also link to the documentation for it.

lasjorg avatar May 19 '23 19:05 lasjorg

I'd be fine with an example similar to MDN's.

We do specifically avoid external links in the curriculum content, so I'd prefer removing apply over keeping it and linking to the docs.

naomi-lgbt avatar May 19 '23 20:05 naomi-lgbt

I think overall it might be worth simplifying the language in the ES6 section. I think this sort of issue isn't exactly uncommon based upon learner questions on the forum.

jeremylt avatar May 23 '23 15:05 jeremylt

This has been sitting here for a bit. I'd like to open it up for contribution.

I think we could remove the apply example entirely, and rewrite the challenge to teach spread directly with the existing examples.

naomi-lgbt avatar Jul 21 '23 22:07 naomi-lgbt

This is part of the legacy certification

Sembauke avatar Feb 21 '24 10:02 Sembauke