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
Hussein Zaki
@Hussein90
see how to remove from arry using splice()
don't know to access it in my component
@bradtaniguchi
Brad
@bradtaniguchi
Id recommend figuring out what you dont know and then figuring out how to find the answer
Hussein Zaki
@Hussein90
i know i will recommend that also but i didn't get at all
@bradtaniguchi
Brad
@bradtaniguchi
If you find yourself still stuck, then you might need to dig deeper or backup and re-evaluate what you actually don't know, since if "learning" the answer to something doesn't actually give you the answer, your probably looking at the wrong question, or missing other understanding of another concept.
If your not sure how to remove items from an array, then find that out, if your not sure how to update state in react, look that up, if your not sure how to remove an item from an array then update its reference in another item look that up, if your not sure what pass by "value vs pass by reference" then look it up, if your not sure how to use "splice" then look that up, etc etc..
Hussein Zaki
@Hussein90
you are right
i am sorry
that i am look dumb
but i am really didn't understand
@bradtaniguchi
Stevegolden12
@Stevegolden12
@Hussein90 We all make mistakes and we all need help at times. I personally appreciated the fact that you stuck with it.
Hussein Zaki
@Hussein90
and i am still stuck with it @Stevegolden12
Hussein Zaki
@Hussein90
@all i am still stuck can anyone help me
please
Claudio Restifo
@Marmiz
what's the matter?
Hussein Zaki
@Hussein90
i have problem with my delete button
@Marmiz
try to click on delete button
the first and then the second one
and then refresh do that vise versa
Claudio Restifo
@Marmiz
const dataposts = Object.assign([], this.state.data.posts);
what?
Hussein Zaki
@Hussein90
???
Claudio Restifo
@Marmiz
why do you want to allocate memory for a new object into an array?
Hussein Zaki
@Hussein90
i don't want
Claudio Restifo
@Marmiz
so what's that line
cos that's what that line is telling the program to fo
*do
Hussein Zaki
@Hussein90
okay
Claudio Restifo
@Marmiz

what are you tring to accomplish? Remove the clicked element?

if so why your delete set the state to an empty array?

Hussein Zaki
@Hussein90
yes
Claudio Restifo
@Marmiz
why your delete set the state to an empty array?
Hussein Zaki
@Hussein90
i don't know
Claudio Restifo
@Marmiz
who should know it then?
Hussein Zaki
@Hussein90
okay i made a mistake
Claudio Restifo
@Marmiz
everyone does
no big deal
the main thing however is understeanding
like how can your app show "all the data you had before minus one" if you are telling it that now the data is an empty array?
Jack Lyons
@JackEdwardLyons
hey all, anyone wanna pair up on the Cash Register Algorithm Challenge?
cat998
@cat998
hello,everybody.I have a problem,how to upload an image to codepen?
A-J Roos
@Asjas
@cat998 You can't. Unless you pay for Codepen. So use a free image hosting service like Cloudinary
Daniel Simeonov
@dbsimeonov
Guys how can I create my ajax request to stop the script until I have the response. Or with other words im trying to create my response reusable into variables?
Victor Popescu
@VicPopescu
you use a global variable and you assign the data to it after the response @dbsimeonov
global meaning, out of the ajax call scope and inside the parent scope where you need it
Daniel Simeonov
@dbsimeonov
yes but when I console log my variable outside the scope it will be null as its logging it to me before its assigned
Victor Popescu
@VicPopescu
callback is one variant
you put the rest of the code into a function and you pass that function as a callback to your ajax call
and call it on response and pass the data as an argument