AllanSeitz / assignments

All Suncoast assignments
0 stars 0 forks source link

Week 05 Day 2 - Function Junction #17

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.

AllanSeitz commented 6 years ago

https://github.com/AllanSeitz/function-junction.git

i really enjoyed this, i was impressed with how well i could type the functions out from memory

gstark commented 6 years ago

Very nice.

Do you understand how Math.max(...array) works -- We haven't covered this in class so I want to make sure you understand that idiom if you are going to use it.

Also

  if (
    x === 'a' ||
    x === 'A' ||
    x === 'e' ||
    x === 'E' ||
    x === 'i' ||
    x === 'I' ||
    x === 'o' ||
    x === 'O' ||
    x === 'u' ||
    x === 'U'
  ) {
    return true
  } else {
    return false
  }

Could be just

  return (
    x === 'a' ||
    x === 'A' ||
    x === 'e' ||
    x === 'E' ||
    x === 'i' ||
    x === 'I' ||
    x === 'o' ||
    x === 'O' ||
    x === 'u' ||
    x === 'U'
  )

Since if you have

if (condition) {
  return true
} else {
  return false
}

it is the same as

return condition
gstark commented 6 years ago

Your homework is: Meets Expectations

Awesome Work!

AllanSeitz commented 6 years ago

my understanding is Math.max(...array) will spread the array then return the largest number above in the array, is that correct? On Thursday, October 4, 2018, 8:21:51 AM EDT, Gavin Stark notifications@github.com wrote:

Very nice.

Do you understand how Math.max(...array) works -- We haven't covered this in class so I want to make sure you understand that idiom if you are going to use it.

Also if ( x === 'a' || x === 'A' || x === 'e' || x === 'E' || x === 'i' || x === 'I' || x === 'o' || x === 'O' || x === 'u' || x === 'U' ) { return true } else { return false }

Could be just return ( x === 'a' || x === 'A' || x === 'e' || x === 'E' || x === 'i' || x === 'I' || x === 'o' || x === 'O' || x === 'u' || x === 'U' )

Since if you have if (condition) { return true } else { return false }

it is the same as return condition

— You are receiving this because you modified the open/close state.

Reply to this email directly, view it on GitHub, or mute the thread.