<commit_before>Did you learn anything new about JavaScript or programming in general?
Are there any concepts you feel uncomfortable with?
Yes, I learned that it has nothing to do with Java.  It is a very liberal program, meaning it accepts a lot without telling you what is wrong,
but that this flexibility also can be advantageous. I also learned that some people who have written books about a programming
language, or at least one, hated the language when they started.

I am a little uncomfortable with the idea of hating another language (I currently hate CSS).  Otherwise, the intro was pretty basic.

Identify two similarities and two differences between JavaScript and Ruby syntax with regard to numbers, arithmetic, strings, booleans, and various operators.
SImilarities: They both use && and || as boolean operators; they both can use a ternary operator, written the same something ? this_if_true : this_if_false
Differences: In Ruby you can't add a string to a number(in that order)- you get an error.  In JS, it converts the number to a string and concatenates them.
In Ruby, the output of a boolean comparison of two values returns true or false.  In JS, it returns one of the values (based on its own rules).

What is an expression?
A fragment of code that produces a value.
What is the purpose of semicolons in JavaScript? Are they always required?
They signal the end of a statement.  Without it, it things the next line is part of the first.  There are a few exceptions where it can be ommitted.
What causes a variable to return undefined?
If you ask it for a value and it does not have one.
Write your own variable and do something to it in the eloquent.js file.
What does console.log do and when would you use it? What Ruby method(s) is this similar to?
Console.log outputs the result of an expression.  It is like puts or print (not sure if it includes a linebreak).  It logs it in the Javascript console

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.
Describe while and for loops

What other similarities or differences between Ruby and JavaScript did you notice in this section?
They both use while, do, for, and if statements.  Syntax for a second conditional if statement is elsif in Ruby, else if in JS.
JS has a way to succinctly make a "counter" statement: for (initializing statement; the check; the update) ex. for (counter = 0; counter < 10; counter = counter + 1)
Complete at least one of the exercises (Looping a Triangle, FizzBuzz, of Chess Board) in the eloquent.js file.



CODE Exercises:
var sand_dollar = 5;
sand_dollar = sand_dollar * 10;

Short program:
prompt("What is your favorite food?", "");
alert("Hey! That\'s my favorite too!");<commit_msg>Include Javascript exercise solutions and attempts<commit_after>
// Write your own variable and do something to it in the eloquent.js file.

// 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.
// Describe while and for loops


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



// CODE Exercises:
// var sand_dollar = 5;
// sand_dollar = sand_dollar * 10;

// Short program:
// prompt("What is your favorite food?", "");
// alert("Hey! That\'s my favorite too!");

// Challenges-

// Triangle

// var hashTag = "#"
// for (var counter = 0; counter > 7; counter++);
// 	console.log(hashTag++ "\n");

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

// Currently printing only the last number ... .
// FizzBuzz
// for (var number = 0; number < 100; number += 1);
// 	{if (number % 3 == 0 && number % 5 ==0)
// 		var statement = "FizzBuzz";
// 	else if (number % 3 == 0) statement= "Fizz";
// 	else if (number % 5 == 0) statement = "Buzz";
// 	else statement = number;
// 	console.log(statement);
// 	}

// Chess Board
// var board = ""
// for (line = 1; line <= 8; line+= 1) 
// 	if (line % 2 == 0) board += "# # # # \n";
// 	else board += " # # # #\n";
// 	console.log(board);



// FUNCTIONS:
// Exercise: minimum

// var min = function(a, b){
// 	return Math.min(a,b);
// 	}
// console.log(min(0, 10));
// console.log(min(0,-10));

// 

// RECURSION
// function isEven(N){
//   if (N == 0) 
//   	return true;
//   else if (N == 1) 
//   	return false;
//   else isEven(N-2);
// }
// console.log(isEven(50));
// // → true
// console.log(isEven(75));
// // → false
// console.log(isEven(-1));
// → ??

// BEAN COUNTING
// function countBs(str){
//   var numBs = 0;
//   for (var counter = 0; counter < str.length; counter+=1)
//   	if str.charAt(counter) == "B";
//     numBs = numBs + 1;
// 	}

// console.log(countBs("BBC"));
// // → 2
// console.log(countChar("kakkerlak", "k"));
// // → 4

// DATA STRUCTURES:
// me = {name: Kim, age: 38, favoriteFoods: ["Indian", "chocolate", "rice"] quirk: "I sleep better camping than at home"}

{'fraction_non_alphanumeric': 0.11443148688046648, 'fraction_numerical': 0.009839650145772596, 'mean_word_length': 3.3425632911392404, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2927121', 'n_tokens_mistral': 1707, 'n_tokens_neox': 1601, 'n_words': 792}