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) { second = largest; largest = num; } else if (num > second && num < largest) { second = num; } } return second === -Infinity ? null : second;
I learned about -Infinity, a special value in JavaScript that signifies the lowest possible number. It's commonly used as an initial value when searching for the smallest or the second-largest number in an array.
Below is a function designed to find the longest word in a sentence:
function findLongestWord(sentence) { let words = sentence.split(" "); let longestWord = ""; for (let word of words) { if (word.length > longestWord.length) { longestWord = word; } } return longestWord; }
The only issue is that this function counts a period or a question mark as a letter character, making it somewhat flawed, even though it is still considered correct.
Today has been mainly coding. I called the pharmacy to inform them that I can pick up my medication this week. It has been ready since Friday, and I wanted to ensure they wouldn’t put it back and force me to refill it. Later, I plan to visit the store to pick up a few items for Tommy’s lunches.
The next port of call on our cruise will be Belfast, Northern Ireland. Belfast serves as the capital and largest city of Northern Ireland, situated on the eastern coast along the River Lagan. The city boasts a rich history, notably as the birthplace of the Titanic during its illustrious shipbuilding era, and it played a significant role during the Troubles, a period of conflict in the late 20th century. Today, Belfast has transformed into a vibrant, modern city celebrated for its culture, historical significance, and burgeoning tourism industry.
Key Highlights of Belfast:
🔹 Titanic Belfast – A world-famous museum dedicated to the Titanic’s construction and history.
🔹 Belfast City Hall – A stunning Edwardian building in the heart of the city.
🔹 Peace Walls & Murals – Reminders of the city's divided past, now symbols of resilience and change.
🔹 St. George’s Market – One of the best food and craft markets in the UK and Ireland.
🔹 Crumlin Road Gaol – A historic 19th-century prison offering fascinating tours.
🔹 Belfast Castle & Cave Hill – Offering breathtaking views over the city.
I wonder how I'm going to remember all this stuff when I'm at these locations? I can't wait to write about these places when I'm on the cruise. Since Kel should be on her way home soon and we will be going to the store, I will post this now.





