Skip to content

Instantly share code, notes, and snippets.

# Assessment
* What is AJAX and how do we use AJAX in our apps?
AJAX is Asynchronous Javascript XML - we use AJAX to create dynamic web pages that can be updated asynchronously from the database without refreshing the entire website.
* What is an API? Explain how we have used API's in the past week and how we make our own APIs
API stands for Application Program Interface. We used the OMDB API to fetch movie datas from OMDB in the form of JSON objects.
* AJAX Requests occur asynchronously. What does that mean generally? How must we consider this fact as we develop applications that use AJAX?
Ajax requests do not go line by line, from top to bottom. Instead, when there is a line of code that is waiting for a response from the server, ajax requests will execute other scripts while waiting for the server response, and once the server response will ready, deal with the server response related line of code.
# Week 8 Assessment
Please work alone. Please record your answers in the space provided.
`1.` Explain the differences between `Array.each` and `Array.map`. Use an example.
.each and .map are Ruby iterators; iterators are loops. .each iterator does not destroy the original input value whereas .map mutates the original input value. In Ruby land, changing the initial value is not good, so using making a new variable with .each to store the changed value is much better than just using .map.
array_each = [1, 2, 3, 4, 5]
// Using a Constructor Function, create a Cupcake Constructor.
Cupcake(cakeFlavor, frostingFlavor) = {
this.cake = cakeFlavor;
this.frosting = frostingFlavor;
sprinkles = false;
// Question 5 / 6 - Write your Cupcake Constructor Function here.
getCake = function() {
return this.cake;
};
getFrosting = function() {
@ahj212
ahj212 / assessment01.md
Created June 12, 2015 14:04
assessment week 1

// problem 1

pets = ["iguana", "hamster", "dog"]

pets[2];

// problem 2

coolThings = { david: "t-shirts", will: "nike boots", pavan: "snails"}

@ahj212
ahj212 / app.js
Created June 8, 2015 22:45
Hwan Ho (Andrew) Jeoung, comfort level (4), completeness (4)
// step 2
var userSelection = prompt("The (L) Train, The (N) Train, The (S)ix Train. Please input train selection: L, N, or S.");
alert("User has chosen: (" + userSelection + ") Train.");
// step 3 && 4
if (userSelection === 'L') {
//alert("8th Ave, 6th Ave, Union Square, 3rd Ave, 1st Ave, Bedford Ave.");
var userSearchL = prompt("Please input the station you are searching for:");
if (userSearchL === '8th Ave' || userSearchL === '6th Ave' || userSearchL === 'Union Square' || userSearchL === '3rd Ave' || userSearchL === '1st Ave' || userSearchL === 'Befdford Ave') {