Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2024 [Ahmad Ford]

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
61 changes: 5 additions & 56 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,59 +1,8 @@
# Underpants
This activity is essentially a re-write of [underscore.js](http://underscorejs.org/).
# @aford504/underpants

## Why?
In the past exercises we've been writing a lot of loops over objects and arrays ourselves. Instead of doing that, we are going to write several fuctions to handle the looping for us. These functions are used every day by professional developers and we're well on our way to becoming professional developers!!
A functional utility library implementing underscore.js-style functions. Created as part of a coding bootcamp exercise.

This means that if we're confused about how a function should work, we can check the underscore.js documentation linked above for help.
## Installation

## Instructions
- Open up index.html in a web browser.
- Notice that all the tests are failing. :)
- Open up underpants.js in a text editor and follow the instructions.
- Make all the test pass!!
- Open underpants.html in a text editor to view the code that runs the tests.

## Links and Resources

Some quick notes that may come in handy:

- [underscore documentation](http://underscorejs.org/).
- Many of the functions operate on "collections." They can take both arrays or
objects as their arguments and you need to be able to handle both cases.
- You can use `Array.isArray(obj)` to find out whether an object is an array.
- You can use `obj.length` to test if something is either a string or an
array.
- Javascript has a built-in `Math` object that provides some very useful
functions. [Math Documentation](https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Math).
- Within a function, you can use the `arguments` variable to access all the
parameters that were passed in even if they aren't named in the function
definition. This is useful if you don't know how many arguments are going to
be passed in in advance.
- You can count the arguments by using `arguments.length` and access each
argument using `arguments[i]`.
- The `arguments` object is very similar to an array, but note that it does
not support most array functions (such as `slice` or `push`). You can read
more about this [here](http://www.sitepoint.com/arguments-a-javascript-oddity/).

### Extra Credit:
See Instructor for instructions.
- defaults
- *once*
- memoize
- delay
- shuffle

### Double Extra Credit:
See Instructor for instructions.
- once
- invoke
- sortBy
- zip
- flatten
- intersection
- difference
- throttle

**Note:** Some browsers provide built-in functions--including `forEach`, `map`,
`reduce` and `filter`--that replicate the functionality of some of the functions
you will implement. Don't use them to implement your functions.
```bash
npm install @aford504/underpants
Loading