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
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
Joy
@Yorokobi05

function mutation(arr) {
for (var i = 0; i < arr[1].length; i++){
var z = (arr[1].toLowerCase()).split("");
var a = (arr[0].toLowerCase()).indexOf(z[i]);
if (a != -1) {
return true;
} else return false;
}

}

mutation(["hello", "hey"]);

I already have this one, however, it returns " true".
Brandon Blackwell
@Radlerz1
what is the question your on?
Joy
@Yorokobi05
Mutation under the Basic Algorithm
Marianissimus
@Marianissimus
@Yorokobi05 else should be // else {return false;}
Stephen James
@sjames1958gm
@Yorokobi05 you shouldn't return true until all the letter have been checked
Marianissimus
@Marianissimus
and why do you use brackets for var a and z?
Aditya
@ezioda004
@Yorokobi05 This one returns true because that index exists. (arr[0].toLowerCase()).indexOf(z[i]) returns a number
Joy
@Yorokobi05
@Marianissimus it's the same. (regarding the else statement) and I think it's fine even if I didn't put it under the for loop.
Stephen James
@sjames1958gm
@Yorokobi05 You should only return for the false case inside the loop - then if the loop finishes without returning false then return true
Joy
@Yorokobi05
Ok. I'll recheck first. Thanks!
Stephen James
@sjames1958gm
@Yorokobi05 A suggestion to take after you get it working:
var z = (arr[1].toLowerCase()).split("");
this code doesn't depend on the loop variables and should be done before the loop as optimization
Joy
@Yorokobi05
@sjames1958gm still don't get it. haha

function mutation(arr) {
var z = (arr[1].toLowerCase()).split("");
for (var i = 0; i < arr[1].length; i++){
var a = (arr[0].toLowerCase()).indexOf(z[i]);
if (a != -1) {
return false;
}
} return true;

}

mutation(["hello", "hey"]);

Stephen James
@sjames1958gm
@Yorokobi05 false is a == -1 not a != -1
Joy
@Yorokobi05
oh, I forgot to replace it.
It's working! Thanks a bunch @sjames1958gm !