Skip to content

Instantly share code, notes, and snippets.

JavaScript Part 1

Topics:

  • Variables & Data types
  • Conditional Statements
  • Functions & Scope
  • setting up a document to use jQuery
  • jQuery Selectors & Methods
  • Retrieving Form Values
  • Arrays
<script>
// ATM lab Directions
//1. set initial balance
//2. prompt the user for their choice
//3. run a particular function based on the users choice.
//4. tell the user their new balance.
//to exit use window.close();

JavaScript Part 1

Topics:

  • Variables & Data types
  • Conditional Statements
  • Functions & Scope
  • setting up a document to use jQuery
  • jQuery Selectors & Methods
  • Retrieving Form Values
  • Arrays

what is a linked list?

how is a linked list different than an array?

why have you never heard of a linked list before?

how would you implement a linked list in ruby?

wikipedia

what is a linked list?

how is a linked list different than an array?

why have you never heard of a linked list before?

how would you implement a linked list in ruby?

wikipedia

What is a closure?

How do we implement/create/use a closure in Ruby?

What's the difference between a closure in JS vs Ruby?

Why do we use closures so much more in JS as opposed to Ruby?

What is the Ruby analog of an anonymous function in Javascript?

require 'yaml'
require 'logger'
require 'active_record'
namespace :db do
def create_database config
options = {:charset => 'utf8', :collation => 'utf8_unicode_ci'}
create_db = lambda do |config|
ActiveRecord::Base.establish_connection config.merge('database' => nil)

###Hello Review Session!

Below I have included a fairly complex hash called 'us_government' the following questions will be about going through this hash. Write the code that answers each of the questions below.

  1. Return an Array of of the names of all the Supreme Court Justices
  2. access the hash with the name attribute "Senator 18"
  3. Print out the names of all the Representatives to the console
  4. Return an array with the names of all members of the government
  5. Remove "Senator 6" from the hash
  6. Add "Representive 20" to the house of representatives