Use LEFT and RIGHT arrow keys to navigate between flashcards;
Use UP and DOWN arrow keys to flip the card;
H to show hint;
A reads text to speech;
21 Cards in this Set
- Front
- Back
.unshift(parameter) |
Adds new array value to beginning of an array |
|
.push(parameter) |
Adds value to array at the end |
|
(parameters).to_a |
Turns a set of values into an array |
|
array.uniq |
Show unique values in array |
|
array.each |
Loop method |
|
y.select {|working var| object.method} |
Select according to these parameters and display. This ties to using {} for functional displays |
|
array.join |
Join all array objects together into one unit w/out space |
|
array.join(“ “) |
Join elements of an array with space in between each element |
|
p.join(“-“) |
Join elements of an array with dash in between each element |
|
How to delete a key value pair on a hash |
myhash.delete(:d) |
|
To iterate through a hash using .each method and print out value |
myhash.each { |somekey, somevalue| puts somevalue } |
|
To iterate through a hash using .each method and print key, value in sentence format |
myhash.each do { |somekey, somevalue| puts “The key is #{somekey} and the value is #{somevalue}” } |
|
.abs |
Finds the absolute value of an integer and removes negatives — so if you want it to be negative you have to add a - |
|
Modulo: find the last number |
int % 10 |
|
Return # last digits of n Same as n % 10 |
num % (10 ** n) |
|
Return decimal remainder |
(Equation).modulo(1) |
|
Length of array |
array.length |
|
Sort array |
array.sort |
|
Convert array to string and put in descending order |
int.to_s.split(“ “).sort.reverse |
|
how to get fixed number from a decimal |
num.round(3) |
|
Precedence when comparing strings? |
Alphabetical precedence |