JFlynn426 / assignments

my assignments for SDG
0 stars 0 forks source link

Week 03 - Day 3 - Function Juntion #10

Closed gstark closed 6 years ago

gstark commented 6 years ago

Objectives

After completing this assignment, you should be able to:

Requirements

  1. Fork this repository to your own account.
  2. Change into your training directory
  3. Clone your repository: hub clone function-junction
  4. Change into your project's directory: cd function-junction
  5. Install the dependencies: yarn install (or just yarn for short)
  6. Open in Code: code .
  7. Start the test runner: yarn test
  8. Open src/functions.test.js and work on functions until tests pass.
  9. Commit and push your work to GitHub.
  10. Turn in the URL to your GitHub repo.

Explorer Mode

Adventure Mode

Epic Mode

Additional Resources

Reference the documentation on MDN to find what kind of helpful functions might already be on Array and String in JavaScript.

JFlynn426 commented 6 years ago

https://github.com/JFlynn426/function-junction

gstark commented 5 years ago

nicely done

This can be refactored:

let isVowel = string => {
  if (
    string === 'a' ||
    string === 'e' ||
    string === 'i' ||
    string === 'o' ||
    string === 'u' ||
    string === 'y' ||
    string === 'A' ||
    string === 'E' ||
    string === 'I' ||
    string === 'O' ||
    string === 'U' ||
    string === 'Y'
  ) {
    return true
  } else {
    return false
  }
}

Could just be

let isVowel = string => {
  return (
    string === 'a' ||
    string === 'e' ||
    string === 'i' ||
    string === 'o' ||
    string === 'u' ||
    string === 'y' ||
    string === 'A' ||
    string === 'E' ||
    string === 'I' ||
    string === 'O' ||
    string === 'U' ||
    string === 'Y'
  )
}
gstark commented 5 years ago

Your homework was marked: Meets Expectations

Yas

“Yas” — via Jason L Perry