What a day! Hopefully my car got looked at today. The collision center called yesterday. They called Kelly and not me. Kind of confused about that but that’s fine. They called. So a few days ago a truck hit a telephone pole off of I40 and the power has been cut so the collision center has been without power and internet for the last few days. They said they should be able to look at my car today or tomorrow.
Karissa was to have a phone counseling appointment today with her college yet the counselor never called us at the appointment time. So Karissa called them and mentioned that she had an appointment. They couldn’t locate the counselor so I hope everything is ok. She had to reschedule the appointment for tomorrow morning. Karissa wants me there in the appointment to help her and to help her hear what the counselor is saying. Cause she is deaf. We need to get her hearing aid cleaned because she is only hearing at 20% right now. So tomorrow, I hope, will go as planned with the appointment. Karissa was proud of herself that she made the call to the college on her own without my help. I’m proud of her too. She can easily talk to people. I have trouble just making a phone call.
I just finished my exercise and yoga. Yoga today was focused on the hips and lower back. It felt really nice since I have trouble with those areas when I’m standing for a long period of time. It’s getting better. Especially with the weight training I’ve been doing. I do feel stronger. And I’ve lost almost ten pounds since I’ve started this journey.
Oh! I forgot to mail one of Lexi’s senior pictures to Ray and Leanna. I was supposed to go to the post office today. /sigh. Maybe tomorrow I can do that.
JavaScript has been tough to focus on these past few days. And the problems are pretty hard. I’m having fun but I need so much help to do these problems. In my notes I didn’t finish the last one. I decided to go exercise and now I’m going to relax before starting dinner.
JavaScript notes…
————————————
You will be provided with an initial array as the first argument to the destroyer function, followed by one or more arguments. Remove all elements from the initial array that are of the same value as these arguments.
The function must accept an indeterminate number of arguments, also known as a variadic function. You can access the additional arguments by adding a rest parameter to the function definition or using the arguments object.
function destroyer(arr) { return arr; } destroyer([1, 2, 3, 1, 2, 3], 2, 3);
function destroyer(arr) { const valsToRemove = Array.from(arguments).slice(1); return arr.filter(function(val) { return !valsToRemove.includes(val); }); } destroyer([1, 2, 3, 1, 2, 3], 2, 3);
Make a function that looks through an array of objects (first argument) and returns an array of all objects that have matching name and value pairs (second argument). Each name and value pair of the source object has to be present in the object from the collection if it is to be included in the returned array.
For example, if the first argument is [{ first: “Romeo”, last: “Montague” }, { first: “Mercutio”, last: null }, { first: “Tybalt”, last: “Capulet” }], and the second argument is { last: “Capulet” }, then you must return the third object from the array (the first argument), because it contains the name and its value, that was passed on as the second argument.
function whatIsInAName(collection, source) { } whatIsInAName([{ first: "Romeo", last: "Montague" }, { first: "Mercutio", last: null }, { first: "Tybalt", last: "Capulet" }], { last: "Capulet" });
function whatIsInAName(collection, source) { const souceKeys = Object.keys(source); return collection.filter(obj => { for (let i = 0; i < sourceKeys.length; i++) { if (obj[sourceKeys[i]] !== source[sourceKeys[i]]) { return false; } } return true; }); } whatIsInAName([{ first: "Romeo", last: "Montague" }, { first: "Mercutio", last: null }, { first: "Tybalt", last: "Capulet" }], { last: "Capulet" });
Convert a string to spinal case. Spinal case is all-lowercase-words-joined-by-dashes.
function spinalCase(str) { return str; } spinalCase('This Is Spinal Tap');