Skip to content

Conversation

@SleeplessByte
Copy link
Member

Blocks writing all the examples below:

export function fixListOfWagons(ids) {
  const firstTwo = ids.slice(0,2)
  const rest = ids.slice(2)
  return [...rest, ...firstTwo]
}

export function correctListOfWagons(ids, missingWagons) {
  const firstOne = ids.slice(0,1)
  const rest = ids.slice(1)
  return [...firstOne,...missingWagons,...rest]
}

export function correctListOfWagons(ids, missingWagons) {
  return [ids[0], ...missingWagons, ...ids.splice(1)];
}
  • slice will not be a function on the list
  • [0] will return undefined
  • console.log(missingWagons) will print List of (1,2,3) in node (and later also in web)

@SleeplessByte SleeplessByte requested a review from Cool-Katt June 10, 2025 22:47
@SleeplessByte SleeplessByte added x:action/improve Improve existing functionality/content x:module/concept-exercise Work on Concept Exercises x:type/content Work on content (e.g. exercises, concepts) labels Jun 10, 2025
@github-actions

This comment was marked as off-topic.

@SleeplessByte SleeplessByte changed the title Prevent not following the instructions Train Driver: Prevent not following the instructions Jun 10, 2025
@Cool-Katt Cool-Katt merged commit 486d201 into main Jun 11, 2025
10 checks passed
@Cool-Katt Cool-Katt deleted the chore/spread-limit-methods branch June 11, 2025 06:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

x:action/improve Improve existing functionality/content x:module/concept-exercise Work on Concept Exercises x:type/content Work on content (e.g. exercises, concepts)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants