I didn’t write yesterday because I didn’t have much time. I had my journal ready, but I felt it would be rude to type while visiting a friend’s house. We spent some time planning for our upcoming cruise, though we hit a snag when searching for a tour to Versailles. We’re still looking at options, but Tommy found one this morning that might work.
Yesterday, we went out to lunch at an Asian restaurant, and it was quite good. The waiter cautioned me about the spiciness of the Signature Bowl, which made me a bit apprehensive. However, I decided to go for it, and it turned out to be fine. It had a slight kick but was not as spicy as I anticipated. I ordered the Signature Bowl and a drink, and I enjoyed the leftovers for lunch today.
Afterward, we went to the pool and hot tub. I didn’t swim since I’m not supposed to get water in my ears, so I relaxed in the pool and then sat in the hot tub. The wind picked up, and I started to feel cold, so I decided to get out and get dressed. Shortly afterward, Kel and I left and made a stop at the store before heading home.
We transitioned Lexi to our phone plan with T-Mobile, and she finally received her phone. Although it was delivered on the 9th, it took a few days for her to get it because the school post office held it due to it being under a different name. It seems it may have been listed under Tommy’s name, despite him having provided Alexis’s name. Lexi had to supply proof of delivery, which we were able to provide her with. Now that her number has been ported, she just needs to set up the new phone. Additionally, she should consider purchasing Apple Care, given her history with phones; her current device has had a crack for quite some time.
I received an email indicating that my book is due back at the library on the 13th. Currently, I am only 42% into “Funny Story.” However, I believe I can finish it by the deadline. My Kindle estimates I have around 4 hours and 19 minutes left of reading. While I can’t dedicate a full 4 hours to reading at once, I should be able to make significant progress over the next few days. It’s an engaging read—though it’s a romance, it’s both cute and humorous.
On another note, I’ve been researching how to implement a custom bind() function in coding. My reading has been somewhat interrupted by a few distractions. I called the college to inquire about details related to Karissa’s graduation, specifically to confirm the meeting place for graduates, ensuring a smooth experience in May. I managed to get the information I needed. Additionally, I’ve been texting Alexis about her new phone; she purchased the Apple Care for it. Lastly, I’ve been going back and forth talking to Tommy and Alex about Alex being added to T-Mobile.
The `bind()` function is used to create a new function with the `this` keyword set to a specified value. In JavaScript, the `this` keyword refers to the object currently executing the code, and its value is determined by how the function is invoked. Essentially, we are aiming to imitate the behavior of JavaScript’s built-in `Function.prototype.bind()` method.
- Has a fixed this value (the context).
- Optionally pre-fills arguments (also called partial application).
- Accepts more arguments later when the bound function is called.
I understand what needs to be accomplished, but I’m unsure how to proceed with the implementation. I feel a bit stuck. I don’t think we can start with our typical setup:
function myBind() { // Code here }
Maybe it would look more like this:
Function.prototype.myBind = function (context, ...args) { // Code here }
We would begin the the function this way because we are calling the bind() method on a specific function. So, to recreate that behavior, the myBind() method needs to be available on every function — like sayHello.myBind(…).
We do this by attaching it to Function.prototype, which makes it available to all functions.
Imagine you want every dog in your program to have a bark() method. You wouldn’t write:
function bark() { ... }
You’d do:
Dog.prototype.bark = function() { ... }
So any dog like Fido can do fido.bark().
In the same way, we want every function to be able to use .myBind(), so we add it to Function.prototype. We use Function.prototype.myBind = function because we want to add a method to all functions, so that you can do:
someFunc.myBind(context);
Now to just figure out what code goes into that function. I will have to research this more.





