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
Amit Patel
@AmitP88
@Marianissimus I was thinking of doing that, but wouldn't that break the DRY rule?
Marianissimus
@Marianissimus
why? what are you repeating? you need to return an array, dont you?
Amit Patel
@AmitP88
oh, I thought you meant like:
math.max.apply(null, arr[0]
math.max.apply(null, arr[1]
etc
Marianissimus
@Marianissimus
or use the map/reduce function. it's shorter, of course
Markus Kiili
@Masd925
@AmitP88 You just need to map element arrays to maximum elements of those arrays. So map is a good idea.
Marianissimus
@Marianissimus
@AmitP88 oh, no. use the loop, just dont return the results, use them in a new array;
push them into newarr, for instance
Amit Patel
@AmitP88
ah I see
Joshua Frias
@Juke-Magic
guys help me please
i need ya'll
Amit Patel
@AmitP88
ok, I'll brb. gotta sort this out real quick. thanks @Marianissimus @Masd925 for your tips. I'll let you know how it goes :)
CamperBot
@camperbot
amitp88 sends brownie points to @marianissimus and @masd925 :sparkles: :thumbsup: :sparkles:
:cookie: 456 | @marianissimus |http://www.freecodecamp.org/marianissimus
:star2: 4657 | @masd925 |http://www.freecodecamp.org/masd925
Markus Kiili
@Masd925
@AmitP88 Easiest is to forget the loop and just use map and Math.max.
Amit Patel
@AmitP88
@Masd925 for sure. I'll see if I can pull it off using just those two methods. I think I'm overdoing it with the loop
Ayush Bahuguna
@relentless-coder
can anyone help me with react?

this is my component

export function AllExpense(props) {
    const renderExpense = ({data}) => {
        console.log(data.data);
        return (
            <div>
                <div>
                    <h2><Link to="/expense/new">Add Expense</Link></h2>
                </div>
                {
                    data.data.length > 0 ? <ul>
                        <li>
                            data.data.map(el =><ListItem key={el._id.toString()} value={el}/>)
                        </li>
                    </ul> : <h2>Enter some data!!</h2>
                }

            </div>
        )
    };
    return allExpenseAPi().then(renderExpense).catch((err) => {
        alert(err.message)
    })
}

and I keep getting error Objects are not valid as a React child

William Watts
@Braillon7
hello campers...I'm in dire need of help on something that could turn out to be very simple...I'm working on the second page of my "todoapp" and for some reason I can't get my, short, Jquery function to work..it's just a short statement to bring up a css class instruction https://codepen.io/Braillon7/pen/RxBWbY
Anshul Adlakha
@anshuladlakha
I'm trying to make a new tab chrome extension and I'm trying to add a clock to it and I'm having a really hard time because Chrome won't let me load setIntervals which I need for updating the time every second, then I tried using chrome alarms API by adding a event page but for some reason that's not working either. Can anyone help me out.
Ayush Bahuguna
@relentless-coder
okay, i resolved it, nevermind
William Watts
@Braillon7
@AmitP88 were you able to figure it out?
Joy
@Yorokobi05
Hello, I would just like to ask if the challenge for the Falsy Bouncer under the Basic Algorithm cannot be solved by using Microsoft Edge. (Am I really required to use Mozilla for this?) Thanks.
VaseJS
@VaseJS
@Yorokobi05 maybe just not microsoft Edge
Joy
@Yorokobi05
ok, thanks. I'll try again. :)
Tom
@moT01
@Braillon7 any luck? what are you trying to do? - you add the active class but there's no style for it
ehutchllew
@ehutchllew
@Braillon7 the event handler is working, but your task-form element seems to be hidden, at least on my screen.
@relentless-coder if you need further help with react, let me know, I work with it daily hehe.
Emil
@aguyinmontreal
Hi everyone! Does someone knows how jquery ajax exactly determines what is a "fail" in $.ajax.fail ? I can't find the documentation for it :/
Omar Tan
@wheelhot

Woo hoo! Finally completed Twitch.tv project!

https://codepen.io/wheelhot/full/XVxyEK/

Oddly there’s some weird scaling behaviour on codepen, I don’t get this issue on the various browsers I tested

ehutchllew
@ehutchllew
@aguyinmontreal been a while since i've used jQuery's ajax call, but isn't there an "error" parameter when you fill out the request object?
Kaz Baig
@kbaig

@aguyinmontreal From the jquery.ajax documentation:

jqXHR.fail(function( jqXHR, textStatus, errorThrown ) {});
An alternative construct to the error callback option, the .fail() method replaces the deprecated .error() method. Refer to deferred.fail() for implementation details.

The jqXHR objects returned by $.ajax()
Stephen James
@sjames1958gm
@wheelhot :+1:
Kaz Baig
@kbaig
@ehutchllew nice! Maybe consider subtle borders for the thumbnails to improve contrast with the background?
(and also potentially slightly rounded borders)
The text on thumbnail hover is overflowing for me in some cases when I keep the browser wide but make it a bit shorter
Emil
@aguyinmontreal

@ehutchllew @kbaig I'm talking about this example : var jqxhr = $.get( "example.php", function() { alert( "success" ); }) .done(function() { alert( "second success" ); }) .fail(function() { alert( "error" ); }) .always(function() { alert( "finished" ); }); see here: http://api.jquery.com/jQuery.get/

No matter what response is sent by my server, my front-end code uses the ".fail" and not the ".done" code. So, I wanted to know what are the specs for the ".fail" condition.

Kaz Baig
@kbaig
@aguyinmontreal what does the error say?
if there is one
Emil
@aguyinmontreal
What is a "failure" exactly?
Kaz Baig
@kbaig
If the call fails for whatever reason
As seen above, the params of jqXHR.fail are errors, so try logging those to see what's going on
Emil
@aguyinmontreal
@kbaig no error on console, I will try to log the error, thanks
CamperBot
@camperbot
aguyinmontreal sends brownie points to @kbaig :sparkles: :thumbsup: :sparkles:
:cookie: 531 | @kbaig |http://www.freecodecamp.org/kbaig
Ayush Bahuguna
@relentless-coder
@ehutchllew hey, yes, so I have started learning since last weekend, and so far I have managed to setup a dummy app, it has no css styles though, could you give my code a quick glance, and point out the bad practices? https://github.com/relentless-coder/expense-management I had built this project on Angular, but then to learn better, I replaced the client with React.
Ayush Bahuguna
@relentless-coder
@aguyinmontreal could you share your code? From my understanding, XMLHTTPRequest consider a request as a failure when the response code received from the server is 400 series and 500 series, now as far as promises are concerned, it's probable that code inside your .done() is throwing an error that .fail() is collecting.
ehutchllew
@ehutchllew
@relentless-coder cool, i'll take a look
Emil
@aguyinmontreal
@relentless-coder this is what I get when logging what's inside the .fail() : "readyState":4,"responseText":"OK","status":200,"statusText":"OK"