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
Markus Kiili
@Masd925
From the callback function you need to return the capitalized word (made from the original stored in parameter word).
@AmitP88
Aditya
@ezioda004
@AmitP88 You just need to return capWord in the map. If you console.log(capitalized)now you'll see its an array so just join() it and return.
Amit Patel
@AmitP88
@ezioda004 it worked :)

function titleCase(str) {

  var wordsArray = str.split(' ');

  var capitalized = wordsArray.map(function(word) {

    var capWord = word.charAt(0).toUpperCase() + word.slice(1).toLowerCase();

    return capWord;

  });

  console.log(capitalized);

  return capitalized.join(" ");
}





titleCase("HERE IS MY HANDLE HERE IS MY SPOUT");
damn, I can't believe I got stumped on such a small detail like that lol
Aditya
@ezioda004
@AmitP88 :thumbsup: It happens, you'll remember that detail now :D
Gersho
@Gersho
really ? i usually have to do the same mistake 10 times before i remember it :P
Markus Kiili
@Masd925
@AmitP88 You could try removing some of those variables that you declare there. Might also get more readable that way.
Amit Patel
@AmitP88
lol thanks @ezioda004 :)
CamperBot
@camperbot
amitp88 sends brownie points to @ezioda004 :sparkles: :thumbsup: :sparkles:
:cookie: 390 | @ezioda004 |http://www.freecodecamp.org/ezioda004
Amit Patel
@AmitP88
@Masd925 for sure. I did that just so that it helps me see each step in solving the problem, but once I get better at solving on my own, I'll try to minimize the amount of variables I use
Aditya
@ezioda004

really ? i usually have to do the same mistake 10 times before i remember it :P

like the old saying, 10th times the charm

Gersho
@Gersho
@AmitP88 try having 2 windows side to side with your code, keep one like that, and on the other one remove variables one by one like @Masd925 suggests until you cannot anymore
Amit Patel
@AmitP88
@Gersho that's a good idea. I'll start doing that from now on :) thank you
CamperBot
@camperbot
amitp88 sends brownie points to @gersho :sparkles: :thumbsup: :sparkles:
:cookie: 584 | @gersho |http://www.freecodecamp.org/gersho
i am not able to retrieve the json data
please help me
Markus Kiili
@Masd925
@1rjun Check the string literals and plus's on line 26.
I think that there is a syntax error there.
Gersho
@Gersho
i see one too
btw that's a really complex structure you have for the geoloc
1rjun
@1rjun
there is no error @Masd925
Gersho
@Gersho
if you say so, must be goblins messin with your code then
Markus Kiili
@Masd925
@1rjun You are missing one + around latitude variable.
Gersho
@Gersho
it's not missing it's inside the quotation
so misplaced;)
1rjun
@1rjun
nothing is missing @Masd925 it is already there,you can see in the console too
there is nothing wrong in url
Aditya
@ezioda004
You obviously just corrected it, it was there before
1rjun
@1rjun
and i also copy paste that url in another tab of firefox and json data is retrieving
Markus Kiili
@Masd925
@ezioda004 A goblin did that!
1rjun
@1rjun
i think i should need a key there
which i was missing
because i didnt created the openweathermap
account
Muhammed Hafiz
@zifahm
Use Provider to Connect Redux to React
https://beta.freecodecamp.org/en/challenges/react-and-redux/use-provider-to-connect-redux-to-react
<Provider store={store}>
    <DisplayMessages/>
    </Provider>
is this wrong?
ahmed-issa-mohd
@ahmed-issa-mohd
can you tell me what is http header ?
Stephen James
@sjames1958gm
@zifahm Is that code inside a render function and return statement?
Muhammed Hafiz
@zifahm
ohhhhhhh
@sjames1958gm thanks again
CamperBot
@camperbot
zifahm sends brownie points to @sjames1958gm :sparkles: :thumbsup: :sparkles:
:star2: 8863 | @sjames1958gm |http://www.freecodecamp.org/sjames1958gm
Stephen James
@sjames1958gm
:+1:
Brandon Blackwell
@Radlerz1
hello, I am using react with redux its my first time using redux. I am calling an api in my react component then sending that data from my component to the redux store so I can access it throughout all components. My question is would it be better to call a function in redux from my react component that executes the api call in the reducer and stores the data in the redux store that way. which way is better ? if there is advantages and disadvantages to both
Joy
@Yorokobi05
Good day! I would just like to ask regarding .indexOf property in JS. I cannot have it returned "false".
Brandon Blackwell
@Radlerz1
indexOf doesn't not return false if there is not match it returns -1 @Yorokobi05