Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

VHadyak
Copy link

@VHadyak VHadyak commented Oct 19, 2022

Complete the following REQUIRED checkboxes:

  • I have thoroughly read and understand The Odin Project Contributing Guide
  • The title of this PR follows the location of change: brief description of change format, e.g. 01_helloWorld: Update test cases

Complete the following checkboxes ONLY IF they are applicable to your PR. You can complete them later if they are not currently applicable:

  • I have ensured any exercise files included in this PR have passed all of their tests

1. Because:

Add an additional solution to 'Remove from array' JS exercise using a loop

const removeArr = (arr, ...value) => {                   // rest (...) parameter helps to store multiple values
    for (let i = arr.length; i >= 0; i--) {              // loops through original array
        for (const j of value) {                         // loops through each individual value in 'value' array
            if (arr[i] === j) {          
                arr.splice(i, 1);                        // remove matching values from original array
            }
        }
    }
    return arr;
}

2. This PR:

  • Loop through 'arr' array
  • Loop through 'value' array
  • Find matching values between 'arr' and 'value'
  • If matching values are found, remove it from 'arr' and return a new 'arr'

3. Additional Information:

remtaine and others added 30 commits August 7, 2021 14:21
Ordered the exercise folders by placing their numbers in their folder name
An explanation of debugging in visual studio code.
Co-authored-by: Tatiana <[email protected]>
…n-caesar

Fixed typo in caesar cipher excersize
add clarifiying comment about not removing code
change 'says hello world'  to   'says "Hello, World!" ' to be identical to the code in the (helloWorld.spec.js) file.
Corrected the word "this" so it starts with an upper case "T".
Making it consistent with other exercise setups
@VHadyak VHadyak changed the title 04_removeFromArray: Add additional solution using a loop for, loop ... of approach 04_removeFromArray: Add an additional solution using for loop, loop ... of approach Oct 19, 2022
@VHadyak VHadyak changed the title 04_removeFromArray: Add an additional solution using for loop, loop ... of approach 04_removeFromArray: Add an additional solution using for loop, for ... of approach Oct 19, 2022
@VHadyak VHadyak closed this Oct 19, 2022
@VHadyak VHadyak reopened this Oct 19, 2022
@VHadyak VHadyak closed this Oct 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.