Skip to content
This repository was archived by the owner on Apr 1, 2021. It is now read-only.
This repository was archived by the owner on Apr 1, 2021. It is now read-only.

Slasher Intermediate explanation has incorrect statement regarding slice() #1208

@raisedadead

Description

@raisedadead

Refers : freeCodeCamp/freeCodeCamp#9501

by @wiseleo:

Someone apparently copied the explanation from splice.

Modify the array with slice() and return it.

Slice does not modify arrays.

The slice() method returns a shallow copy of a portion of an array into a new array object. - Source: MDN

The entire explanation is problematic:

  • This solution uses the slice() function. OK
  • The argument howMany is the number of elements to be removed skipped since beginning of array starting with arr[0].
  • Modify the array with slice() and return it. Return the remaining array without modifying original array

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions