Giter VIP home page Giter VIP logo

inject-challenge's Introduction

Inject Challenge (Rubyist Badge)

Instructions

  • Feel free to use google, your notes, books, etc but work on your own
  • You must submit a pull request to this repo with your challenge solution by 9am Monday morning

Task

  • Fill out your learning plan self review for the week: https://github.com/makersacademy/learning_plan
  • Spend an hour composing a blog post that answers the following questions: What are blocks, procs and lambdas? Provide code examples to show the differences between each of them. What makes procs and lambdas different to methods?
  • Fork this repo
  • Ensure you have the 'bundle' gem by running the command 'gem install bundle'. Then run the command 'bundle' in the project directory to ensure you have all the gems you need for this.
  • Reopen the Array class or subclass it.
  • Rewrite the inject method. Write a test for it first. Don't worry about returning an enumerator, assume a block is always given
  • Name your method differently (that is, not inject() or subclass Array) because rspec uses inject() internally, so the tests will fail with weird messages unless your implementation of inject is perfect.
  • If you would like a challenge, rewrite inject using two approaches: using iterators and using recursion but it’s not required to pass.
  • Submit pull request with your solution

Build Status Coverage Status

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.