Day 13 of my coding journey.
Part of today's lesson was understanding the "this" keyword in JavaScript.
I learned that when "this" is used inside an object method, it refers to the object that the method belongs to.
For example:
const person = {
firstName: "John",
lastName: "Doe",
age: 50,
fullName: function() {
return this.firstName + " " + this.lastName;
}
};
* this.firstName - accesses the firstName property of person.
* this.lastName - accesses the lastName property of person.
One thing that clicked for me today: "this" allows a method to work with the properties of the object that calls it.
Day 13 complete.
Still learning. Still building.
Synchronous & Asynchronous JavaScript.
Synchronous JavaScript executes code one statement at a time, in order. Each task generally has to finish before the next one runs.
Asynchronous JavaScript helps handle tasks that may take time, like fetching data from a database or an API, without blocking the rest of the program.
So instead of waiting around for a slow task to finish, JavaScript can continue with other work and handle the result when it’s ready.
Day 12 of my coding journey.
I’m going back through documentation, revisiting concepts, and making sure I actually understand what I’m learning rather than just moving through the lessons.
It might not look like much from the outside, but progress is definitely happening.
Slowly building the foundation.
One concept at a time.
Day 12 complete.
Day 11 of my coding journey.
Today wasn't about learning something completely new.
I went back through my notes from the week and revisited some of the concepts I learned.
There were a few things I didn't fully understand the first time around, so I went through the official documentation to get a clearer picture.
Day 11 complete.
Still learning. Still building.
Day 10 of my coding journey.
Today I learned about the DOM - Document Object Model.
I learned that when a browser loads an HTML document, it creates a DOM that represents the page as a tree of objects, allowing JavaScript to interact with and change the webpage.
I explored different ways to select HTML elements:
"querySelector()"
"querySelectorAll()"
"getElementById()"
"getElementsByClassName()"
"getElementsByTagName()"
I also learned how to change content using:
"innerText" - works with the text content.
"innerHTML" - can read or replace HTML content.
Then I learned how JavaScript can get and change attributes, modify styles, and add or remove CSS classes.
This is where JavaScript started feeling much more interactive to me, not just writing code, but actually using it to manipulate a webpage.
Day 10 complete.
Still learning. Still building.
Day 9 of my coding journey.
Today I learned about objects in JavaScript and how they’re created and accessed.
I started with object literal notation, where an object is created using curly braces "{}":
let user = {
name: 'crystal',
age: 50,
email: '[email protected]',
location: 'Berlin',
blogs: [
'Why Mac & cheese rules',
'The strongest superhero is who?'
]
};
I learned that I can access the whole object:
console.log(user);
Or target a specific property:
console.log(https://t.co/NSX8byPUOx);
console.log(user['name']);
I also learned how to update object properties:
user.age = 35;
Objects can also contain methods, which are functions stored as properties of an object.
The class ended with primitive vs reference types, and how JavaScript manages data in memory using concepts like the stack and heap.
Finally, I explored the Math object and some of its useful methods:
const area = 7.7;
console.log(Math.round(area));
console.log(Math.trunc(area));
console.log(Math.ceil(area));
console.log(Math.floor(area));
Another class, another layer of JavaScript starting to make sense.
Day 9 complete.
Still learning. Still building.
Day 8 of my coding journey.
Today I learned about functions and methods in JavaScript.
I learned that functions let us define a block of code and reuse it whenever we need it.
Function Declaration
function greet() {
console.log('hello');
}
Calling the function:
greet();
I also learned about Function Expressions, a function stored inside a variable:
const speak = function() {
console.log('good day');
};
Then came hoisting. Basically, JavaScript processes certain declarations before executing the code, which means a function declaration can be called before it appears in the code.
I also learned about parameters and arguments:
Parameters are the variables defined in the function, while arguments are the actual values passed to the function.
And then there’s the "return" keyword, which allows a function to send a value back to where it was called.
Finally, I got introduced to arrow functions, which provide a shorter way to write functions:
const calcArea = radius => 3.14 * radius ** 2;
const area = calcArea(5);
console.log(area);
Here, "radius" is the parameter, "5" is the argument, and the calculated result is stored in "area".
Still not done with today's class, I need to understand callbacks and "forEach()".
One step at a time.
Day 8 continues tomorrow.
Day 7 of my coding journey.
Today I learned about loops and conditionals in JavaScript.
I started with "for" loops, which have three main parts: initialization, condition, and increment/update.
for (let i = 0; i < 5; i++) {
console.log('in loop:', i);
}
This runs from 0 to 4 because the loop stops when "i" is no longer less than "5". The "i++" increases "i" by 1 each time.
Then I learned "while" loops. They work similarly, but the syntax is different:
let i = 0;
while (i < 5) {
console.log('in loop:', i);
i++;
}
This also runs from 0 to 4.
I also learned about "do...while" loops, which will execute the code at least once before checking the condition.
Then came conditionals:
• "if" - runs code when a condition is true
• "else if" - checks another condition
• "else" - runs when the previous conditions are false
• "&&" - AND
• "||" - OR
• "!" - NOT
I also got introduced to switch statements and variable/block scope.
Lots of new concepts today, but I'm slowly starting to understand how JavaScript makes decisions and repeats tasks.
Day 7 complete.
No bugs today😁.
Day 6 of my coding journey
Today was a big one, I started my first JavaScript class.
I learned how JavaScript is used for both frontend and backend development, especially with tools like Node.js.
I also learned about:
• Variables: used to store values
• Constants: used for values that shouldn't be reassigned
• Data types: strings, numbers, booleans, null, undefined, objects, and symbols
• Arrays: used to store multiple values in one place
A few basics that clicked today:
"Hello" - String
25- Number
true / false -Boolean
[1, 2, 3]- Array
New language, new concepts, but I'm enjoying the process so far.
Day 6 complete.
No bugs today.
Back to it tomorrow.