Skip to content

gmoraleslondono/100-days-of-code

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

82 Commits
ย 
ย 

Repository files navigation

100 Days Of Code

This challenge encourages you to practice whatever you want to learn for 100 days a minimum of 1 hour per day. It is important to write a log with the learned every day.

Daily log

Day 0: January 8, Tuesday.

After a long time thinking ๐Ÿ™„ about starting, today I said "Challenge accepted"๐Ÿฅณ

๐Ÿ† My goal: Learn HTML, CSS, and JavaScript.

๐Ÿ›ค๏ธ Links to the roadmap:

Day 1: January 9, Wednesday.

Today's Progress:

๐Ÿ›ซ Starting! Taking a quick HTML review๐Ÿ›ต. I remembered the markup language structure, syntax and some elements that usually are used๐Ÿค“.

Link(s) to work:

Day 2: January 10, Thursday.

Today's Progress:

Today I went into Cascading Style Sheets (CSS). ๐Ÿ‘ฉโ€Exploring the relationship between content, padding, margin, and border๐Ÿ“ also known as the box model๐Ÿ“ฆ

Link(s) to work:

Day 3: January 11, Friday.

Today's Progress:

๐ŸCSS Diner: A game for learning CSS selectors. Doneโœ…

Selectors are how you pick which element to apply styles to.

h1 {
    text-align: center;
}

Here h1 is the selector. Sellect all <h1> elements and applies text-align style.

Link(s) to work:

Day 4: January 12, Saturday.

Today's Progress:

How CSS style overriding works by relevance:

  • Id style
  • Class style (Last class declaration more relevant)
  • Element style

When !important rule is used, it overrides any other style declarations.

Link(s) to work:

Day 5: January 13, Sunday.

Today's Progress:

Keep going with CSS๐Ÿค 

๐Ÿ‘ฉโ€๐ŸŽจStyle a specific color using: Color name, Hex code, abbreviated Hex Code or RGB values.

/*Color name*/
.text-green {
  color: green;
}
/*Hex code*/
.text-pink {
  color: #FFC0CB;
}
/*Hex code abbreviated*/
.text-white {
  color: #FFF;
}
/*RGB value*/
.text-red {
  color: rgb(255,0,0);
}

Link(s) to work:

Day 6: January 14, Monday.

Today's Progress:

๐Ÿ“‹ CSS variables Today, I complemented Freecodecamp tutorial with some of w3school ๐Ÿ˜Žโœจ

https://www.w3schools.com/css/css3_variables.asp

Link(s) to work:

Day 7: January 15, Tuesday.

I was working on my portfolio ๐Ÿ‘ฉโ€๐Ÿญ and I did some CSS Freecodecamp challenges ๐Ÿ’ซ , for today no too much to show or say.๐Ÿ˜ฌ

Day 8: January 16, Wednesday.

Understanding GitHub ๐Ÿ˜บ Took time (almost all afternoon๐Ÿคช) but finally, I created my repository ๐Ÿค–

Link(s) to work:

Day 9: January 18, Friday.

โœ…ย Still doing my portfolio ๐Ÿ˜ and practiced some CSS properties.

Link(s) to work:

Day 10: January 21, Monday.

And finally, this is my portfolio๐Ÿฅณ (Still building ๐Ÿ‘ฉโ€๐Ÿ”ง) โค๏ธ---โค๏ธ---โค๏ธ-->

Link(s) to work:

Day 11: January 22, Tuesday.

๐Ÿง Exploring CSS properties:

 ๐Ÿ‘‰๐Ÿฟ position ๐Ÿ—บ๏ธ

Link(s) to work:

Day 12: January 23, Wednesday.

๐Ÿ˜ I am in love with CSS. I tried some animations and look here โฌ‡๏ธ the result.๐Ÿ˜Š

Link(s) to work:

Day 13: January 24, Thursday.

๐Ÿ“ฒ Accessibility web content challenges ๐Ÿ”ค

  • โ˜๏ธHave well-organized code that uses appropriate markup.
  • โœŒ๏ธEnsure text alternatives exist for non-text and visual content.
  • ๐ŸคŸCreate an easily-navigated page that's keyboard-friendly. From @freeCodeCamp ๐Ÿคฉ

Link(s) to work:

Day 14: January 26, Saturday.

๐Ÿ› ๏ธ Practicing some HTML tags. I still follow freeCodeCamp tutorial ๐Ÿค“

Link(s) to work:

Day 15: January 27, Sunday.

Today I meet amazing women ๐Ÿ˜Š learnt basic Python ๐Ÿค– and enjoyed 3D workshop ๐Ÿ˜ฏ๐Ÿ– Great Sunday Meetup!

Day 16: January 29, Tuesday.

CSS Flexbox๐Ÿ“ฆ

๐ŸŒˆ Learned how to design flexible and responsive layouts ๐ŸŽ‘

Link(s) to work:

Day 17: January 30, Wednesday.

Today I practiced what I learned yesterday. I used an amazing and interactive website Flexbox Froggy. It is a game for learning CSS flexbox created by Codepip

Link(s) to work:

Day 18: January 31, Thursday.

I have been learning #CSS grid, this article help me to understand a lot๐Ÿ˜Œ๐Ÿ”ข

Day 19: February 1, Friday.

Watering carrots to practice #CSS grid ๐Ÿฅ•๐Ÿšฟ๐Ÿ˜„

๐Ÿ‘ฉโ€๐ŸซAlso, I practiced some properties in codepen.

Grid Garden is a game created by Codepip.

Link(s) to work:

Day 20: February 2, Saturday.

๐Ÿค— I am celebrating twenty days of code ๐Ÿ‘ and finished my first project ๐Ÿฅณ๐Ÿ’ƒ

Look here my tribute page to Dr. Manuel Elkin Patarroyo #vaccineagainstmalaria

Link(s) to work:

Day 21: February 3, Sunday.

Taking advantage to the bad weather ๐Ÿฅถ and staying at home ๐Ÿ˜ I did #freeCodeCamp project 2: Build a Survey Form.๐Ÿ“‘

Link(s) to work:

Day 22: February 6, Wednesday.

๐Ÿ‘ฉโ€๐Ÿ”ง Doing #freeCodeCamp Responsive Web Design Projects ๐Ÿ’ž

Project 3: Product Landing Page ๐Ÿ˜Ž

Link(s) to work:

Day 23: February 10, Sunday.

๐Ÿ˜Š Still with #freeCodeCamp Responsive Web Design Projects ๐Ÿ’ช

Project 4: Technical Documentation Page ๐Ÿค–

Link(s) to work:

Day 24: February 12, Tuesday.

๐Ÿฅณ #freeCodeCamp Responsive Web Design Projects ๐Ÿ’ช

Project 5: Build a Personal Portfolio Webpage ๐Ÿ‘ฉโ€๐Ÿ’ป

Link(s) to work:

Day 25: February 13, Wednesday.

Starting with fundamental #javascript ๐Ÿฅณ

๐Ÿ™ I hope I will get soon my Javascript Algorithms And Data Structures ๐Ÿ™„ #freecodecamp certification ๐Ÿ‘ฉโ€๐ŸŽ“

Day 26: February 14, Thursday.

Learning JavaScript Basic Methods

.push() ---> Adds one or more parameters at the end of the array.

var arr = [1,2,3];
arr.push(4);
//arr is now [1,2,3,4]

.pop() ---> Removes the last element from an array and returns that element.

var arr = [1,2,3];
var val = arr.pop();
//arr is now [1,2]
//val is now [3]

.shift() ---> Removes the first element from an array.

var arr = [1,2,3];
var val = arr.shift();
//arr is now [2,3]
//val is now [1]

.unshift() ---> Adds the element at the beginning of the array.

var arr = [1,2,3];
arr.unshift(0);
//arr is now [0,1,2,3]

Day 27: February 15, Friday.

Taking time to learn about version control and GitHub. Today I used GitHub Learning Lab to practice:

๐Ÿ˜ป Introduction to GitHub.

๐Ÿคณ Communicating using Markdown.

Link(s) to work:

Day 28: February 16, Saturday.

Scope refers to the visibility of variables.

In JavaScript there are two types of scope:

  • Local scope
  • Global scope

Variables which are defined outside of a function block have Global scope. This means, they can be seen everywhere in your JavaScript code.

See an example:

    var someColor = "red"; // Variable with global scope
    
    function myFun() {
        var someSentence = someColor + " hat"; // Variable with local scope
        return someSentence;
    }
    
    console.log("I have a " + myFun()); // I have a red hat

Link(s) to resources:

Day 29: February 19, Tuesday.

๐Ÿฅณ Learning #JavaScript ๐Ÿง™โ€โ™€๏ธ how to use functions. I did a comparative exercise for lookups: Using Objects Vs Switch statement Vs Else if statement โฌ‡๏ธ

Switch statement:

function myFunction(val) {
    var result = "";

    switch(val) {
      case "a": 
        result = "Adams";
        break;
      case "b": 
        result = "Boston";
        break;
      case "c": 
        result = "Chicago";
        break;
      case "d": 
        result = "Denver";
        break;
      case "e": 
        result = "Easy";
        break;
      case "f": 
        result = "Frank";
    }
  
    return result;
  }
  
  myFunction("c"); // "Chicago"

Else if statement:

function myFunction(val) {
  var result = "";

  if (val === "a") {
      result = "Adams";
  } else if ( val === "b") {
      result = "Boston";
  } else if ( val === "c") {
      result = "Chicago";
  } else if ( val === "d") {
      result = "Denver";
  } else if ( val === "e") {
      result = "Easy";
  } else if ( val === "f") {
      result = "Frank";
  }

  return result;
}

myFunction("c"); // "Chicago"

Object:

function myFunction(val) {
var result = "";

var lookup = {
  "a" : "Adams",
  "b" : "Boston",
  "c" : "Chicago",
  "d" : "Denver",
  "e" : "Easy",
  "f" : "Frank"
};

result = lookup[val];

return result;
}

myFunction("c"); // "Chicago"

Day 30: February 20, Wednesday.

30 days ago I started this journey ๐Ÿ˜ฑ the time is going so fast! ๐Ÿš€

Today I took a little break from JavaScript and got relax playing with #CSS ๐Ÿฅฐ I love drawing with CSS, I think I found a new hobby

Link(s) to work:

Day 31: February 21, Thursday.

๐Ÿคฉย In 20% of JavaScript Beginner Bootcamp (2019) #udemy course, created by @robmerrill.

Excellent material, a lot of exercises, and awesome explanations ๐Ÿ˜‰

Link(s) to resources:

Day 32: February 22, Friday.

๐Ÿงšโ€โ™€๏ธ Using basic JavaScript, HTML, and CSS I did a little web app that generates random insults ๐Ÿ˜๐Ÿคฌ

Link(s) to work:

Day 33: February 24, Sunday.

๐Ÿ™†โ€โ™€๏ธ Today, I was solving some #JavaScript #freeCodeCamp challenges and practiced how to access nested objects and nested arrays.๐Ÿคช

The Challenge:

Basic JavaScript: Record Collection

You are given a JSON object representing a part of your musical album collection. Each album has several properties and a unique id number as its key. Not all albums have complete information.

Write a function which takes an album's id (like 2548), a property prop (like "artist" or "tracks"), and a value (like "Addicted to Love") to modify the data in this collection.

If prop isn't "tracks" and value isn't empty (""), update or set the value for that record album's property.

Your function must always return the entire collection object.

There are several rules for handling incomplete data:

If prop is "tracks" but the album doesn't have a "tracks" property, create an empty array before adding the new value to the album's corresponding property.

If prop is "tracks" and value isn't empty (""), push the value onto the end of the album's existing tracks array.

If value is empty (""), delete the given prop property from the album.

Hints Use bracket notation when accessing object properties with variables.

Push is an array method you can read about on Mozilla Developer Network.

You may refer back to Manipulating Complex Objects Introducing JavaScript Object Notation (JSON) for a refresher.

The solution:

var collection = {
    "2548": {
      "album": "Slippery When Wet",
      "artist": "Bon Jovi",
      "tracks": [ 
        "Let It Rock", 
        "You Give Love a Bad Name" 
      ]
    },
    "2468": {
      "album": "1999",
      "artist": "Prince",
      "tracks": [ 
        "1999", 
        "Little Red Corvette" 
      ]
    },
    "1245": {
      "artist": "Robert Palmer",
      "tracks": [ ]
    },
    "5439": {
      "album": "ABBA Gold"
    }
};

function updateRecords(id, prop, value) {

  if (prop !== "tracks" && value !== "") {
    collection[id][prop] = value;
  }

  if (prop === "tracks" && !collection[id].hasOwnProperty("tracks")) {
    collection[id][prop] = [];
    collection[id][prop].push(value);
  }

  if (prop === "tracks" && value !== "") {
    collection[id][prop].push(value);
  }

  if (value === "") {
    delete collection[id][prop];
  }
  
  return collection;
}

// Alter values below to test your code
updateRecords(5439, "artist", "ABBA");

Day 34: February 25, Monday.

Building shapes using pure #CSS. ๐Ÿ”ด๐Ÿ”ถ๐Ÿ”ผ๐Ÿ’š๐Ÿ›‘

Link(s) to work:

Day 35: February 26, Tuesday.

Some #ES6 topics that I learned today:

โœ… Differences between var, const and let.

โœ… Use Arrow Functions to write anonymous functions.

const myFunc = () => "value"

โœ… Use methods map() and filter().

/*
Use arrow function syntax to compute the square of only the positive integers (decimal numbers are not integers) 
in the array realNumberArray and store the new array in the variable squaredIntegers.
*/

const realNumberArray = [4, 5.6, -9.8, 3.14, 42, 6, 8.34, -2];

const squareList = (arr) => {

  const squaredIntegers = 
    // use .filter() to sellect numbers that meet the conditions: 1. positive number (number>0) and 2. number without decimals (number%1 == 0)
        arr.filter((number) => number > 0 && number% 1 === 0)
    // use .map() to apply a math operation to each number, in this case get the squared (Math.pow(number, 2)) to each integer
        .map((number) => Math.pow(number, 2));

  return squaredIntegers;
};

// test your code
const squaredIntegers = squareList(realNumberArray);
console.log(squaredIntegers);

// const squaredIntegers = [16, 1764, 36]

Day 36: February 27, Wednesday.

๐Ÿ”ฅ Finished ES6 chapter on #freeCodeCamp

๐Ÿป I did a mini console App: "Bear, Human, Gun Game" #udemy

Bear, Human, or Gun

Bear human gun is just like Rock paper scissors. Each player chooses either bear, human, or gun. The items are compared, and whichever player chooses the more powerful item wins.

The possible outcomes are:

  • Bear mauls human.

  • Human disarms gun.

  • Gun shoots bear.

  • If there's a tie, then the game ends in a draw.

Challenge:

Our code will break the game into four parts:

  1. Get the user's choice.

  2. Get the computer's choice.

  3. Compare the two choices and determine a winner.

  4. Start the program and display the results.

Solution:

function getUserChoice(userInput) {
  userInput = userInput.toLowerCase();
  if (userInput === "bear" || userInput === "human" || userInput === "gun") {
    return userInput;
  } else {
    return "Please sellect bear, human or gun";
  }
}
function getComputerChoice() {
  var choose = ["bear", "human", "gun"];
  var randomNumber = Math.floor(Math.random() * choose.length);
  var randomChoose = choose[randomNumber];
  return randomChoose;
}
function determineWinner(userChoice, computerChoice) {
  if (userChoice === computerChoice) {
    return "Game tie!";
  }
  if (userChoice === "human") {
    if (computerChoice === "bear") {
      return "computer won!";
    } else {
      return "user won!";
    }
  }
  if (userChoice === "bear") {
    if (computerChoice === "gun") {
      return "computer won!";
    } else {
      return "user won!";
    }
  }
  if (userChoice === "gun") {
    if (computerChoice === "human") {
      return "computer won!";
    } else {
      return "user won!";
    }
  }
}
function playGame() {
  var promptUserChoice = prompt("Please choose bear, human or gun");
  promptUserChoice = promptUserChoice.toLowerCase();
  if (promptUserChoice === "") {
    return "Please choose bear, human or gun";
  }
  var userChoice = getUserChoice(promptUserChoice);
  var computerChoice = getComputerChoice();
  console.log(userChoice);
  console.log(computerChoice);
  console.log(determineWinner(userChoice, computerChoice));
}
playGame();

Day 37: March 1, Friday.

๐Ÿจ Here โฌ‡๏ธ my #CSS Koala ๐Ÿฅณ๐Ÿ˜

Link(s) to work:

Day 38: March 4, Monday.

๐Ÿคฉ Improving my #CSS skills ๐Ÿš€

Amazing tutorial by Mike Mangialardi ๐Ÿ˜ป

I drew a diamond and used animation to do it shine ๐Ÿ’Žโœจ

Link(s) to resources:

Day 39: March 5, Tuesday.

๐Ÿ‘‹ Working on regex challenges๐Ÿ˜Œ Hopefully finish this chapter tomorrow ๐Ÿ˜œ

Day 40: March 6, Wednesday.

I really enjoy working with #CSS โค๏ธ

Today I got some inspiration from comics... ๐Ÿค–

Link(s) to work:

Day 41: March 9, Saturday.

โœ”๏ธ Mini App to convert temperature using basic JavaScript ๐ŸŒก๏ธ

โœ”๏ธ Mini App to measure calories using basic JavaScript ๐Ÿง๐ŸŠ

โœ”๏ธย Used Chrome DevTools to debug my code ๐Ÿ›๐Ÿ˜Š

Mini App: Convert temperature

Challenge:

Use class keyword to create a Thermostat class. The constructor accepts Fahrenheit temperature.

Now create getter and setter in the class, to obtain the temperature in Celsius scale.

Remember that C = 5/9 * (F - 32) and F = C * 9.0 / 5 + 32, where F is the value of temperature in Fahrenheit scale, and C is the value of the same temperature in Celsius scale.

Solution:

function makeClass() {
    "use strict";
    /* Alter code below this line */
    class Thermostat {
      constructor (temperatureFahrenheit) {
        this.temperatureFahrenheit = temperatureFahrenheit;
      }
      get temperature() {
        return 5/9 * (this.temperatureFahrenheit - 32);
      }
      set temperature(updateTemperature) {
        this.temperatureFahrenheit = updateTemperature * 9.0 / 5 + 32;
      }
    }
    /* Alter code above this line */
    return Thermostat;
  }
  const Thermostat = makeClass();
  const thermos = new Thermostat(76); // setting in Fahrenheit scale
  let temp = thermos.temperature; // 24.44 in C
  thermos.temperature = 26;
  temp = thermos.temperature; // 26 in C

Mini App: Calorie Calculator

Challenge:

The program will determine the actual and ideal calories you consumed last week. It will return a message based on if you ate too much or too little.

Solution:

function inputCaloriesByDay(day) {

    switch (day) {
        case "Monday":
            return 3500;
            break;
        case "Tuesday":
            return 1500;
            break;
        case "Wednesday":
            return 2500;
            break;
        case "Thursday":
            return 2000;
            break;
        case "Friday":
            return 3000;
            break;
        case "Saturday":
            return 2800;
            break;
        case "Sunday":
            return 3000;
            break;
        default: 
            return "Please choose a valid day";
    }
}

function getTotalCalories() {
    var sum = inputCaloriesByDay("Monday")+
    inputCaloriesByDay("Tuesday")+
    inputCaloriesByDay("Wednesday")+
    inputCaloriesByDay("Thursday")+
    inputCaloriesByDay("Friday")+
    inputCaloriesByDay("Saturday")+
    inputCaloriesByDay("Sunday");

    return sum;
}

function getIdealCalories() {
    var idealDailyCalories = 2000;
    return idealDailyCalories*7;
}

function calculateHealthPlan() {
    var actualCalories = getTotalCalories();
    var idealCalories = getIdealCalories();
    if (actualCalories === idealCalories) {
        return "You ate just the right amount of food!";
    } else if (actualCalories > idealCalories) {
        return "Time to head to the gym!";
    } else if (actualCalories < idealCalories) {
        return "Time for seconds!";
    }
}

console.log(calculateHealthPlan()); //Time to head to the gym!

Day 42: March 10, Sunday.

Today I was working on:

๐Ÿ‘† JavaScript Regular Expressions โœ๏ธ

โœŒ๏ธ Mini App Magic Eight Ball to predict the future ๐Ÿง™โ€โ™€๏ธ

Mini App: Magic Eight Ball

Challenge:

The user will be able to input a question, then our program will output a random fortune.

Solution:

var userName= prompt("What is your name?");

    if (userName) {
        console.log("Hello " + userName + "!");
    } else {
        console.log("Hello!"); 
    }

var userQuestion= prompt("Please ask a question!");

console.log(userName + " ask: " + userQuestion);

var randomNumber = Math.floor(Math.random()*8);

var eightBall = "";

    switch (randomNumber) {
       case 0:
        eightBall = 'Better not tell you now.';
        break;
       case 1:
        eightBall =  'Concentrate and ask again.';
        break;
       case 2:
        eightBall =  'Reply hazy try again';
        break;
       case 3:
        eightBall =  'Cannot predict now';
        break;
       case 4:
        eightBall =  'My reply is no.';
        break;
       case 5:
        eightBall = 'My sources say no';
        break;
       case 6:
        eightBall =  'Outlook not so good';
        break;
       case 7:
        eightBall =  'Signs point to yes';
        break;
    }

console.log("Eight Ball answer: "+eightBall);

//Hello Cecilia!
//Cecilia ask: Will I win
//Eight Ball answer: My sources say no

Day 43: March 14, Thursday.

I did this figure using HTML and CSS ๐Ÿฅฐ

๐Ÿค” I am thinking which will be the next superhero figure ๐Ÿคญ

Link(s) to work:

Day 44: March 15, Friday.

๐Ÿ“Œ I finished the eternal "JavaScript Regular Expressions" section. I don't know why it took to me so long time to finish it๐Ÿคช

๐Ÿ“Œ I did all the Debugging challenges section ๐Ÿฅณ

๐Ÿ“Œ And I started Basic Data Structures section ๐Ÿ‘ฉโ€๐Ÿ”ฌ

Day 45: March 17, Sunday.

Learning JavaScript Data Structures:

๐ŸŽ–๏ธ Creating arrays and consulting them.

๐ŸŽ–๏ธ Modify arrays using methods: push(), unshift(), pop(), shift() and splice().

๐ŸŽ–๏ธ Also, copy or extract information from arrays using slice().

Day 46: March 18, Monday.

Today I learn to...

๐ŸŽ€ Use Spread Operator to copy arrays and combine arrays ๐Ÿ’ซ

๐ŸŽ€ Use indexOf() to validate elements in an array โœ”๏ธ

Using Spread Operator to copy arrays

function copyMachine(arr, num) {
    let newArr = [];
    while (num >= 1) {
      newArr.push([...arr]);
      num--;
    }
    return newArr;
}  
console.log(copyMachine([true, false, true], 2)); //[true, false, true,true, false, true]

Using Spread Operator to combine arrays

function spreadOut() {
    let fragment = ['to', 'code'];
    let sentence = ["learning", ...fragment, "is", "fun"];
    return sentence;
} 
console.log(spreadOut()); // ['learning', 'to', 'code', 'is', 'fun']

Using indexOf() to validate elements in an array

function quickCheck(arr, elem) {
    return arr.indexOf(elem) >= 0 ? true : false;
}
console.log(quickCheck(['squash', 'onions', 'shallots'], 'mushrooms')); //false

Day 47: March 19, Tuesday.

I finished the "Basic Data Structure Challenges" ๐Ÿฅณ and I learned how to:

โ›ณ๏ธ Generate an array of object keys with Object.keys()

โ›ณ๏ธ Use for... in statement

โ›ณ๏ธ Use keyword delete to remove object properties

Some examples using for... in statement

Example 1

We've defined a function, countOnline; use a for...in statement within this function to loop through the users in the users object and return the number of users whose online property is set to true.

let users = {
  Alan: {
    age: 27,
    online: false
  },
  Jeff: {
    age: 32,
    online: true
  },
  Sarah: {
    age: 48,
    online: false
  },
  Ryan: {
    age: 19,
    online: true
  }
};

function countOnline(obj) {
  let count = 0;
  for (let userKey in obj) {
  
    let userValue = obj[userKey];

    if (userValue.online) {
      count += 1;
    }
  };
  return count;
}

console.log(countOnline(users)); //2

Example 2

We've defined a function, countOnline; use a for...in statement within this function to loop through the users in the users object and return the number of users whose online property is set to true.

let user = {
    name: 'Kenneth',
    age: 28,
    data: {
      username: 'kennethCodesAllDay',
      joinDate: 'March 26, 2016',
      organization: 'freeCodeCamp',
      friends: [
        'Sam',
        'Kira',
        'Tomo'
      ],
      location: {
        city: 'San Francisco',
        state: 'CA',
        country: 'USA'
      }
    }
  };
  
  function addFriend(userObj, friend) {
    // change code below this line  
   for (let dataKey in userObj) {
     let data = userObj[dataKey];
     userObj.data.friends.push(friend);
     return userObj.data.friends;
   }
    // change code above this line
  }
  
  console.log(addFriend(user, 'Pete'));

Day 48: March 20, Thursday.

Spent a long time trying to solve the "Basic Algorithm Challenges" ๐Ÿ˜” only 5 today and I'm feeling like ๐Ÿคฏ

I hope soon I could solve them easily and faster ๐Ÿ™

โฌ‡๏ธ Function to get the largest number in an array with subarrays โฌ‡๏ธ

Challenge:

Return Largest Numbers in Arrays.

Return an array consisting of the largest number from each provided sub-array. For simplicity, the provided array will contain exactly 4 sub-arrays.

Remember, you can iterate through an array with a simple for loop, and access each member with array syntax arr[i].

Solution:

function largestOfFour(arr) {
    let newArr = [];
    
    for (let i = 0; i < arr.length; i++) {
  
      let largestNumber = arr[i][0];
  
      for (let j = 1; j < arr[i].length; j++) {
  
        if (arr[i][j] > largestNumber) {
          largestNumber = arr[i][j];
        } 
      }
  
      newArr.push(largestNumber);
    }
    return newArr;
}
  
largestOfFour([[4, 5, 1, 3], [13, 27, 18, 26], [32, 35, 37, 39], [1000, 1001, 857, 1]]);

//newArr = [5,27,39,1001]

Day 49: March 23, Saturday.

I used #HTML and #CSS to draw Captain Marvel ๐Ÿฆธโ€โ™€๏ธ ๐Ÿ’ซ

Check it here ๐Ÿ˜€โฌ‡๏ธ

Link(s) to work:

Day 50: March 24, Sunday.

I was working in a double slider sign-in and sign-up form challenge #weeklyCodingChallenge by @florinpop1705

Link(s) to resources:

Link(s) to work:

Day 51: April 2, Tuesday.

Being in the middle of my way to achieve #100DaysOfCode :

๐Ÿšฉ I took a week to rest ๐Ÿคช

๐Ÿšฉ I got my first job as a Junior Frontend Developer ๐Ÿฅณ๐Ÿ˜Š

๐Ÿšฉ I did a happy unicorn using HTML/CSS ๐Ÿฆ„

Link(s) to work:

Day 52: April 3, Wednesday.

Planning to start learning Frontend frameworks ๐Ÿ‘ฉโ€๐ŸŽจ๐Ÿ–ผ๏ธ๐Ÿ–Œ๏ธ

I was reading about Bootstrap and Vue.js ๐Ÿค“

Link(s) to resources:

Day 53: April 7, Sunday.

Today I started Vue.js workshop from @VueVixens community ๐ŸฆŠ

๐Ÿค“ I did Chapter 1 and I am so excited I want to learn more ๐Ÿฅฐ

Link(s) to resources:

Link(s) to work:

Day 54: April 8, Monday.

๐Ÿ”–Chapter 2:

Learned how to create a data file (JSON object) ๐Ÿคฏ and used it to show information on the website ๐Ÿฅต Still trying to understand it... maybe tomorrow I will need to go in it again๐Ÿ˜…

Link(s) to work:

Day 55: April 10, Wednesday.

๐Ÿ”–Chapter 3 #VueVixens workshop:

Learned about: axios library, how to call API, some function to iterate arrays ๐Ÿคฉ

๐Ÿง™โ€โ™€๏ธI did my App more interactive, now is it getting random images from the internet ๐Ÿฅณ

Link(s) to work:

Day 56: April 11, Thursday.

Today I worked in a face design ๐Ÿง” I made it using HTML/CSS ๐Ÿฅฐ

Link(s) to work:

Day 57: May 2, Thursday.

๐Ÿ˜Ž I was working in a dark mode page ๐Ÿ˜Š

I got inspiration from Dev.to

Link(s) to resources:

Link(s) to work:

Day 58: September 2, Monday.

It's been a while since my last update but here we are ๐Ÿ™ˆ

๐Ÿ† My goal: Learn JavaScript

I started doing some #katas, not to bad with the easy ones ๐Ÿคช@codewars #javascript #WomenWhoCode #womenintech #CodeNewbie

Link(s) to resources:

Day 59: September 3, Tuesday.

Starting from basic concepts: variables, operator, data types... JavaScript comes to me! ๐Ÿ™†โ€โ™€๏ธ๐Ÿฅฐ #javascript #WomenWhoCode #womenintech #CodeNewbie

Link(s) to resources:

Day 60: September 4, Wednesday.

The challenge continue, today I did some katas.๐Ÿš€ #javascript #WomenWhoCode #womenintech #CodeNewbie

Link(s) to resources:

Day 61: September 5, Thursday.

#javascript #WomenWhoCode #womenintech #CodeNewbie

๐ŸงI was looking for some good explanation about forEach, map, filter, reduce and sort. And yeah๐Ÿคฏ I found this super nice video๐Ÿ“บ "JavaScript Higher Order Functions & Arrays"

Link(s) to resources:

Here some examples

const companies= [
  {name: "Company One", category: "Finance", start: 1981, end: 2004},
  {name: "Company Two", category: "Retail", start: 1992, end: 2008},
  {name: "Company Three", category: "Auto", start: 1999, end: 2007},
  {name: "Company Four", category: "Retail", start: 1989, end: 2010},
  {name: "Company Five", category: "Technology", start: 2009, end: 2014},
  {name: "Company Six", category: "Finance", start: 1987, end: 2010},
  {name: "Company Seven", category: "Auto", start: 1986, end: 1996},
  {name: "Company Eight", category: "Technology", start: 2011, end: 2016},
  {name: "Company Nine", category: "Retail", start: 1981, end: 1989}
];

const ages = [33, 12, 20, 16, 5, 54, 21, 44, 61, 13, 15, 45, 25, 64, 32];

forEach

//show all companies names

//way 1
for(let i = 0; i < companies.length; i++) {
   console.log(companies[i]);
}

//way 2
companies.forEach(function(company) {
   console.log(company.name);
});

filter

// Get 21 and older

//way 1
let canDrink = [];
for(let i = 0; i < ages.length; i++) {
   if(ages[i] >= 21) {
     canDrink.push(ages[i]);
   }
}

//way 2
const canDrink = ages.filter(function(age) {
   if(age >= 21) {
     return true;
   }
});

//way 3
const canDrink = ages.filter(age => age >= 21);

// Filter retail companies

//way 1
 const retailCompanies = companies.filter(function(company) {
   if(company.category === 'Retail') {
     return true;
  }
});

//way 2
const retailCompanies = companies.filter(company => company.category === 'Retail');

// Get 80s companies

const eightiesCompanies = companies.filter(company => (company.start >= 1980 && company.start < 1990));

// Get companies that lasted 10 years or more

const lastedTenYears = companies.filter(company => (company.end - company.start >= 10));

map

// Create array of company names

//way 1
const companyNames = companies.map(function(company) {
  return company.name;
});

//way 2
const testMap = companies.map(function(company) {
   return `${company.name} [${company.start} - ${company.end}]`;
});

//way 3
const testMap = companies.map(company => `${company.name} [${company.start} - ${company.end}]`);

//Double map, square the age and then ^2
const ageMap = ages
   .map(age => Math.sqrt(age))
   .map(age => age * 2);

Sort

// Sort companies by start year

//way 1
const sortedCompanies  = companies.sort(function(c1, c2) {
   if(c1.start > c2.start) {
     return 1;
  } else {
    return -1;
   }
});

//way 2
const sortedCompanies = companies.sort((a, b) => (a.start > b.start ? 1 : -1));

// Sort ages
const sortAges = ages.sort((a, b) => a - b);

console.log(sortAges);

reduce

//Sum the ages

//way 1
let ageSum = 0;
for(let i = 0; i < ages.length; i++) {
  ageSum += ages[i];
}

//way 2
const ageSum = ages.reduce(function(total, age) {
  return total + age;
}, 0);

//way 3
const ageSum = ages.reduce((total, age) => total + age, 0);

// Get total years for all companies

//way 1
const totalYears = companies.reduce(function(total, company) {
   return total + (company.end - company.start);
}, 0);

//way 2
const totalYears = companies.reduce((total, company) => total + (company.end - company.start), 0);

Combine Methods

const combined = ages
  .map(age => age * 2)
  .filter(age => age >= 40)
  .sort((a, b) => a - b)
  .reduce((a, b) => a + b, 0);

console.log(combined);

Day 62: September 9, Monday.

๐Ÿ‘ฉโ€๐Ÿ”งPractice and practice... I made a function to reverse the words in a sentence๐Ÿคฉ reverseWords("i love code") // should return "code love i" #javascript #WomenWhoCode #womenintech #CodeNewbie

Here the code:

function reverseWords(str){
const newArr = str.split(" ")
  return newArr.reverse().join(" ")
}

function reverseWords(str){
  return str.split(" ").reverse().join(" ")
}

const reverseWords = str => str.split(" ").reverse().join(" ")

Day 63: September 10, Tuesday.

๐Ÿ“– Read some articles ๐Ÿ‘ฉโ€๐Ÿ”ง Practiced on Freecodecamp ๐Ÿคช Cleaned my Download folder (I was keeping so much trash ๐Ÿ—‘๏ธ) #javascript #WomenWhoCode #womenintech #CodeNewbie

Day 64: September 12, Thurday.

Today I was no feeling me good, I am getting sick ๐Ÿคง So, I read an great article. Is time to start to build things! ๐Ÿ‘ฉโ€๐Ÿ’ป https://www.freecodecamp.org/news/how-to-go-from-coding-tutorials-to-building-your-own-projects-b9ab51074980/amp/?__twitter_impression=true #WomenWhoCode #codeNewbie

Day 65: September 22, Sunday.

I was learning some basic #VueJS

Check out this awesome @scrimba tutorial I just watched: https://scrimba.com/p/pZ45Hz/crVeyTd

#WomenWhoCode #womenintech #CodeNewbie

Here my pick color result โฌ‡๏ธ

https://github.com/gmoraleslondono/emojifying

Day 66: September 23, Monday.

I spend some time learning #VueJS from the official documentation ๐Ÿ˜บ https://vuejs.org/v2/guide/#What-is-Vue-js

And I started to build a basic todo list application ๐Ÿ“๐Ÿ‘

#WomenWhoCode #womenintech #CodeNewbie

Day 67: September 24, Tuesday.

Today I was working on my own website ๐Ÿ‘ฉโ€๐Ÿญ

๐Ÿ’… I add some color
๐Ÿš€ Set some CSS animation
๐Ÿ”ข I did it responsive

I am so happy with it ๐Ÿ˜ป๐Ÿ‘

Check it here โฌ‡๏ธ https://gmoraleslondono.github.io/portfolio/index.html

#WomenWhoCode #womenintech #CodeNewbie

Day 68: September 26, Wednesday.

๐Ÿ“๐Ÿ˜ŠI started to build a Todo List App following vueschool tutorial

#WomenWhoCode #womenintech #CodeNewbie

Day 69: September 25, Thursday.

๐Ÿ‘‹Still Working in a Todo List App.
Frontend almost is done ๐Ÿคฉ tomorrow I need work in functionalities ๐Ÿ› ๏ธ

Tutorial: https://vueschool.io/courses/vuejs-fundamentals

#WomenWhoCode #womenintech #CodeNewbie

Day 70: October 1, Tursday.

Added validation to the required fields on an old project ๐Ÿ˜บ
Also, I did some #codeWars katas to practice #javascript ๐Ÿ’ช๐Ÿง 

#WomenWhoCode #womenintech #CodeNewbie

Day 71: October 10, Thursday.

Still working in a #vue todo list app๐Ÿค 
Today I learned to save data using the LocalStorage ๐Ÿฅณ

Link(s) to resources:

Day 72: October 23, Wednesday.

๐Ÿ‘ฉโ€๐Ÿ”งStarted a new project following "Vue & Firebase Real-time Chat" ๐Ÿ’ฌtutorial by The Net Ninja https://youtu.be/nWBtU2QNhxk

Today all was about setting the project and firebase ๐Ÿ‘

#WomenWhoCode #womenintech #CodeNewbie

------------------------>

Credits

The Official Website for the Challenge www.100daysofcode.com

Made with โค by Gloria Morales

About

Daily log

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published