Day 10: Merge Sort Begins

Things are getting spicy. As I’m making progress with the data structures and algorithms I’m fighting my demons LOL. I’m only dabbling but each time I dip my foot in the water I get braver and braver. Maybe one day I’ll be not just swimming but living in the deep end LOL.

TLDR;

Okay, so here are the highlights of what I did:

  • Data structures -> Continued going through another freeCodeCamp YouTube video covering data structures and algorithms for beginners. I started going through the section on Merge Sort. I think if I diagram this algorithm out I might get more comfortable with everything.
  • JavaScript -> Went through some more of the basics of JavaScript. I covered an MDN article on symbols. I still don’t know what is going on with that. I’m going to go try some YouTube videos next LOL. But tomorrow is back to Babel again.
  • Practice -> Continued going through “The Odin Project” curriculum. Continued going through their JavaScript material. A lot of the reference articles and videos have been pretty interesting. I am loving this tbh. The revision is welcome!

JavaScript Primitive Data Types Notes

A primitive data type is a data type that have values that only contain a single thing (be it a string or a number or whatever). In contrast, objects are used to store collections of data and more complex entities.

All primitives are immutable, i.e., they cannot be altered. It is important not to confuse a primitive itself with a variable assigned a primitive value. The variable may be reassigned a new value, but the existing value can not be changed in the ways that objects, arrays, and functions can be altered.

This example will help you understand that primitive values are immutable. A primitive can be replaced, but it can’t be directly altered.

// Using a string method doesn't mutate the string
var bar = "baz";
console.log(bar);               // baz
bar.toUpperCase();
console.log(bar);               // baz

// Using an array method mutates the array
var foo = [];
console.log(foo);               // []
foo.push("plugh");
console.log(foo);               // ["plugh"]

// Assignment gives the primitive a new (not a mutated) value
bar = bar.toUpperCase();       // BAZ

Except for null and undefined, all primitive values have object equivalents that wrap around the primitive values:

  • String for the string primitive.
  • Number for the number primitive.
  • BigInt for the bigint primitive.
  • Boolean for the boolean primitive.
  • Symbol for the symbol primitive.

The wrapper’s valueOf() method returns the primitive value.

References


Goal For Round 7 of the #100DaysofCode Challenge

This is my seventh round of the “#100daysofcode” challenge. I will be continuing my work from round five and round six into round seven. I am currently working through the book “Cracking the Coding Interview” by Gayle Laakmann McDowell. My goal is to become more familiar with algorithms and data structures. This goal was derived from my goal to better understand operating systems and key programs that I use in the terminal regularly e.g. Git. This goal was in turn derived from my desire to better understand the fundamental tools used for coding outside of popular GUIs. This in turn was derived from my desire to be a better back-end developer.

I have no idea if my path is correct but I am walking down this road anyways. Worst case scenario I learn a whole bunch of stuff that will help me out on my own personal projects.