Day2 Homework completed.
Thank you for lessons.
I was able to finish the homework without problem, but one thing is bothering me.
I thought that variable declared as const cannot be changed.
However, while I was doing “Modify Array Data With Indexes”, I figured I could modify values of an array declared as const.
Reading through [Var, Let, and Const – What’s the Difference? (freecodecamp.org)], I was confirmed that I could do that.
So, my understanding is that const cannot be overwritten, but can be modified (not by overwriting).
Am I understanding correctly?
Great question! We also explored this In yesterday’s lesson.
You are correct. By modifying members of the array, we’re not reassigning the variable, which is constant. Arrays are mutable.
Hey!
So if you console.log(myArray.pop());
you’ll see that it returns that popped value.
What the exercise wants you to do is assign that popped value to the variable. You’re writing out the value manually.
Hope that makes sense!
Yes, the Tests passed Thanks Ramón for your quick reply.
You’re welcome! It’s my pleasure
I am stuck with this question, Help!
Catching up fast over here, working on this after work, missed days 1, 2 and 3 but I should be up to date with the homework for Day III by tomorrow eve.
Here’s day 2 homework.
Hello Everyone!
Hope everyone doing well today! I am still struggling with the Day 2 homework. I had a question when I practiced Access Array Data with Indexes. Can I get a character or number of the entry from an array? Can anyone figure out why the result of console.log(myNumber) was undefined in the pic? Thank you for your help!
Getting caught up today after a day road trip with my girlfriend
Caught up with my D2 homework, the shopping list gave me something to think about. Turned out I used nested arrays instead of sub-arrays… oops!
You’re trying to access myData2.length. But myData2 is not an array, it’s a number! Numbers don’t have length.
Day 2 Homework Done!
I’m getting caught up!
Thank you for your reply. It was really helpful. I am curious that if I want to extract one single number from an array which is a group of numbers, what should I do? Let’s say I want to get the "8 " from “23847” and show it on the output. Is there any way I can make it?