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)

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 ```
Tejanth
@Tejanth
yes i think that just takes some getting used to
just started this language
David Amanze
@GodKingShogun
function titleCase(str) {
  return str.split(" ").map(function(val) {
   return val.toUpperCase();
}).join(" ");
}
Steven Sun
@sunstevensun
has anyone done "No Repeats Please"?
Tejanth
@Tejanth
thank @suyang581
CamperBot
@camperbot
:warning: could not find receiver for suyang581
tejanth sends brownie points to @suyang581 :sparkles: :thumbsup: :sparkles:
silver537
@silver537
@Tejanth its just the logic FCC is looking for.
Su Yang
@ssxyang
@Tejanth yep! you'll get used to it (:
Alexander Køpke
@alexanderkopke
@Zaluth you have seek.indexOf(slice) === -1; but slice if I understand correctly is an array. I think this would be ok if there was an array in seek but there are only items of numbers. Use indexOf on slice to find out if value is present in slice or not. I think this should happen in the filter function that you made since it is that function that returns the array you'll return in the end.
Diego Mayer
@Chrono79
@GodKingShogun now you're uppercasing the whole word, first, lowercase the whole string (before using split) and then rebuild your word as the first letter uppercased and the rest of the word
Have you heard of string concatenation?
silver537
@silver537
@GodKingShogun no. That will output EVERYTHING in uppercase.
David Amanze
@GodKingShogun
@Chrono79 i tried adding bracket notation to the val but i t only return the first letter in each word
Diego Mayer
@Chrono79
@GodKingShogun remember I told you to use slice
bkapadia
@bkapadia

function sumAll(arr) {
var add =0;
var min=Math.min(...arr);

var max=Math.max(...arr);

for(i=min;i==max;i++){
add=add+min;
}
return add;
}
sumAll([1, 4]);

silver537
@silver537
@GodKingShogun remember in the previous challenge you had used a string method called splice. Which basically cuts a string where you specify. So '"hello".splice (1)=>ello` because youre cutting the string at the first letter.
David Amanze
@GodKingShogun
@Chrono79 thats where you add a +
bkapadia
@bkapadia
any idea why this code gives value of 0
David Amanze
@GodKingShogun
@Chrono79 i tried adding bracket notation to the val but i t only return the first letter in each word
silver537
@silver537
Slice* sorry. On my phone and cant edit my messages. :(
Diego Mayer
@Chrono79
@GodKingShogun look at the example @silver537 gave you (and yes, it's slice, splice is an array method)
bkapadia
@bkapadia
min and max values are correct just the for loop isn't output the total
Diego Mayer
@Chrono79
@bkapadia i==max isn't a good condition for your loop
manugp
@manugp
@Chrono79 did it

function titleCase(str) {
str = str.split(' ').map(function(value){
return value.split('').map(function(val,index){
if (index === 0)
return val.toUpperCase();
else
return val.toLowerCase();
}).join('');
}).join(' ');
return str;
}

titleCase("I'm a little tea pot");

bkapadia
@bkapadia
hmm
Diego Mayer
@Chrono79
@manugp not very orthodox, but congrats :+1:
silver537
@silver537
A bit too much. Actually. But hey, if it works, it works. :P
bkapadia
@bkapadia
i<=max