freeCodeCamp
freeCodeCamp copied to clipboard
Remove `apply` example from spread operator challenge.
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?
Yes.
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.
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.
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.
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.
This is part of the legacy certification