- Extensions
- Babel ES6/ES7
My own version of The Technical Interview Cheat Sheet
##Table of Contents
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Extracting multiples of 3 | |
multiples_of_3 = Proc.new do |n| | |
n % 3 == 0 | |
end | |
(1..100).to_a.select(&multiples_of_3) | |
# Round down method | |
floats = [1.2, 3.45, 0.91, 7.727, 11.42, 482.911] | |
round_down = Proc.new { |n| n.floor } |