Skip to content

Instantly share code, notes, and snippets.

View victoralvarez84's full-sized avatar
🏠
Working from home

Victor Alvarez victoralvarez84

🏠
Working from home
View GitHub Profile
//2. Why is 0.3 not the result of the following addition? How do you work around this peculiarity?
0.1 + 0.2; // Equals 0.30000000000000004
// A. the statement will not yield an answer of 0.3 because the + operator in this
// syntax is just adding data together, not doing an equation. The work around is:
// var x = (0.1 + 0.2)
/* Part 1
*
* Define a function reverse() that computes
* the reversal of a string. For example,
* reverse("skoob") should return the
* string "books".
*/
function reverse(str){
var x = '';
for (var i = 1; i < 101; i ++){
if (i % 15 == 0){
console.log('FizzBuzz');
}
else if (i % 5 == 0) {
console.log('Buzz');
}
else if (i % 3 == 0) {
console.log ('Fizz');
}
@victoralvarez84
victoralvarez84 / gist:e75b27b95d29ad667965
Created August 24, 2015 23:16
Assignment 1-1 - The Basics
//** 1. Assign the message "Hello, World!" to a variable.*//
const a = "Hello, World!";
// 2. Assign a different string to a different variable.
const b = "Star Wars!";
// 3. Assign a number to a variable.
const num = 1;
// 4. Use string concatenation to display the number from #3 in a string.
@victoralvarez84
victoralvarez84 / mindset.md
Last active August 29, 2015 14:27
Pre-work essay on based on the articles Fixed vs. Growth: The Two Basic Mindsets That Shape Our Lives by Maria Popova and What is Code by Paul Ford

Victor Alvarez

I have had a fixed mindset about many things, including tech. I have talked myself out of doing so many things because they are not a part of my self identification, be it learning how to code, cook, work out, or even let myself get angry in a healthy way. However, when I feeling confident or motivated, the growth mindset comes out. When I started to go to the gym last year, I wanted to learn and take in information, even if my ego had to be bruised a little. I wanted to learn how to code, even if I had to check wikipedia every five words. I still feel a little Fixed when in a way that it is hard for me to take criticism. I have to mentally prepare myself and even then, it’s tough. I get upset with how smug or overly confident someone with criticism can be. I project these thoughts and emotions on to the person.

I predict I will encounter difficulties with staying focused. I have trouble with that because I want to do a million things at once. I am not diagnosed with ADD but I act