I’m sitting at Starbucks in the city near Tommy’s work. I have an ENT(Ear, Nose, Throat) appointment today. I have my ears checked every six months. Well, I try but sometimes I have had to reschedule. The doctor wants to make sure the ears are still good and I don’t need surgery. He doesn’t want to do surgery on my good ear, so I need to have it checked often.
Starbucks really pushes the Fall season. Of course, it is still summer and the weather agrees with that. I’m excited that Fall is around the corner. But I feel that businesses are marketing on Fall earlier and earlier each year. I did get a London Fog, which is Earl Grey tea with milk. I have it with almond milk because I’m lactose intolerant. I’m not hungry, so I haven’t eaten yet.
Usually I find doing any sort of work or studying a little hard to do in Starbucks. My ADHD medication is helping me focus better. I’m not too distracted by all the customers walking into the store. Given, this Starbucks isn’t that busy but I’m happy that I’m doing better with focusing on my work. I did have anxiety at first when I came here. I kept looking around to make sure that I’m safe but I’m the only customer sitting here. Everyone else just gets their coffee and leaves. I don’t know if I will get over that feeling of dread when I’m alone in public. I hope one day I won’t feel that. I’m feeling a bit better now.
A few hours later…
Done with my appointment. The doctor took out two wax traps from my left ear. Wax traps are from my hearing aid. They are like very tiny cups that prevent wax from getting into my hearing aid. I thought they had just fallen out of the hearing aid, but never thought they fell out into my ear. I was given medicine for my right ear. It’s ok, only burns a little but isn’t that noticeable.
I’m now in the hospital cafeteria, using their wi-fi. I had some yogurt with granola, which is one of my favorite ways to eat yogurt. But this was a bit disappointing since the granola wasn’t crunchy.
I’m waiting for Tommy to come pick me up. My car isn’t working right now. Just needs a little spark plug. And of course I don’t care to drive long distances. This hospital is so far out here. There is nothing around but desert. I should get back to some coding. Which I’m having trouble with today. I need to check if a string (first argument, str) ends with the given target string (second argument, target). And we can’t use the .endwith() method. Yeah…
JavaScript notes…
——————————
The formula to convert from Celsius to Fahrenheit is the temperature in Celsius times 9/5, plus 32.
Reverse the provided string and return the reversed string.
function reverseString(str) { return str.split('').reverse().join(''); } reverseString("hello");
Return the factorial of the provided integer.
If the integer is represented with the letter n, a factorial is the product of all positive integers less than or equal to n.
Factorials are often represented with the shorthand notation n!
For example: 5! = 1 * 2 * 3 * 4 * 5 = 120
function factorialize(num) { return num < 1 ? 1 : num * factorialize(num - 1); } factorialize(5);
Return the length of the longest word in the provided sentence.
function findLongestWordLength(str) { return str.split(' ').sort((a, b) => b.length - a.length)[0].length; } findLongestWordLength("The quick brown fox jumped over the lazy dog");
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].
function largestOfFour(arr) { return arr.map(subArr => Math.max.apply(null, subArr)); } largestOfFour([[4, 5, 1, 3], [13, 27, 18, 26], [32, 35, 37, 39], [1000, 1001, 857, 1]]);
Check if a string (first argument, str) ends with the given target string (second argument, target).
This challenge can be solved with the .endsWith() method, which was introduced in ES2015. But for the purpose of this challenge, we would like you to use one of the JavaScript substring methods instead.
function confirmEnding(str, target) { return str.substring(str.length - target.length) === target; } confirmEnding("Bastian", "n");