Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Aug 17 09:32
    User @bjorno43 unbanned @linkin-park
  • Jun 20 21:19
    @bjorno43 banned @shenerd140
  • Apr 25 17:13
    @mstellaluna banned @cmal
  • Jan 08 22:05
    @mstellaluna banned @dertiuss323
  • Nov 07 2018 04:42
    User @texas2010 unbanned @ows-ali
  • Nov 02 2018 16:25
    @texas2010 banned @ows-ali
  • Oct 12 2018 05:50
    @bjorno43 banned @NACH74
  • Oct 05 2018 23:02
    @mstellaluna banned @JomoPipi
  • Sep 16 2018 12:21
    @bjorno43 banned @yash-kedia
  • Sep 16 2018 12:16
    @bjorno43 banned @vnikifirov
  • Sep 05 2018 08:12
    User @bjorno43 unbanned @androuino
  • Sep 05 2018 07:38
    @bjorno43 banned @androuino
  • Aug 23 2018 16:57
    User @bjorno43 unbanned @rahuldkjain
  • Aug 23 2018 16:23
    @bjorno43 banned @rahuldkjain
  • Jul 29 2018 14:13
    User @bjorno43 unbanned @jkyereh
  • Jul 29 2018 01:00
    @bjorno43 banned @jkyereh
  • Jul 10 2018 22:09
    @bjorno43 banned @manafn
  • Jul 06 2018 15:20
    @texas2010 banned @imlegend19
  • Jul 03 2018 12:28
    @bjorno43 banned @vbvmatta
  • Jun 29 2018 13:54
    @bjorno43 banned @OGTechnoBoy
John Nunns
@johnnunns
right, so then I can just put i.length
Tyler Moeller
@TylerMoeller
Correct
John Nunns
@johnnunns
now nest an if statement inside the for?
Tyler Moeller
@TylerMoeller
Yes, test if it's a vowel, if so, add 1 to sum
John Nunns
@johnnunns
still seems I'll run into the same problem as my switch
Salomon
@zarruk
Does anybody know how to put the transcurrido div justified in the center (instead of starting all the way from the center to the left)? I mean, if not with justify-content: center, then how? http://codepen.io/zarruk/pen/VPWrWL?editors=1100
John Nunns
@johnnunns
actually. let me try
Salomon
@zarruk
Also, why is my stop button on top of the start one? Does anybody know how to put the transcurrido div justified in the center (instead of starting all the way from the center to the left)? I mean, if not with justify-content: center, then how? http://codepen.io/zarruk/pen/VPWrWL?editors=1100
Tyler Moeller
@TylerMoeller
Try to get it to console.log() each letter in the string first.
brb
John Nunns
@johnnunns
like a console.log(i[0])?
Tyler Moeller
@TylerMoeller
Yes
That's just my approach though - make sure the for loop is working as intended before adding logic
John Nunns
@johnnunns
for loop is working good right now
where I'm running a blank though
I could write a lot of code right now but I'll ask before it doesn't work
an if statement like
if(i = "a") sum+1 ..... etc
Tyler Moeller
@TylerMoeller
A regular expression would be a little cleaner looking
John Nunns
@johnnunns
I'll show you what I have
function getCount(str) {
var sum=0
var i = str.split('');
for(var x=0; x<i.length; x++){
if (i === 'a' || 'e' || 'i' || 'o' || 'u'){
return sum + 1;
};
};

return sum

}
I'm sure you see what I'm trying to do, I see why it's only returning 1 because the loop is completed
I'm just not sure how to rework it
Tyler Moeller
@TylerMoeller
In your for() loop, what does i equal?
John Nunns
@johnnunns
str.split
Tyler Moeller
@TylerMoeller
Right, you want to compare against i[0], i1, i[2], etc..
Also, you will have to do if (i === 'a' || i === 'e' || etc...
John Nunns
@johnnunns
seems like an absolute ton of code :)
because I'm not using higher level function I'm presuming
but ok
Tyler Moeller
@TylerMoeller
The next problem is that return will stop the for loop - so you just want to add, not return inside the loop
Yes, and not using a regex :)
Melissa Guerrero
@Mmgfrog
Good evening. I am desperately seeking ideas as to why my Tweet This Quote button won't capture or tweet a quote from my Random Quote Machine. I have read the Twitter docs at length. I have tried Stack Overflow. I have asked at a Meetup. I'm out of ideas to try to get it to work. http://codepen.io/Mmgfrog/pen/egOxwq?editors=1010#0
John Nunns
@johnnunns
so there's no way to make it so that it can naturally go from I[0] to the end of i
if I'm not doing a higher lvl function
like if( i[0]-i[end of i] === a | e | i | o | u) sum + 1
Tyler Moeller
@TylerMoeller
I'm not sure, their may be other methods out there, but a higher order function would definitely make it cleaner
Melissa Guerrero
@Mmgfrog
What is happening is that I can generate a quote from my array, no problem. But once that's done, my Twitter button is un-clickable.
John Nunns
@johnnunns
gotch
Tyler Moeller
@TylerMoeller
Melissa Guerrero
@Mmgfrog
Or, on page refresh/load, I can get a Twitter window to open, but no quote inside.
Tyler Moeller
@TylerMoeller
@Mmgfrog Most people create a button with the same style as your twitter button and make it a hyperlink rather than using the Twitter widget code. The documentation can be confusing
Melissa Guerrero
@Mmgfrog
@TylerMoeller Would that strategy still capture the quote? Thanks for your input
CamperBot
@camperbot
mmgfrog sends brownie points to @tylermoeller :sparkles: :thumbsup: :sparkles:
:star2: 1389 | @tylermoeller |http://www.freecodecamp.com/tylermoeller
Ronit
@rfried99
Hello campers! I could really use your help. I can't seem to get a background image to rend. Here is the code: http://codepen.io/rfried99/pen/QGYyXy
Tyler Moeller
@TylerMoeller
@Mmgfrog Yes, it should - you are getting the quote text from the page, so there isn't a scope issue to worry about.
Melissa Guerrero
@Mmgfrog
@TylerMoeller OK I will redo that part without the widget. I appreciate it!
John Nunns
@johnnunns
@TylerMoeller semi cheating here, because I know the word is 'abracadabra' but to save time i wrote this
function getCount(str) {
var sum=0
var i = str.split('');
for(var x=0; x<i.length; x++){
if (i[0] === 'a'){
sum + 1;
} else if (i[3] === 'a'){
sum+1;
} else if (i[5] === 'a') {
sum + 1;
} else if (i[7] === 'a') {
sum + 1;
} else if (i[10] === 'a') { 
sum + 1;

};

};

return sum;

}