Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Jun 19 2020 20:09
    @krisb1220 banned @Gastony
  • May 14 2020 22:38
    @bjorno43 banned @minitechtips_twitter
  • May 14 2020 22:37
    @bjorno43 banned @real-action
  • Feb 01 2020 00:26
    @bjorno43 banned @Ndoua
  • Jan 07 2020 03:10
    @bjorno43 banned @doctor-sam
  • Aug 17 2019 09:33
    User @bjorno43 unbanned @linkin-park
  • Jun 20 2019 21:19
    @bjorno43 banned @shenerd140
  • May 10 2019 09:13
    @bjorno43 banned @zhaokunhaoa
  • Apr 25 2019 17:12
    @mstellaluna banned @cmal
  • Apr 01 2019 18:11
    thecodingaviator labeled #31179
  • Apr 01 2019 18:11
    thecodingaviator labeled #31179
  • Apr 01 2019 18:09
    thecodingaviator commented #31179
  • Apr 01 2019 18:09
    thecodingaviator labeled #31182
  • Apr 01 2019 18:09
    thecodingaviator labeled #31182
  • Apr 01 2019 18:07
    thecodingaviator commented #31182
  • Apr 01 2019 18:07
    thecodingaviator labeled #31190
  • Apr 01 2019 18:07
    thecodingaviator labeled #31190
  • Apr 01 2019 18:07
    thecodingaviator commented #31190
  • Apr 01 2019 18:05
    thecodingaviator commented #31157
  • Apr 01 2019 18:04

    thecodingaviator on master

    remove A (#31157) (compare)

David Amanze
@GodKingShogun
@Chrono79 i dont think any of the prior lessons taught me how to target the first letter of each word
Diego Mayer
@Chrono79
@GodKingShogun That's why you should stick with string index and simple functions like slice (at least for the time being)
It can be done with a regex, but in FCC there are no lessons about it
David Amanze
@GodKingShogun
@Chrono79 i don't think the prior lessons have taught me string index or slice to lol
too*
David Amanze
@GodKingShogun
@Chrono79 oh yea i remember that lesson. it's been a while
lol
Zaluth
@Zaluth
@Chrono79 i'm still so lost
function destroyer(arr) {
  var args = [].slice.call(arguments);
  var slice = args.slice(1);

  // slice = [2,3]
  // arr = [1, 2, 3, 1, 2, 3]
  // args = [[1, 2, 3, 1, 2, 3], 2, 3]

  function filter(value) {
    return value === slice;
  }

  var seek = arr.filter(filter);
  return seek.indexOf(slice) === -1;

}

destroyer([1, 2, 3, 1, 2, 3], 2, 3, 4);
Diego Mayer
@Chrono79
@Zaluth the indexOf goes inside your filter function
David Amanze
@GodKingShogun
@Chrono79 i reviewed both materials but still not sure how i can target each first letter of words in a string. basically if the argument is"red is my favorite color" the function would have to return "Red Is My Favorite Color"
Diego Mayer
@Chrono79
@GodKingShogun you could use split(" "), to get an array of words, change each word, and then use join(" ") to get a string back
David Amanze
@GodKingShogun
@Chrono79 but i thought you said i couldnt use the replace method after the split method
Greg Duncan
@GregatGit
@Zaluth first create an array of elements that will purge
Diego Mayer
@Chrono79
@GodKingShogun no, you could use replace with a regex (and we discarded that path because it requires knowing how to use it)
Greg Duncan
@GregatGit
@Zaluth you should write a function with a different name that filter but uses indexOf()
@Zaluth then using filter use your new fitlter function to create the a new array and return that array
David Amanze
@GodKingShogun
@Chrono79 i know how to use regex a little. im just not sure which regexp i would use to target the first letter of each word
Diego Mayer
@Chrono79
@GodKingShogun it's not an easy one to figure out
Anshul Bisht
@chocochip15
can anybody help me out wid counting cards problem in java script ??
Diego Mayer
@Chrono79
@chocochip15 show your code
David Amanze
@GodKingShogun
i said /D earlier because /d targets digits and the opposite of any regexp is capitalized
Diego Mayer
@Chrono79

@GodKingShogun let's go with this path:

@GodKingShogun you could use split(" "), to get an array of words, change each word, and then use join(" ") to get a string back

Anshul Bisht
@chocochip15

var count = 0;

function cc(card) {
// Only change code below this line
switch(card){
case 2:
case 3:
case 4:
case 5:
case 6:
count ++;

  break;
case 7:
case 8:
case 9:
  break;
case 10:
case "J":
case "Q":
case "K":
case "A":
  count --;
  break;

}

if (count<1) { return count+" Hold"; } else if (count>1){
return count+" Bet";
}
// Only change code above this line
}

// Add/remove calls to test your function.
// Note: Only the last will display
cc(2); cc(2); cc(10);

Diego Mayer
@Chrono79
@chocochip15 what if count is 1?
David Amanze
@GodKingShogun
@Chrono79 what would i use for the change each word part
Anshul Bisht
@chocochip15
thnx man ;)
Diego Mayer
@Chrono79
@GodKingShogun word[0].toUpperCase() + the rest of the word
Anshul Bisht
@chocochip15
@Chrono79 thnx man
CamperBot
@camperbot
:star2: 2825 | @chrono79 |http://www.freecodecamp.com/chrono79
chocochip15 sends brownie points to @chrono79 :sparkles: :thumbsup: :sparkles:
Diego Mayer
@Chrono79
:+1:
David Amanze
@GodKingShogun
@Chrono79

function titleCase(str) {
  return str.split(" ")[0].toUpperCase().join(" ");
}

titleCase("I'm a little tea pot");
this is what i have so far
Diego Mayer
@Chrono79
@GodKingShogun you should use some kind of loop, a real loop, or if you want to chain methods, use map
With that code, you get "I'M"
David Amanze
@GodKingShogun
@Chrono79 ok let me try using the map method
anweshd
@anweshd
how to change myVar=myVar??
silver537
@silver537
@GodKingShogun dont forget to add the rest of the word to your str.split (" ")[0]
Tejanth
@Tejanth
hello everyone
I have this code but I need some help
var a = 7;
var b = 7;
it says a should be assigned to b with =
how would I do that?
Su Yang
@ssxyang
@Tejanth var b = a;
Tejanth
@Tejanth
why doesnt var a=b work?
Su Yang
@ssxyang
@Tejanth the question asks for var a to be assigned to var b
Tejanth
@Tejanth
oh ok
Su Yang
@ssxyang
var a = b would work if you first defined var b = 7 and the question asked for var b to be assigned to a
David Amanze
@GodKingShogun
@Chrono79 and @silver537 ```