These are chat archives for FreeCodeCamp/HelpJavaScript

2nd
Aug 2018
Blauelf
@Blauelf
Aug 02 2018 07:39
@JLuboff I liked my old, nasty microswitch keyboard. Heavy, loud as hell, but felt great. The switches were a problem, though, "e" and "5" would no longer respond most of the time, and I guess the less used keys were soon to follow.
Simon Cordova
@gbsimon87
Aug 02 2018 08:41
morning
Blauelf
@Blauelf
Aug 02 2018 08:55
Good morning
Richa
@richa-coder
Aug 02 2018 08:55
Hello guys
I am using handlebars to render 1000 data in html table, getting the data through Ajax, 1st shot getting only 5 and rendering the front page which consists of 5 rows and thereafter getting remaining data 50 at a tym and then rendering again
But after populating 300+ data the Dom is becoming heavy and it's difficult to scroll down using scrollbar
I need some help with the optimization part..
Simon Cordova
@gbsimon87
Aug 02 2018 09:33
@richa-coder I'd help out but have never worked with handlebars :(
Tiago Correia
@tiagocorreiaalmeida
Aug 02 2018 09:34
@Blauelf was like a machine gun everytime you had to write something
Blauelf
@Blauelf
Aug 02 2018 09:38

Was the only kind of keyboard I knew at that time. The only type with reasonable accuracy, that is.

Maybe I should mention I learnt on a mechanic typewriter (though I always struggled with the shift key, finger too weak to lift the whole thing fast enough each time), which makes me more accustomed to loud typing noise and requiring a lot of force for every key press.

Simon Cordova
@gbsimon87
Aug 02 2018 09:43
I love the feel of my Mac keyboard, but not the layout. Spent too much time on it and the outer sides of my wrist begin to ache pretty bad.
wrists**
Ozarion
@Ozarion
Aug 02 2018 12:16
Hey Everyone. :)
I'm a little stuck here. Would anyone please take a look at and help me figure out why it is not rendering?
https://codepen.io/ozarion/pen/NByXwL?editors=1011
Simon Cordova
@gbsimon87
Aug 02 2018 12:26
@Ozarion I can give it a look in a little bit if need be
Ozarion
@Ozarion
Aug 02 2018 12:34
@gbsimon87 Thank you. Please. I don't know if it's codepen specific or I'm doing something wrong. Just need a little hint. :)
Simon Cordova
@gbsimon87
Aug 02 2018 13:19
@Ozarion I took a look at it but to be fairly honest I'm not well versed with Redux
Sorry I couldn't be much help - I tried :)
James Itum
@isemaj_gitlab
Aug 02 2018 13:39
is there any way to cache image git javascript (jquery)?
James Itum
@isemaj_gitlab
Aug 02 2018 13:42
thank you
May Kittens Devour Your Soul
@diomed
Aug 02 2018 14:10
  result = result.replace(/\"/gi, "" /n);
I need new line, between every submit
can that be done with regex somehow
Christopher McCormack
@cmccormack
Aug 02 2018 14:11
@diomed newline is \n
replace is two arguments as well
May Kittens Devour Your Soul
@diomed
Aug 02 2018 14:13
@cmccormack how do I write that correctly
Christopher McCormack
@cmccormack
Aug 02 2018 14:13
what's your replace criteria supposed to look like
May Kittens Devour Your Soul
@diomed
Aug 02 2018 14:14
I need that what I have + new line
Christopher McCormack
@cmccormack
Aug 02 2018 14:15
"/gi, "?
oh I see syntax highlighting is borking it a little
your regex appears to only replace " with newline is that what you are looking for?
Simon Cordova
@gbsimon87
Aug 02 2018 14:17
Whats up @cmccormack
Early today I see
Christopher McCormack
@cmccormack
Aug 02 2018 14:17
@gbsimon87 yup had a change in Singapore today and the maintenance window is TOO EARLY
@gbsimon87 how you been?
Nerando Johnson
@Nerajno
Aug 02 2018 14:26
greetings
i need a but of help \
solving the caesar cipher and i have the issue if unexpected user input
 function rot13(str){ // LBH QVQ VG!
        str = str.toLowerCase(); 
        var alphabet ="abcdefghijklmnopqrstuvxwyz";
        alphabet = alphabet.split('');
        for(var i = 0; i < str.length; i+=1){
          if(str[i]=== alphabet){
            console.log("grace");
        }else{
          console.log("n/a");
        }

        // Change the inputs below to test
  rot13("SERR PBQR PNZC");
Christopher McCormack
@cmccormack
Aug 02 2018 14:29
@Nerajno if(str[i]=== alphabet){ is like saying if ( 'S' === 'abcdefghijklmnopqrstuvxwyz'.split('') ) {
you can use indexOf to get the position of the character within alphabet, if it's -1 then it is not in alphabet. You can also use the array method includes() if you don't need the actual index value
Nerando Johnson
@Nerajno
Aug 02 2018 14:32
ok thanks .....
May Kittens Devour Your Soul
@diomed
Aug 02 2018 14:33
@cmccormack look @ this pen
as you click submit several time u'll get the idea, it widens. i need it to fall down instead. - so it should 'heighten'
grow in height - not in width
Christopher McCormack
@cmccormack
Aug 02 2018 14:37
@diomed I'm not sure you can do that with just a string replace - I don't think HTML will parse the newline character but instead just display it. You may need to manually build a string instead
I've done this before, let me see if I can find the pen
Christopher McCormack
@cmccormack
Aug 02 2018 14:45
@diomed can't find it sorry - maybe you can just loop through your array each time you submit and build a new element containing block level elements that store the property value pair in some html elements instead of trying to display the object itself
Christopher McCormack
@cmccormack
Aug 02 2018 14:55

@diomed maybe something like this?

function getResult() {
  document.getElementById("result").innerHTML = `<div>${myArr.map(
    v => `<p class="property">${v.word}: ${v.meaning}</p>`
  )}</div>`;
}

I tried it and for some reason a comma keeps getting injected but I'm sure you can figure that one out :)

Blauelf
@Blauelf
Aug 02 2018 14:55
The comma gets injected because you implicitly convert an array to a string. Try myArr.map(...).join("") (or .join("\n") if you want)
Christopher McCormack
@cmccormack
Aug 02 2018 15:01
@Blauelf ah you're right, I didn't actually finish this code thanks
May Kittens Devour Your Soul
@diomed
Aug 02 2018 15:08
now I'm so confused on how code should look like in the end
abraham anak agung
@padunk
Aug 02 2018 15:09
how about add .replace(/\,(?={)/g, ',\n') after the first replace?
Simon Cordova
@gbsimon87
Aug 02 2018 15:09
@cmccormack I was just in Singapore a month and a half ago, cleanest place ever damn
Christopher McCormack
@cmccormack
Aug 02 2018 15:11
@gbsimon87 I really want to go there but haven't been able to convince the wife
hoping work will send me sometime. A colleague is there right now for a big project, I'll try to take the next big one :)
Simon Cordova
@gbsimon87
Aug 02 2018 15:11
Oh man it's clean place and all, but apart from Marina Bay it's just a corporate city-state really
Millions of banks that's for sure
Christopher McCormack
@cmccormack
Aug 02 2018 15:12
That sounds less appealing
Simon Cordova
@gbsimon87
Aug 02 2018 15:12
Can't blame her for wanting to explore other opportunities
lol
May Kittens Devour Your Soul
@diomed
Aug 02 2018 15:12
@padunk purrrfect. Thank You :cat:
abraham anak agung
@padunk
Aug 02 2018 15:13
Singapore is expensive :smile:
@diomed np :thumbsup:
Simon Cordova
@gbsimon87
Aug 02 2018 15:13
image.png
That's me looking swagged out over there lololol
Oh yeah and pricey as hell, some things were pricier than London
Christopher McCormack
@cmccormack
Aug 02 2018 15:13
That's a nice shirt
and building!
May Kittens Devour Your Soul
@diomed
Aug 02 2018 15:14
yes. their terrorists are strange
attack skyscrapers with boats
Christopher McCormack
@cmccormack
Aug 02 2018 15:14
@diomed LOL
Simon Cordova
@gbsimon87
Aug 02 2018 15:14
That building is the Marina Bay Sands, there's a boat on top.
abraham anak agung
@padunk
Aug 02 2018 15:14
@diomed :laughing:
Simon Cordova
@gbsimon87
Aug 02 2018 15:14
lolol
Christopher McCormack
@cmccormack
Aug 02 2018 15:14
that may be the first time I actually did lol
Jason Luboff
@JLuboff
Aug 02 2018 15:14
Morning
Christopher McCormack
@cmccormack
Aug 02 2018 15:15
@JLuboff :wave:
Jason Luboff
@JLuboff
Aug 02 2018 15:15
Whats up
Simon Cordova
@gbsimon87
Aug 02 2018 15:15

whats up @JLuboff

@cmccormack ps thanks on the shirt you know me taylor made custom fitted lolol

Christopher McCormack
@cmccormack
Aug 02 2018 15:16
I always wanted bespoke clothing
Simon Cordova
@gbsimon87
Aug 02 2018 15:16
Anyways I got good news!
I restructured my app after my MongoDB learnings and man it's helped with the data flow
Jason Luboff
@JLuboff
Aug 02 2018 15:16
Got my app presentation to upper management today...so long as all goes well..should be full roll out this afternoon/tomorrow...
Simon Cordova
@gbsimon87
Aug 02 2018 15:16
@JLuboff good stuff man, the one you been working on?
Christopher McCormack
@cmccormack
Aug 02 2018 15:16
@JLuboff I hope they don't throw balled up paper cups at you
Jason Luboff
@JLuboff
Aug 02 2018 15:17
Ya, the one I've been working on for far too long lol
Simon Cordova
@gbsimon87
Aug 02 2018 15:17
I can see the paper cups being thrown and he's out there like 'but, but, the FCC guys on Gitter said it was good!
lol
Jason Luboff
@JLuboff
Aug 02 2018 15:17
@cmccormack Luckily we don't hgave paper cups! Unluckily.... the cups are ceramic..
Simon Cordova
@gbsimon87
Aug 02 2018 15:17
@JLuboff nah good stuff man good luck today
Christopher McCormack
@cmccormack
Aug 02 2018 15:18
@JLuboff tougher to ball up at least
Jason Luboff
@JLuboff
Aug 02 2018 15:18
Thanks
Anybody else tired? Man I am tired
Simon Cordova
@gbsimon87
Aug 02 2018 15:22
My eyes are feeling tired been here its 8am, its 4:20
damn if I was younger this would be the time to celebrate
Jason Luboff
@JLuboff
Aug 02 2018 15:22
The kiddo was up at 3:40 AM... and wouldn't go back to sleep.. was 5:15 when my wife took him out of the room... so maybe got a few minutes of shut eye then but ugh lol
Simon Cordova
@gbsimon87
Aug 02 2018 15:23
Meh, tiredness sucks but at least it's your kid that kept you up and not some unnecessary bs
Jason Luboff
@JLuboff
Aug 02 2018 15:23
True
Simon Cordova
@gbsimon87
Aug 02 2018 15:23
You know I was reading a really interesting article last night which I'll try to put into action, let me see if I find it I'll share it
Christopher McCormack
@cmccormack
Aug 02 2018 15:28
@gbsimon87 just like you to not share the interesting article
:)
Simon Cordova
@gbsimon87
Aug 02 2018 15:36
sorry got a call lol
Jason Luboff
@JLuboff
Aug 02 2018 15:36
uh oh, watch out. We got a guy who gets calls over here
Simon Cordova
@gbsimon87
Aug 02 2018 15:37
lolol
job hunt is a full time hunt
call me lionel hutz
Christopher McCormack
@cmccormack
Aug 02 2018 15:38
Still didn't share it
Simon Cordova
@gbsimon87
Aug 02 2018 15:41
aaaahhh I can't find it
But it was basically drinking a lot of water and convincing yourself that you had a fine sleep last night - avoid thinking oh man I'm tired, basically a mind over matter thing
come to think of it, cli freaking che
Jason Luboff
@JLuboff
Aug 02 2018 15:43
I already drink a lot of water...not as much as I used to..but still a good amount
Simon Cordova
@gbsimon87
Aug 02 2018 15:43
Tell yourself you had a good sleep and convince yourself.
TBH I faked sick when I was in grade 6 once and I kept acting and I literally felt sick after so I can somewhat see that working
Jason Luboff
@JLuboff
Aug 02 2018 15:45
I could tell myself all kinds of things, doesn't mean I'll believe it! :joy:
Nerando Johnson
@Nerajno
Aug 02 2018 16:17
I have an issue.... can someone tell what is happening...
screenshot-repl.it-2018.08.02-12-16-38.png
Jason Luboff
@JLuboff
Aug 02 2018 16:18
@Nerajno You have two semi-colons after your alphabet variable
Chris
@crokita
Aug 02 2018 16:21
looks like you're missing a right bracket } to close the function off
Blauelf
@Blauelf
Aug 02 2018 16:21
That extra semicolon in this place shouldn't hurt anybody. But it should probably be .includes(str[i]), not .includes[i]
@crokita Oh yeah, that, too.
Chris
@crokita
Aug 02 2018 16:23
format those brackets!
Blauelf
@Blauelf
Aug 02 2018 16:24
Poor indentation, that's for sure. Makes searching for missing curly braces/square brackets/parentheses a pain in the rear end.
Chris
@crokita
Aug 02 2018 16:25
oh yeah, they're called braces
forgot the word
Nerando Johnson
@Nerajno
Aug 02 2018 16:26
thanks guys
Blauelf
@Blauelf
Aug 02 2018 16:27
@crokita I guess they are called in different ways everywhere. I'm going with the names I was told in an "English for scientists" class held by a Canadian. Luckily, none of those names contains a o/ou thingy.
Chris
@crokita
Aug 02 2018 16:28
Ah, lol
Brad
@bradtaniguchi
Aug 02 2018 16:42
good morning crusty crew
Chris
@crokita
Aug 02 2018 16:42
hello
Blauelf
@Blauelf
Aug 02 2018 16:53
Good evening person in another time zone.
Brad
@bradtaniguchi
Aug 02 2018 16:54
My time is the only time :P
Blauelf
@Blauelf
Aug 02 2018 16:56
All hail UTC! UTC FTW! (Who needs time zones, anyway?)
Brad
@bradtaniguchi
Aug 02 2018 17:01
times all relative anyways :p
Christopher McCormack
@cmccormack
Aug 02 2018 17:04
My time zone is best as we don't have DST
or the worst because everyone else for the most part does...
Brad
@bradtaniguchi
Aug 02 2018 17:06
DST is great when you get that extra sleep ahha
Simon Cordova
@gbsimon87
Aug 02 2018 17:10
Boys I'm out be safe
Brad
@bradtaniguchi
Aug 02 2018 17:13
see ya :D
abraham anak agung
@padunk
Aug 02 2018 17:14
Good night folks of the past :smile: i'm in the future now...1 day ahead
Christopher McCormack
@cmccormack
Aug 02 2018 17:25
@gbsimon87 @padunk see ya
May Kittens Devour Your Soul
@diomed
Aug 02 2018 17:37
darn those australians. always ahead of us
Jason Luboff
@JLuboff
Aug 02 2018 18:30
Meeting done. App goes live Monday
Christopher McCormack
@cmccormack
Aug 02 2018 18:33
nice job!
Brad
@bradtaniguchi
Aug 02 2018 18:40
nice, goodluck :D
Jason Luboff
@JLuboff
Aug 02 2018 18:44
@cmccormack Thanks...have a few changes to make today...and then a big change to make that'll take a little bit but otherwise, they were happy
Big change is the ability to upload multiple files instead of one..so..going to need to change the database a bit and my form... hmm
Christopher McCormack
@cmccormack
Aug 02 2018 18:44
That's a nice one to have
Jason Luboff
@JLuboff
Aug 02 2018 18:48
Ya... wish it would have been discussed prior but oh well I should be able to have things go live and switch afterwards
Brad
@bradtaniguchi
Aug 02 2018 18:51
time to boot up mr. webstorm, hopefully it can help with this refactor...
Jason Luboff
@JLuboff
Aug 02 2018 19:09
Guh...have to change some of my regex...oh how I hate and love you regex
oh...it was easy to change lol
Christopher McCormack
@cmccormack
Aug 02 2018 19:21
@JLuboff why hate regex!? it fills a need
Kudzu
@czhower
Aug 02 2018 19:21
For the same reason people dislike Perl. Its not the function, its the form they dont like.
Jason Luboff
@JLuboff
Aug 02 2018 19:22
Becuase it can get confusing...but... I actually only needed to change one character
From this /^[A-Z]{2}\d{4}$/i to this /^[A-Z]{5}\d{4}$/i
Milan Došljak
@milandosljak
Aug 02 2018 19:41
hello every1
i am new here :)
Kudzu
@czhower
Aug 02 2018 19:41
Welcome
Milan Došljak
@milandosljak
Aug 02 2018 19:42
how js goes for you my friend ?
Kudzu
@czhower
Aug 02 2018 19:43
I've been using it for 20+ years. Its more of a love/hate thing.
Milan Došljak
@milandosljak
Aug 02 2018 19:44
heeey , you are veteran :)
i am new , start learning about 6 month ago
some seriously js past 2 months
Brad
@bradtaniguchi
Aug 02 2018 19:46
@dosljakm nice :D
Milan Došljak
@milandosljak
Aug 02 2018 19:46
so i come here and go from start to refresh some things and see if i am missing something from
what are you learning now brad ?
Jason Luboff
@JLuboff
Aug 02 2018 19:47
That learning will never end
Milan Došljak
@milandosljak
Aug 02 2018 19:48
yeah , i notice that , i am learning every day something new , and its exciting :)
come here to refresh my understanding of basics and to see if i am missing some part of it
Jason , are you veteran too ?
Jason Luboff
@JLuboff
Aug 02 2018 19:50
No, wouldn't say so...been at it for couple years though
Milan Došljak
@milandosljak
Aug 02 2018 19:51
nice , keep it up :)
Jason Luboff
@JLuboff
Aug 02 2018 19:51
Thanks, you as well
Milan Došljak
@milandosljak
Aug 02 2018 19:52
i am going to finish some more tasks , just come here to see how this looks and to say hi :)
Simon Cordova
@gbsimon87
Aug 02 2018 20:13
@JLuboff how was the presentation?
Jason Luboff
@JLuboff
Aug 02 2018 20:43
@gbsimon87 Hey man, went well. Have a few changes to make but overall good. Going live on Monday
Brad
@bradtaniguchi
Aug 02 2018 20:54
@dosljakm Sorry I was slow, was out to lunch :D. Right now I'm working on learning how to test a typescript-express app, and refactor a huge codebase that was done very very sloppy haha
Jason Luboff
@JLuboff
Aug 02 2018 21:00
@bradtaniguchi Don't lie, you were taking a nap
Brad
@bradtaniguchi
Aug 02 2018 21:00
pssh I wish -_-
what the hell is the difference between mocha,chai, karma and jasmine! my head is spinning :(
Jason Luboff
@JLuboff
Aug 02 2018 21:01
All different testing suites, no?
Although...doesn't chai work hand in hand with mocha?
Brad
@bradtaniguchi
Aug 02 2018 21:05
Yea I've seen karma+jasmine, and mocha+chai, and I know karma is a test runner. But past that idk. (also there's jest, but that's the new guy)
Tiago Correia
@tiagocorreiaalmeida
Aug 02 2018 21:06
mocha provides testing functions, chai is an assertion library
also there's chai http to make http requests that you wanna test
probably there's better explanantions but.. im not sure I can give better haha
alpox
@alpox
Aug 02 2018 21:08
I just replaced karma+mocha+chai+sinon with jest (only) for the project at my workplace
Why 4 tools when you can have one that does the job the same as good :D
Brad
@bradtaniguchi
Aug 02 2018 21:08
to many damn tools :/
alpox
@alpox
Aug 02 2018 21:09
@bradtaniguchi thats why i use jest and stick with it :D not more needed!
Jason Luboff
@JLuboff
Aug 02 2018 21:09
If only I could understand how to setup tests lol
alpox
@alpox
Aug 02 2018 21:09
(except maybe something for DOM hooks)
Brad
@bradtaniguchi
Aug 02 2018 21:09
I'd move onto jest... but jest doesn't work with angular, thus I still need to know karma+jasmine
I was bashing my head for like an hour tweaking configs to get a "hello-world" test to run :/
alpox
@alpox
Aug 02 2018 21:09
Aha... Well i wouldnt program anfular anyways :x
Angular*
My personal preference is still React > Vue >... > Angular
But its the first time that I hear that jest doesnt work with angular still
Brad
@bradtaniguchi
Aug 02 2018 21:12
I guess it's something about some integration with angular's change detection or something
alpox
@alpox
Aug 02 2018 21:13
Ah interesting :o usually its not the testing tools which are responsible for those things though but rather some additional test tools
Brad
@bradtaniguchi
Aug 02 2018 21:13
wow mocha+chai worked with no config, nice :D
alpox
@alpox
Aug 02 2018 21:13
Like vue-test-utils for vue or enzyme for react
Brad
@bradtaniguchi
Aug 02 2018 21:13
yea idk, I mean angular-cli comes with karma+jasmine integration automatically. No idea how it works out with jest tho
alpox
@alpox
Aug 02 2018 21:13
Ah alright
Amgular is a pretty opinionated framework so i guess you better stick with the flow
Angular* (typing on the phone is hard)
Brad
@bradtaniguchi
Aug 02 2018 21:16
its good enof for me if its setup, but I've just setup 2 testing suites by hand right now. So far I like mocha+chai, no config :D
but I feel like I'm missing some things here... need to dig into configs :/
alpox
@alpox
Aug 02 2018 21:17
And the configs are back :D
Brad
@bradtaniguchi
Aug 02 2018 21:20
maybeeeee
and nope, all done in the npm script :sunglasses:
alpox
@alpox
Aug 02 2018 21:21
Nice :D
Brad
@bradtaniguchi
Aug 02 2018 21:35
wtf how do spys work in mocha+chai? Looks like I need another package, ug
Brad
@bradtaniguchi
Aug 02 2018 21:42
ug, I got chai-spies, but see there's a thing called 'sinon' hot damn
I'm very very close to just moving to jest...
Jason Luboff
@JLuboff
Aug 02 2018 21:55
Jest do it!
(I crack myself up sometimes)
Diego Mayer
@Chrono79
Aug 02 2018 22:02
Nike will sue you soon :P
Jason Luboff
@JLuboff
Aug 02 2018 22:25
Good thing I have no money!
Alex Coder
@jkid314159
Aug 02 2018 22:27
Hello
Christopher McCormack
@cmccormack
Aug 02 2018 22:28
@jkid314159 hiya
@JLuboff man you're sooooo funny
Alex Coder
@jkid314159
Aug 02 2018 22:28
I have a question about the content of the "Responsive Web Design Project - Build a Technical Documentation Page" . Does this have to be a page about coding?
Christopher McCormack
@cmccormack
Aug 02 2018 22:28
@jkid314159 nope!
Jason Luboff
@JLuboff
Aug 02 2018 22:28
@cmccormack I feel like you're mocking me here...but I'm going to let it slide
Christopher McCormack
@cmccormack
Aug 02 2018 22:29
check the user stories, I don't believe it requires it, and if it does, just code around it :)
Alex Coder
@jkid314159
Aug 02 2018 22:29
I want to have about rebuild an automobile engine Is this ok
Christopher McCormack
@cmccormack
Aug 02 2018 22:30
@jkid314159 yes if you check the user stories your main requirements aren't specific to coding
Alex Coder
@jkid314159
Aug 02 2018 22:30
I see I reread the document
Where can I post my page for review before submitting
@JLuboff TYVM
Christopher McCormack
@cmccormack
Aug 02 2018 22:31
@jkid314159 if it passes the tests and you want a review you can try the CodeReview or HelpFrontEnd or Help channels
Alex Coder
@jkid314159
Aug 02 2018 22:31
@cmccormack TYVM
I run the test and only get a white page with the text in background which is not visible
Sorry just saw this is the HelpJavaScript room
Thank you. bye