Giter VIP home page Giter VIP logo

caveman.js's Introduction

#Caveman JS

Back in my day, we didn't code with all these fancy abstracted JavaScript methods like push and slice. We did things manually with for loops and basic operators. So can you code like your grandpappy and/or grandmommy? Do you have what it takes to go paleo and throw out your modern coding conveniences?

This is nonsense of course. Methods like split and concat are profoundly useful and any decent engineer should know and use them. But have you ever wondered what's going on under the hood? What if you needed to micromanage performance and had to implement one or two of these manually? Or maybe you are a new JS developer, and you just need a little practice.

Caveman JS is a library of incomplete stub functions and accompanying tests. The focus is on useful native JS methods that you should probably know a little more about, and can implement with basic syntax. You won't need callback functions, recursion, or even the this keyword. Everything can be solved with basic loops, conditionals, operators, and occasionally the arguments object. If you need to practice your JavaScript fundamentals, this is the repo for you.

##How To Use This Repo Use GitHub's "Download ZIP" feature to download a copy of Caveman JS. Once downloaded, use your text editor of choice to fill out the code in the four numbered files. Each covers a different group of useful native functions. Your job is to make each function work identically to its native equivalent, and to do so without using any functions you haven't written yourself. No native functions allowed!

To assist you, there is a suite of Mocha/Chai tests that you can run by opening TestRunner.html in any browser. This will track your progress, showing you which functions are failing and which tests are the problem. But beware relying too much on tests! There may be cases they miss, and you really should know whether your code is working or not without them.

##The Methods If you have any questions about how one of these functions is designed to work, remember that they are should operate identically to their native counterparts unless otherwise specified. Might be a good idea to look up the MDN page for any methods you aren't clear on.

###Part 01: The Math Object Covers various Math methods, including Math.ceiling, Math.abs, and Math.pow among others. It should make for a pretty easy start.

###Part 02: The Array Prototype Covers some useful array methods including push, pop, shift, concat and others. These are functions you should be using every day.

###Part 03: The String Prototype Covers a few string methods including slice (which should work on arrays too), split, and replace. Things start to get a little more complicated here.

###Part 04: Extra Credit If you're feeling really adventurous there a few extra methods for you to tackle here, including splice (doable), Date.parse (quite a challenge), and Math.sqrt (hahahaha). Have fun!

##Bugs? Unexpected Behvaior? Feel free to submit an issue via GitHub, or even fork the project and submit your own PRs!

caveman.js's People

Contributors

delventhalz avatar rlee34 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.