I’ve decided that I want to dye my hair, and I’m planning to do it in the summer before the cruise. I’m thinking about going for a dark, blackish-red color. It’s a bit difficult to describe, but I definitely want it to be dark. I’m not sure if I’ll get a haircut before coloring my…
Hello, Thursday
The Fibonacci function has me perplexed. There are so many examples available online that I’m unsure whether I should simply follow those or attempt to code it from scratch and see if that yields results. I realize my thoughts may seem a bit unclear at the moment; that’s just how my mind is working today….
Hello, Thursday
The Fibonacci function has me perplexed. There are so many examples available online that I’m unsure whether I should simply follow those or attempt to code it from scratch and see if that yields results. I realize my thoughts may seem a bit unclear at the moment; that’s just how my mind is working today….
Hoping for rain
I have spent my morning figuring out how to write a function that returns an array containing the first ‘n’ Fibonacci numbers. I found out what I need to do: Initialize an empty array. If n is 1, return [0] (since the first Fibonacci number is 0). If n is 2, return [0, 1]. Otherwise,…
Another coding day
I’ve just had my second cup of coffee. I’m trying to figure out how to write a function that checks if a word is a palindrome. This is what I have so far: function isPalindrome(str) { // Convert string to lowercase and remove non-alphanumeric characters let cleanStr = str.toLowerCase().replace(/[^a-z0-9]/g, “”); } In the context of…
Not-so-manic Monday
You might expect that I’d have more to write about on a Monday since I take breaks from writing over the weekend, but surprisingly, I don’t have much. Karissa’s glasses just broke; the arm snapped right off. They’re only two years old. I suggested she schedule an eye appointment to see if she needs a…
Friday eve
I’m currently working on a JavaScript function to duplicate values from an array and return a new array. Tommy provided me with some useful advice, so I hope to gain a better understanding of this. After some research, I discovered that JavaScript has a `Set()` method designed specifically to remove duplicate values from an array….
Coding day
I shouldn’t have a book on my desk during the day when I should be focused on coding, as I often find myself distracted by reading. To avoid this temptation, I’ve decided to keep my book in the bedroom. I’m nearly finished with “Race Across Alaska.” Recently, I attempted to place a book on hold…
JavaScript and Belfast
Today I learned a few new things in coding. First, how to find the second largest number in an array: function secondLargest(arr) { if (arr.length < 2) return null; let largest = -Infinity, second = -Infinity; for (let num of arr) { if (num > largest) { …
A quiet Monday
Happy Monday! This morning, I’m feeling a bit uncertain about what to write. I’ve already had breakfast, taken a shower, and organized the pill boxes for both Tommy and myself. Last weekend was quite laid-back; Tommy wasn’t feeling his best due to his ear infection, so we opted to stay home and enjoy some time…