An Introduction to Reverse Channeling

Reverse channeling is when a channeler becomes the transmitter, they act as a beacon to send information to otherworldly beings and as a collective consciousness of humans.

Smartphone

独家优惠奖金 100% 高达 1 BTC + 180 免费旋转




Fundamental JavaScript Looping

Clarifying the stopping point of your loop

We use loops all of the time in many different coding languages. Using a loop helps us accomplish a task that requires repetition. One fundamental idea that I haven’t thought about (and now I will blog about) is appropriately setting your ending point for your loop.

We have all seen a loop like this. We have an array that we are iterating over.

I wanted to call out the undefined. That’s what this blog post is all about after all. When writing my end point, sometimes I go back and forth between is it less than or less than and equal to the arr.length. Yes, this is a basic idea, and if you already sleep, breath and eat this information, thanks for reading to this point. But if you haven’t, I wanted to explicitly prove to myself why I’m getting undefined. Array’s are zero based, meaning the first (to the viewer) element is the 0th position. Meaning the second element is the 1st position and so on. This is important because in our loop, the output runs through each element, printing it on the screen, then before printing the length, we get a printed ‘undefined.’

Here is my understanding of why this is happening. In our array we have 0(pizza),1(pickle),2(interview) and 3(bagel) elements in our array. The length is effectively 4. When we talk about length, .length is a property of an array. Not being zero based, the length counts 4 in total (pizza, pickle, interview and bagel) and STARTS IT’S COUNT AT ONE. With this difference between .length and how array’s are zero based, the undefined we see in the console is our loop, trying to console the 4th element but because it doesn’t exist, it throws an undefined.

I know that this is a fundamental topic. I wanted to write about it so I could properly think about it more. Moving forward, when I build a loop and when I’m thinking about the end point, I need to ask myself, “ are we stoping a the end of the array, starting at 0 and going to the last value (length — 1 position) or do we for some reason need to include another iteration with ≥ or ≤? Thinking about this will help me find the correct end point without having to console.

Add a comment

Related posts:

4 Simple Activities That Can Strengthen Your Relationship

4 simple activities that can strengthen your relationship include budgeting, exercising, watching TV, and cooking.

Europe Vision Care Market Demand and Analysis 2020 to 2027

A report added on the Business Market Insights, titled “Europe Vision Care Market” by Company, Regions, Type and Application, forecast to covers several well-known organizations, key market players…