// Eloquent JavaScript

// Run this file in your terminal using `node my_solution.js`. Make sure it works before moving on!

// Program Structure
// Write your own variable and do something to it.
var cat_name = "Finn"
console.log(cat_name, "is a great cat.")


// prompt("What's your favorite food?")
// alert("That's my favorite food too!")


// Complete one of the exercises: Looping a Triangle, FizzBuzz, or Chess Board



// Functions

// Complete the `minimum` exercise.



// Data Structures: Objects and Arrays
// Create an object called "me" that stores your name, age, 3 favorite foods, and a quirk below.


// Introduction
// Did you learn anything new about JavaScript or programming in general?
// I don'y know much about JavaScript, so there were definitely some new things here. One of the most interesting things was the fact that JavaScript is very "forgiving" in terms of what it will allow. It does seem like that will be difficult at first, but I'm interested to see how that will also give you the ability to be more flexible later on.

// Are there any concepts you feel uncomfortable with?
// Not in particular. As I said, I don't really have experience with this language, but nothing in the introduction seemed too crazy.


// Chapter 1
// Identify two similarities and two differences between JavaScript and Ruby syntax with regard to numbers, arithmetic, strings, booleans, and various operators.
//Similarities:
  // 1. The arithmetic operators are the same.
  // 2. Strings are handled in the same way.
// Differences
  // 1. In JavaScript you have to include the keyword "var" to declare a variable.
  // 2. The automatic type conversion in JavaScript seems very different from Ruby. I believe Ruby will raise an error any time you try to apply mathematical operations on dissimilar object types (except in a few cases).


// Chapter 2
// What is an expression?
// Anything that produces a value.

// What is the purpose of semicolons in JavaScript? Are they always required?
// It markes the end of an expression. They are not always required, but the rules regarding when they are not required are complicated.

// What causes a variable to return undefined?
// Undefined is returned when an operation doesn't yield a meaningful value.

// Write your own variable and do something to it in the eloquent.js file.
// See above.

// What does console.log do and when would you use it? What Ruby method(s) is this similar to?
// It prints something to the console. This is similar to p, print, and puts in Ruby.

// Write a short program that asks for a user to input their favorite food. After they hit return, have the program respond with "Hey! That's my favorite too!" (You will probably need to run this in the Chrome console (Links to an external site.) rather than node since node does not support prompt or alert). Paste your program into the eloquent.js file.
// See above.

// Describe while and for loops
// While and for loops do the same thing. They will continue to loop until a specified condition is met. For is a shorter version of while, but they function the same.

// What other similarities or differences between Ruby and JavaScript did you notice in this section?
// The main thing for me is that most of the concepts are essentially the same. While loops, if/else statements, etc. For the most part, it's just the syntax that is different.

// Complete at least one of the exercises (Looping a Triangle, FizzBuzz, of Chess Board) in the eloquent.js file.

// Looping a triangle

var counter = 1
while (counter <= 7) {
  console.log("#".repeat(counter ++));
}

// for (var i = 1; i < 101; console.log(i++)) {
//   if (i % 3 == 0 && i % 5 == 0) { console.log("FizzBuzz")};
//     else if (i % 3 == 0 ) { console.log("Fizz") };
//       else if (i % 5 == 0) { console.log("Buzz")};
//         else if (i % 3 != 0 || i % 5 != 0) { console.log(i) };
// }

switch

// Eloquent JavaScript

// Run this file in your terminal using `node my_solution.js`. Make sure it works before moving on!

// Program Structure
// Write your own variable and do something to it.
var cat_name = "Finn"
console.log(cat_name, "is a great cat.")


// prompt("What's your favorite food?")
// alert("That's my favorite food too!")


// Complete one of the exercises: Looping a Triangle, FizzBuzz, or Chess Board



// Functions

// Complete the `minimum` exercise.



// Data Structures: Objects and Arrays
// Create an object called "me" that stores your name, age, 3 favorite foods, and a quirk below.


// Introduction
// Did you learn anything new about JavaScript or programming in general?
// I don'y know much about JavaScript, so there were definitely some new things here. One of the most interesting things was the fact that JavaScript is very "forgiving" in terms of what it will allow. It does seem like that will be difficult at first, but I'm interested to see how that will also give you the ability to be more flexible later on.

// Are there any concepts you feel uncomfortable with?
// Not in particular. As I said, I don't really have experience with this language, but nothing in the introduction seemed too crazy.


// Chapter 1
// Identify two similarities and two differences between JavaScript and Ruby syntax with regard to numbers, arithmetic, strings, booleans, and various operators.
//Similarities:
  // 1. The arithmetic operators are the same.
  // 2. Strings are handled in the same way.
// Differences
  // 1. In JavaScript you have to include the keyword "var" to declare a variable.
  // 2. The automatic type conversion in JavaScript seems very different from Ruby. I believe Ruby will raise an error any time you try to apply mathematical operations on dissimilar object types (except in a few cases).


// Chapter 2
// What is an expression?
// Anything that produces a value.

// What is the purpose of semicolons in JavaScript? Are they always required?
// It markes the end of an expression. They are not always required, but the rules regarding when they are not required are complicated.

// What causes a variable to return undefined?
// Undefined is returned when an operation doesn't yield a meaningful value.

// Write your own variable and do something to it in the eloquent.js file.
// See above.

// What does console.log do and when would you use it? What Ruby method(s) is this similar to?
// It prints something to the console. This is similar to p, print, and puts in Ruby.

// Write a short program that asks for a user to input their favorite food. After they hit return, have the program respond with "Hey! That's my favorite too!" (You will probably need to run this in the Chrome console (Links to an external site.) rather than node since node does not support prompt or alert). Paste your program into the eloquent.js file.
// See above.

// Describe while and for loops
// While and for loops do the same thing. They will continue to loop until a specified condition is met. For is a shorter version of while, but they function the same.

// What other similarities or differences between Ruby and JavaScript did you notice in this section?
// The main thing for me is that most of the concepts are essentially the same. While loops, if/else statements, etc. For the most part, it's just the syntax that is different.

// Complete at least one of the exercises (Looping a Triangle, FizzBuzz, of Chess Board) in the eloquent.js file.

// Looping a triangle

var counter = 1
while (counter <= 7) {
  console.log("#".repeat(counter ++));
}



Update eloquent.js through chapter 2