Freecodecamp: Beta Challenge : Copy Array items using Slice (minified "react" error)

Created on 3 Jun 2017  ·  3Comments  ·  Source: freeCodeCamp/freeCodeCamp

Challenge copy-array-items-using-slice has an issue.

If I simply return the array by slicing it, like this -



function forecast(arr) {
  // change code below this line
  return arr.slice(2,4);
}

// do not change code below this line
console.log(forecast(['cold', 'rainy', 'warm', 'sunny', 'cool', 'thunderstorms']));

it returns a minified react error .
image

The function returns the same value, as expected when I copy paste into the console.

first timers only help wanted bug

Most helpful comment

I'll give it a go, Timo!

All 3 comments

It was fixed after restarting browser, but should still be fixed.

First-timers only

Check out CONTRIBUTING.md to get your local development environment set up.

The issue is in the following line:
https://github.com/freeCodeCamp/freeCodeCamp/blob/885c73abac6bdc492f5fe913dd793332dbbb5dc3/seed/math-challenges/02-javascript-algorithms-and-data-structures/basic-data-structures.json#L254
The last <code> element in the message is never closed. It should be closed with </code> at the end of the message, right after the closing square bracket (])

If you need help, please visit our contributors chatroom. We're always happy to answer any questions!

Happy coding!

I'll give it a go, Timo!

Was this page helpful?
0 / 5 - 0 ratings