Second For Loop character push without definition or declaration


#1

not sure what had it show me the w


#2

I'm not 100% but I believe it's because your text gives two variations of your name - both Trinity and Trin. And because your text [i] refers to T as opposed to myName[0], the code will pull both "Trinity" and "Trin ,w" which both satisfy the same character count.


#3

thank you i posted it today and got it correct three days ago did not know how to post and got caught up and moved on it was in the way when i went to look through qa so hit create''' and it posted
APPRECIATE THE SPEEDY AND CLEAR response


#4

where are you in school or did you complete one of the coding boot camps already or something else ?


#5

Haha, nope. I actually just started this yesterday and happen to be on the same module for Search Text for Your Name :slightly_smiling: I find helping others helps me learn too @wtrinity


#6

never coded before ? are you gonna do a boot camp


#7

I self taught HTML, CSS and parts of PHP over a decade ago. But yes, I'm planning on doing a bootcamp but most require some level of coding before interviewing and applying. What about yourself @wtrinity


#8

cool which one do rate the highest in nyc, and thanks again for the assist


#9

I actually have no idea. I'm not based in the US unfortunately though I'd like to go to Hack Reactor in SF. I've heard good things about Full Stack in NYC? But besides that I have no clue. Let me know which one you end up going for, there's a chance I'll come to NYC too. I just have to figure out how visas work :\ When are you thinking of starting? @wtrinity


#10

YO!!!! you hit it on the nose I'm heading to fullstack at the end of feb currently on


#11

met with shana at full stack she worked at hack reactor


#12

just semi nailed this but unsure still


#13

Hey I'm having trouble with this code. It just is not working.

/*jshint multistr:true */
var myName = "Celeste";
var hits = [] ;
var text = "hello";
for (var i = 0; i < 1; i = i + 1) {
console.log(text.length);
if (text[i] === "C") {
for (j-i; j hits.push(text[j]);
}
}
}

The error says
Oops, try again. It looks like your second 'for' loop isn't pushing values to the hits array. Make sure it's working properly and that myName's text appears somewhere in the text variable.


#14

Your second for loop should look like this
for(j=i; j<=i+myName.length; j++)
{
hits.push[text[j]];
}

btw your if statement won't work because your text string doesn't have any 'C'


#15

What do u mean about the if statement.


#16

I'm thinking about going to FullStack as well. Are you doing the immersive?


#17

yes doing work on coderbyte and trying to get my mind prepared to follow the coder logic without so much and holding