These are chat archives for FreeCodeCamp/HelpFrontEnd

19th
Sep 2018
Rishabh Gupta
@RishabhGupta22
Sep 19 2018 01:37
NEED HELP
i have made a quiz (spa) using js and i want that whenever i click 1,2,3,4,5 button they should redirect me to the question number 1,2,3,4,5 respectively.
link : https://codepen.io/rishabhgupta/full/pOxYZE
thanks in advance !!
Mel Macaluso
@MelMacaluso
Sep 19 2018 08:17
@RishabhGupta22 "ReferenceError: res is not defined
at HTMLButtonElement.onclick"
your res function might be out of scope
Ruben Dario
@rubendmatos1985
Sep 19 2018 10:20
Hello camp here i left you my Markup Previewer. If you 'd like to take a look and tell me what do you think about it. Greetings
i used React and Flexbox and Css Grid
@PGFracing Thanksss!!!!!
@Supra01 Thanks
Alvis
@Flush7
Sep 19 2018 10:23
seem slike there are no more cookies for saying thanks :(
Ruben Dario
@rubendmatos1985
Sep 19 2018 10:24
@Flush7 What do you mean
Alvis
@Flush7
Sep 19 2018 10:25
a year ago there was a thanks counter in a way of cookies given to other person. no valuable profit or gains, just a visual stuff so you can see whos more helpful by having most cookies :D
AJ Brommy
@AJ-Brommy
Sep 19 2018 14:30
@newmoon thanks :)
Eric Weiss
@eweiss17
Sep 19 2018 14:56
i had probably close to 1k cookies too....
AJ Brommy
@AJ-Brommy
Sep 19 2018 15:13
Hey guys, I have a curiosity about the Responsive Web Design Certification. Did yours come through straight away after completing your last project? or did it take some time? Does someone actually check through your work I wonder? It's just that technically I've completed the section, I have ticks on all projects, but my portfolio page is one I completed last year before the changes were made. I'm going to re do it anyway, but I'm wondering if the certification hasn't come through yet due to this, that maybe I need to either re submit it, or submit a new one. Or if its due to someone having to check through my work.
Tom
@moT01
Sep 19 2018 15:15
@AJ-Brommy no, just go to your settings, and scroll down to the responsive projects area, click claim certificate
Emil
@aguyinmontreal
Sep 19 2018 15:15
Hi guys! What are good resources to learn proper Javascript testing?
AJ Brommy
@AJ-Brommy
Sep 19 2018 15:16
@moT01 ha, omg, thanks for that.. could have been waiting a long time lol
Tom
@moT01
Sep 19 2018 15:17
:thumbsup:
AJ Brommy
@AJ-Brommy
Sep 19 2018 15:20
is there different levels of achievement do you know? like pass, distinction, etc. ?
i'm still wondering what happens when I click "claim certification" too. Should I wait till I have completed my new portfolio page? as once it is complete I would prefer to have the current one removed and replaced with the new one.
But it would be nice to have the qualification to show to potential employers etc
Eric Weiss
@eweiss17
Sep 19 2018 15:28
@AJ-Brommy don't think there are any negatives to claiming now
AJ Brommy
@AJ-Brommy
Sep 19 2018 15:30
ok ta, will i still be able to replace the old portfolio with the new then?
Tom
@moT01
Sep 19 2018 15:34
there's no levels or grades - you either have the cert or not
you may not be able to change the link to your project though
yea, I dont think you can do that at the moment - there might be something in the works to add that ability
the only way would be to change your existing portfolio
which probably wouldn't be hard
newmoon
@newmoon
Sep 19 2018 16:27
@aguyinmontreal Mocha and Chai are used a lot for testing JS code. You may want to chat with the people over at: https://gitter.im/mochajs/mocha
AJ Brommy
@AJ-Brommy
Sep 19 2018 16:28
ok, thanks for the info @moT01
Nicolas Ramirez
@kamatheuska
Sep 19 2018 16:43
can someone give me a hand with the cashRegister algotithm?
function checkCashRegister(price, cash, cid) {
    let changeDue = cash - price
    let count = changeDue
    let totalCash = cid.reduce((cur, unit) => +(cur + unit[1]).toFixed(2), 0)
    let currencyNetWorth = [0.01, 0.05, 0.1, 0.25, 1, 5, 10, 20, 100].reverse()

    const countCashUnits = (cashInCurrency, curIndex) => {
        let curUnits = Math.floor(count / currencyNetWorth[curIndex])
        if (curUnits < 1)
            return cashInCurrency.map((el, i) => i === 1 ? 0 : el)
        else {
            // Subtract the current count of change
            let curTotal = curUnits * currencyNetWorth[curIndex]
            let foo = curTotal - (curTotal - cashInCurrency[1])
            count = + (count - curTotal).toFixed(2)
            return cashInCurrency.map((el, i) =>
                i === 1 ? foo : el)
        }
    }
    const getChange = (cashRegister) => {
        let result = cashRegister
            .reverse()
            .map((currency, index) => countCashUnits(currency, index))
            .filter((currency) => currency[1] !== 0)

        return changeDue !== 0 ? result : false
    }
    let finalChange = getChange(cid)
    return totalCash === changeDue
        ? { status: "CLOSED", change: cid }
        : totalCash < changeDue || !finalChange
            ? { status: "INSUFFICIENT_FUNDS", change: [] }
            : { status: "OPEN", change: finalChange }
}
This is what I have until now...help pleaseeee
Emil
@aguyinmontreal
Sep 19 2018 17:27
thanks @newmoon
Nerando Johnson
@Nerajno
Sep 19 2018 21:45
Greetings
Brad
@bradtaniguchi
Sep 19 2018 21:49
@Nerajno hello
I need a bit of help to make the labels to be right in the left column
Nerando Johnson
@Nerajno
Sep 19 2018 21:58
@bradtaniguchi can you help
?
Mel Macaluso
@MelMacaluso
Sep 19 2018 21:59
well if you give the <label> instead of max-width: 100% a width:100% they will be
Brad
@bradtaniguchi
Sep 19 2018 21:59
@Nerajno maybe look into the css text-align property?
Mel Macaluso
@MelMacaluso
Sep 19 2018 22:00
but UX wise is not ideal
Nerando Johnson
@Nerajno
Sep 19 2018 22:00
i know but i am trying to get it good
otherwise I am gonna write it up and leve it on git hub
Mel Macaluso
@MelMacaluso
Sep 19 2018 22:03
Makes sense
Nerando Johnson
@Nerajno
Sep 19 2018 22:14
ok gonna keep at it
Nerando Johnson
@Nerajno
Sep 19 2018 23:32
still havent solved the problems
but gonna leave it be for a bit
AJ Brommy
@AJ-Brommy
Sep 19 2018 23:52
What exactly are you trying to do that you are stuck with? You message earlier wasn't clear to me.