Giter VIP home page Giter VIP logo

pfwtfp-enumerable-drills-lab's Introduction

Enumerable Drills Lab

Introduction

In this lab, we will practice working with Enumerables to access data within a collection.

Learning Goals

Use the following Enumerators to iterate through collections. Use the tests to guide you. Focus on writing clean methods and making sure all three parts of your code is correct.

  • map
  • select
  • find
  • each
  • sort
  • max
  • include?
  • all?
  • any?

Conclusion

As you can see, you can manipulate data in more ways than you can possibly imagine. Keep reading through the documentation, and don't be afraid to play around with IRB and break things! You'll be surprised at what you can discover when you think you've broken everything - that's when the best breakthroughs happen.

Resources

pfwtfp-enumerable-drills-lab's People

Contributors

cjbrock avatar sgharms avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pfwtfp-enumerable-drills-lab's Issues

Issues with question 9

This solution code doesn't work
def using_any?(arr)
arr.any? { |item| item.to_a?(Integer)}
end

However this wrks
def using_any?(array)
array.any? { |int| int.is_a?(Integer)}
end

test spec issues with #using_all and #using_any methods

upon implementing my own helper methods, I discovered that there is something wrong with the test specs in this lab. Please address this issue.

`# Question 7

Write a method that uses all?

describe "#using_all?" do
it "takes in argument of an Array and returns true if all of the numbers in the Array are even (#all?)" do
expect(using_all?(enumerable_array_5)).to eq(false)
end
end

Question 8

Write a method that uses any?

describe "#using_any?" do
it "takes in argument of an Array and returns true if there are any integers in the given Array (#any?)" do
expect(using_any?(enumerable_array_2)).to eq(false)
end
end`

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.