Skip to content

k-awe-some/js-array-functions

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

44 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Javascript Array Methods Recreations

Part of the Watch and Code® advanced curriculum, this project is a work-in-progress building and testing series of functions that imitate the established behaviours of Javascript array methods based on Joe Walnes's unit testing library. Taking the Test-Driven Development (TDD) approach, each test makes sure the re-created function satisfies the requirements of the corresponding native JS method.

List of methods tested (work-in-progress)

Iterators

Array.prototype.forEach()
Array.prototype.filter()
Array.prototype.map()
Array.prototype.reduce()
Array.prototype.find()
Array.prototype.findIndex()
Array.prototype.every()
Array.prototype.some()
Array.prototype.reduceRight()

Accessors

Array.prototype.concat()
Array.prototype.indexOf()
Array.prototype.lastIndexOf()
Array.prototype.includes()
Array.prototype.slice()
Array.prototype.join()

Mutators

Array.prototype.push()
Array.prototype.pop()
Array.prototype.shift()
Array.prototype.unshift()
Array.prototype.fill()
Array.prototype.reverse()
Array.prototype.copyWithin() - to be added
Array.prototype.sort() - to be added
Array.prototype.splice() - to be added

Visuals

Success sample

Failure sample

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License

MIT

About

Javascript + Unit Testing | A re-creating and testing series of JS array methods.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published