These are chat archives for FreeCodeCamp/HelpFrontEnd

3rd
Sep 2017
John
@AnonymousLords
Sep 03 2017 02:04 UTC
Guys how to center a button?
in the center of my page..
iso
@iso1048
Sep 03 2017 02:05 UTC
@AnonymousLords perhaps margin:auto
John
@AnonymousLords
Sep 03 2017 02:07 UTC
nope, didnt work :P
@gothamknight
Daniel
@DanJP2016
Sep 03 2017 02:08 UTC
are you using bootstrap?
iso
@iso1048
Sep 03 2017 02:08 UTC
@AnonymousLords do you want it horizontally or vertically centered?
John
@AnonymousLords
Sep 03 2017 02:09 UTC
uhhh
just in the middle of my page
Daniel
@DanJP2016
Sep 03 2017 02:10 UTC
can you give us the link if you have it on codepen?
iso
@iso1048
Sep 03 2017 02:13 UTC
@AnonymousLords style="text-align:center"
John
@AnonymousLords
Sep 03 2017 02:14 UTC
Got it :D @gothamknight it worked thanks
CamperBot
@camperbot
Sep 03 2017 02:14 UTC
anonymouslords sends brownie points to @gothamknight :sparkles: :thumbsup: :sparkles:
:cookie: 416 | @gothamknight |http://www.freecodecamp.com/gothamknight
Ismail Hozain
@ismailhozain
Sep 03 2017 02:35 UTC
hey guys i have an issue with https://codepen.io/ismailhozain/pen/OjvzaZmy weather app- how can i format the output and the individual entries.
hey guys i have an issue with my weather app- how can i format the output and the individual entries. https://codepen.io/ismailhozain/pen/OjvzaZ
Ken Haduch
@khaduch
Sep 03 2017 02:58 UTC
@ismailhozain - you are posting the link for the wikipedia viewer, but you said "weather app"?
@ismailhozain - the data that is returned consists of three arrays nested in the object. This link https://codebeautify.org/jsonviewer/cb7a7f39 shows the formatted JSON data for the search for "potato". You can just iterate over the arrays that are contained in that JSON data and select the title, the description and URL for the full article and generate some divs with the output for each article, style it as you'd like, and output it to the output div.
piteto
@piteto
Sep 03 2017 03:08 UTC
Is there a more concise way to use $.when for the twitch.tv app? I couldn't figure out how to access the response without the arguments object. https://codepen.io/anon/pen/xLBbjV?editors=0011
Ismail Hozain
@ismailhozain
Sep 03 2017 03:08 UTC
whoops sorry i typed the wrong thing
piteto
@piteto
Sep 03 2017 03:09 UTC
Ignore the ugly html and missing user stories - just thought I'd get it working for now
Also couldn't figure out how to group both channels + streams endpoint data without doing multiple $.when calls...
Ismail Hozain
@ismailhozain
Sep 03 2017 03:11 UTC
how would i address the arrays
piteto
@piteto
Sep 03 2017 03:12 UTC
I just did that one yesterday @ismailhozain I can take a look
@ismailhozain The data that comes back looks like this:
var array = [
  "search term",
  ["title1", "title2", "title3"],
  ["extract1", "extract2", "extract3"],
  ["url1", "url2", "url3"]
];
That's a simplified version, and your array goes up to 10 results
you need to loop through the array and use the .html() method in jQuery to add each piece of info
Ismail Hozain
@ismailhozain
Sep 03 2017 03:15 UTC
how do i address it? e.g. by name, by id by what?
piteto
@piteto
Sep 03 2017 03:15 UTC
@ismailhozain It's a 2d array
so, the first title would be array[1][0]
The first extract would be array[2][0]
I already learned how to access 2d arrays before, so don't know if free code camp teaches that - hope it makes sense
Ismail Hozain
@ismailhozain
Sep 03 2017 03:21 UTC
i am trying it out
```var array= array[1][0];
console.log(array);
piteto
@piteto
Sep 03 2017 03:24 UTC
the [0] part will change for each article
that should be an [i] in a for loop
for(var i = 0; i < info[1].length; i++) {
  console.log(info[1][i], info[2][i], info[3][i])
}
That shows the title, extract, url for each article
Ismail Hozain
@ismailhozain
Sep 03 2017 03:28 UTC
ok i copied that but how do i know if it is working
piteto
@piteto
Sep 03 2017 03:29 UTC
look at the console and you should see the info for each article listed
Ismail Hozain
@ismailhozain
Sep 03 2017 03:29 UTC
it is there
Ahmed raza
@Raza403
Sep 03 2017 06:44 UTC
Hi I need little help for twitch api project. I am unable to retrieve JSON as described in this link, can anyone help me doing it https://wind-bow.glitch.me/
change freecodecamp to the user you want to get json for
Ahmed raza
@Raza403
Sep 03 2017 06:49 UTC
How can I know user?
@piteto
piteto
@piteto
Sep 03 2017 06:50 UTC
["ESL_SC2", "OgamingSC2", "cretetion", "freecodecamp", "storbeck", "habathcx", "RobotCaleb", "noobs2ninjas"]
Is that what you mean?
Ahmed raza
@Raza403
Sep 03 2017 06:52 UTC
@piteto Yes thanks for helping me, I must have made some silly mistake otherwise I was trying the same
CamperBot
@camperbot
Sep 03 2017 06:52 UTC
raza403 sends brownie points to @piteto :sparkles: :thumbsup: :sparkles:
:cookie: 49 | @piteto |http://www.freecodecamp.com/piteto
piteto
@piteto
Sep 03 2017 06:53 UTC
Ahh, okay, happy to help! @Raza403
Trello Whoomer
@Trellowhoomer
Sep 03 2017 07:07 UTC

<!DOCTYPE html>

<html>
<head>
<title>Bootstrap Basics</title>
<link rel="stylesheet" type="text/css" href="bootstrap.css">
</head>
<body>

<nav class="navbar navbar-default"> </nav>

</body>
</html>

why navbar is not showing on the page?
iso
@iso1048
Sep 03 2017 07:10 UTC
@Trellowhoomer try <link href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-/Y6pD6FV/Vv2HJnA6t+vslU6fwYXjCFtcEpHbNJ0lyAFsXTsjBbfaDjzALeQsN6M" crossorigin="anonymous">
Trello Whoomer
@Trellowhoomer
Sep 03 2017 07:11 UTC
thnx.. but not working
same prob
nothing shows up
iso
@iso1048
Sep 03 2017 07:13 UTC
put content in the navbar
Trello Whoomer
@Trellowhoomer
Sep 03 2017 07:17 UTC
it does not matter. According to the bootstrap styling it should at least shown up as a light grey color navbar on the top without content too
iso
@iso1048
Sep 03 2017 07:49 UTC
give it a background color. then you will see it
Martialis39
@Martialis39
Sep 03 2017 08:10 UTC
hi all, i realise this is a big ask
but can anyone have a look at this code and help me spot why i have an infinite loop
ok I guess its too big for gitter : D
Hills
@Hillsie
Sep 03 2017 09:34 UTC
Hi there, could someone remind me how to float a div over and image. I am looking to have an image in the background. I’m using Semantic-ui to style my page.
heroiczero
@heroiczero
Sep 03 2017 09:35 UTC
@Hillsie try using z-index maybe
Hills
@Hillsie
Sep 03 2017 09:36 UTC
thanks @heroiczero
CamperBot
@camperbot
Sep 03 2017 09:36 UTC
hillsie sends brownie points to @heroiczero :sparkles: :thumbsup: :sparkles:
:star2: 1687 | @heroiczero |http://www.freecodecamp.com/heroiczero
heroiczero
@heroiczero
Sep 03 2017 09:37 UTC
could also use background-image
Hills
@Hillsie
Sep 03 2017 09:37 UTC
thats the one I think.
Ahmed raza
@Raza403
Sep 03 2017 11:26 UTC
Hi I need to solve little bug in my code of twitch api, I get json back from api, I try to put description of video as described in "User stories" but that is not being appended I have commented out this in code, You can also see it in "Inspect element" https://codepen.io/raza403/pen/qXgpwj
I am facing problem appending html paragraph using javascript here
Marius Nicolae
@bytao7mao
Sep 03 2017 12:00 UTC
guys, href doesn't work for redirection to a class, and it works only for id's ... does someone know a reason why ?
Ken Haduch
@khaduch
Sep 03 2017 12:15 UTC
@bytao7mao - ID values have to be unique - used only in one place, class values can be used wherever they are needed, so they can be used in multiple places. That means that you cannot reliably know that there is only one class. If ID values are used correctly, there should only be one instance, so it can be used to find that place in the document.
Marius Nicolae
@bytao7mao
Sep 03 2017 12:16 UTC
@khaduch yeah, i managed to fix that, i added some id's in my page :) thank you sir
CamperBot
@camperbot
Sep 03 2017 12:16 UTC
bytao7mao sends brownie points to @khaduch :sparkles: :thumbsup: :sparkles:
:star2: 3264 | @khaduch |http://www.freecodecamp.com/khaduch
Ahmed raza
@Raza403
Sep 03 2017 14:35 UTC
I have made twitch api project, kindly check it and give some comments/suggestions.
Rajat Khare
@rajatkhare619
Sep 03 2017 14:37 UTC
@Otto-AA Hey! Thank you! I'll try this. :smile:
CamperBot
@camperbot
Sep 03 2017 14:37 UTC
rajatkhare619 sends brownie points to @otto-aa :sparkles: :thumbsup: :sparkles:
:cookie: 387 | @otto-aa |http://www.freecodecamp.com/otto-aa
@Raza403 you should use that forEach i shared
instead of your for loop
and it will work
Ahmed raza
@Raza403
Sep 03 2017 15:50 UTC
@moT01 Ok thanks, I will do it
CamperBot
@camperbot
Sep 03 2017 15:50 UTC
raza403 sends brownie points to @mot01 :sparkles: :thumbsup: :sparkles:
:cookie: 838 | @mot01 |http://www.freecodecamp.com/mot01
CamperBot
@camperbot
Sep 03 2017 16:54 UTC
:bulb: to format code use backticks! ``` more info
Jen
@jenhurd8
Sep 03 2017 16:56 UTC
var joke;

$(document).ready(function(){  
    function getNewJoke(){
        $.ajax({
            url: 'https://api.icndb.com/jokes/random',
            data: {
                type: 'success',
                id: 'id',
                value: 'joke'
            },
        success: function(response){        
            joke = JSON.stringify(response.value.joke);
            //joke.replace(/&quot;/g,'"');
            //joke.replace("&quot;",/"/g);
            $('#quote').text(JSON.stringif(response.value.joke));
        }
        });
    }
I'm having issues replacing & quot; with actual quotation marks that are being returned from my API request inside the value of joke. Any ideas?
& quot ;
just1witness
@just1witness
Sep 03 2017 17:01 UTC
try joke.replace(/&quot/g, '";')
@jenhurd8
Jen
@jenhurd8
Sep 03 2017 17:01 UTC
thanks, ill try it
just1witness
@just1witness
Sep 03 2017 17:01 UTC
no problem
joke = joke.splice(1, joke.length);
piteto
@piteto
Sep 03 2017 17:05 UTC
@jenhurd8 json.stringify() will add the quotes for you with the .text() method as you have it. Or, you can use the .html() method and add them manually like:
    success: function(response) {
      $("#quote").html("&quot;" + response.value.joke + "&quot;");
    }
This is the same from what I see:
    success: function(response) {
      $("#quote").text(JSON.stringify(response.value.joke));
    }
Jen
@jenhurd8
Sep 03 2017 17:06 UTC
for some reason the stringify is not working, these are quotes within the quote that are the issue
piteto
@piteto
Sep 03 2017 17:07 UTC
@jenhurd8 You have stringif instead of stringify
missing the y in your code sample above
Jen
@jenhurd8
Sep 03 2017 17:07 UTC
its correct in the editor , just not showing on here for the stringify
you want to replace the quotes with quotes? ... what happens if you just do .html(joke) ?
the quotes arent there?
piteto
@piteto
Sep 03 2017 17:10 UTC
$("#quote").text(JSON.stringify(response.value.joke)); // "Chuck Norris speaks Braille."
$("#quote").html("&quot;" + response.value.joke + "&quot;"); // "Chuck Norris speaks Braille."
$("#quote").text(response.value.joke); // Chuck Norris speaks Braille.
Those are the responses I see when I run your code
Jen
@jenhurd8
Sep 03 2017 17:11 UTC

"Chuck Norris does not &quot;style&quot; his hair. It lays perfectly in place out of sheer terror."
this is the problem i am having that is within the quote
ill keep trying the suggestions above
piteto
@piteto
Sep 03 2017 17:12 UTC
Ahhhhh, use .html() instead of .text() and those &quot; HTML entities will show up as quotes
Jen
@jenhurd8
Sep 03 2017 17:12 UTC
oooooo
piteto
@piteto
Sep 03 2017 17:12 UTC
$("#quote").html("&quot;" + response.value.joke + "&quot;");
Jen
@jenhurd8
Sep 03 2017 17:13 UTC
ok
piteto
@piteto
Sep 03 2017 17:14 UTC
those quotes are funny
Jen
@jenhurd8
Sep 03 2017 17:14 UTC
they always crack me up
piteto
@piteto
Sep 03 2017 17:14 UTC
Google won't search for Chuck Norris because it knows you don't find Chuck Norris, he finds you.
Jen
@jenhurd8
Sep 03 2017 17:14 UTC
it worked @piteto !!!
thank you @piteto
CamperBot
@camperbot
Sep 03 2017 17:15 UTC
jenhurd8 sends brownie points to @piteto :sparkles: :thumbsup: :sparkles:
:cookie: 50 | @piteto |http://www.freecodecamp.com/piteto
piteto
@piteto
Sep 03 2017 17:15 UTC
Chuck Norris would be proud. Roundhouse kick to those quotes
Jen
@jenhurd8
Sep 03 2017 17:15 UTC
hahaha
love it
""It works on my machine" always holds true for Chuck Norris."
thanks again, signing off
just1witness
@just1witness
Sep 03 2017 17:18 UTC
My childhood friend subjected me to Chuck Norris marathons when I would visit her...
imperial-isms
@imperial-isms
Sep 03 2017 17:24 UTC
Hi, all…can someone help me verify if I’m going crazy? If I’m trying to determine whether "1 eye for of 1 eye.” is a palindrome, and I’m eliminating all puncs, spaces, and digits…what am I missing here?
Why should “eyeforofeye” return false, if I’m testing a palindrome?
Trying not to go straight for the solution
piteto
@piteto
Sep 03 2017 17:26 UTC
a palindrome can include digits
that's why this is false: 1 eye for of 1 eye. Remove punctuation and spacing, then it becomes: 1eyeforof1eye
imperial-isms
@imperial-isms
Sep 03 2017 17:28 UTC
Oh…my mistake, I just read non-alphanumeric as not including digits
Derp
Thanks @piteto
CamperBot
@camperbot
Sep 03 2017 17:28 UTC
imperial-isms sends brownie points to @piteto :sparkles: :thumbsup: :sparkles:
:cookie: 51 | @piteto |http://www.freecodecamp.com/piteto
piteto
@piteto
Sep 03 2017 17:29 UTC
That assignment was a little tricky - I always thought a palindrome included punctuation...until I did that one
just1witness
@just1witness
Sep 03 2017 17:30 UTC
Make two arrays, one with the str, having all the characters removed, then that same one, just reversed and compare. Makes it simple
imperial-isms
@imperial-isms
Sep 03 2017 17:31 UTC
solved it
I just needed to include digits
just1witness
@just1witness
Sep 03 2017 17:32 UTC
:)
piteto
@piteto
Sep 03 2017 17:33 UTC
Only one array is needed for the reverse, then compare strings
str = str.toLowerCase().replace(/\W|_/g, '');
return str == str.split('').reverse().join('');
That's how I did it at least
just1witness
@just1witness
Sep 03 2017 17:34 UTC
Yeah, I'm visualizing the original str array as the first one. I think that's what I did.
imperial-isms
@imperial-isms
Sep 03 2017 17:40 UTC
I split the string into an array and iterated through each value testing for letter and digit ranges. I had trouble with regex and accounting for #%* etc.
What's the regex for non-alphanumeric?
just1witness
@just1witness
Sep 03 2017 17:41 UTC
Yeah, regex can be puzzling. have you seen this? http://regexr.com/
play with that and you'll get it in no time
imperial-isms
@imperial-isms
Sep 03 2017 17:44 UTC
thanks for the resource…I went through this one: https://regexone.com
That’s a helpful resource you just shared
just1witness
@just1witness
Sep 03 2017 17:46 UTC
With the one I shared, you can copy and paste your code into the text box and troubleshoot with the regex until you get the matches you need
I found it very helpful myself :)
imperial-isms
@imperial-isms
Sep 03 2017 17:46 UTC
What does “_” do?
I don’t see it in the reference
Nevermind.
Markus Kiili
@Masd925
Sep 03 2017 17:48 UTC
@imperial-isms Targets the underscore character _.
imperial-isms
@imperial-isms
Sep 03 2017 17:48 UTC
Yeah…went right over my head at first
Doreen Lu
@ThoughtProvoking
Sep 03 2017 18:03 UTC
Hello,
Can anyone tell me why Scrollspy isn't working on this codepen? https://codepen.io/ThoughtProvoking/pen/dzajyL
Nevermind...I got it.
hifede
@hifede
Sep 03 2017 19:25 UTC
hiya! could someone tell me why my full page view isnt fitting my phone screen? https://codepen.io/arolf_flora/full/WEoYmd
thank you
Adinarayana Raghu
@adinarayaanraghu95
Sep 03 2017 19:37 UTC
Hey.
Can someone help me with a plain wordpress theme which will centre any content i post?
Jake
@JakeDVirus
Sep 03 2017 19:48 UTC

Below is the code from pluralsight tutorial which let me dwell in a confusion.
As far as i know

$(function() { ... }); is equivalent to $(document).ready(function() { ... });

So why in the 2nd line of the code there is another $(function(){});

$(document).ready(function() {
$(function(){
  $('#showPhoneNav').click(function() {
    $("#myNav").slideToggle('normal',function(){ //Shows Nav area
    if ($('#myNav').is(':visible')) {
        $('#showPhoneNav').text('Hide Navigation');
    } else {
        $('#showPhoneNav').text('Show Navigation');
    } //end of if
    }); //end of slidetoggle
  }); //end of myNav
}); //end showPhoneNav
}); //end of ready
piteto
@piteto
Sep 03 2017 20:28 UTC
@hifede Your rows aren't all in containers
just1witness
@just1witness
Sep 03 2017 20:51 UTC
Please please please disregard the terrible shape this code is in right now, it's like a pile of dirty laundry, I know. I am puzzled as to why when I click a link, it opens a blank page. If I copy and paste the address from that blank page into the browser of a new tab, it works. What's up with that?
https://codepen.io/Just1witness/pen/KvXdRj?editors=1111
iso
@iso1048
Sep 03 2017 20:53 UTC
@just1witness the links work fine for me
just1witness
@just1witness
Sep 03 2017 20:53 UTC
huh. What browser are you using?
iso
@iso1048
Sep 03 2017 20:53 UTC
chrome
Jake
@JakeDVirus
Sep 03 2017 20:53 UTC
@piteto but that is not commented out in the original code shown. well it might be shown up as a typo in the latter part in the tutorial
the else statement is not working. Also after the first click event the if statement is not working too.
what i am doing wrong here
$(document).ready(function() {
    var showPhoneNav = $("#showPhoneNav");
    showPhoneNav.on("click", function(e){
        $("#myNav").slideToggle(function(){
            if(showPhoneNav.text("Show Navigation")){
                showPhoneNav.text("Hide Navigation");
            } else {
                showPhoneNav.text("Show Navigation");
            }
        });
    }) //end of ShowPhoneNav's .on()
});
just1witness
@just1witness
Sep 03 2017 20:56 UTC
Maybe it's FF, wouldn't be the first time. @gothamknight
iso
@iso1048
Sep 03 2017 20:57 UTC
@just1witness in the past, the twitch website took a while to load...maybe it is a combination of the two
just1witness
@just1witness
Sep 03 2017 20:57 UTC
Oh, thank you, I'm going to check that, it might be it
@gothamknight ty
CamperBot
@camperbot
Sep 03 2017 20:58 UTC
just1witness sends brownie points to @gothamknight :sparkles: :thumbsup: :sparkles:
:cookie: 417 | @gothamknight |http://www.freecodecamp.com/gothamknight
iso
@iso1048
Sep 03 2017 20:58 UTC
good luck
just1witness
@just1witness
Sep 03 2017 20:58 UTC
Thank you
piteto
@piteto
Sep 03 2017 20:59 UTC
@NeelDVirus Do you have a live demo to debug?
Jake
@JakeDVirus
Sep 03 2017 21:00 UTC
@piteto Just a sec. going to update in codepen and will drop the link here
piteto
@piteto
Sep 03 2017 21:03 UTC
What is the best practice for making all of these API calls in the twitch.tv app?
As I found out yesterday, a promise chain is nice and clean, unless their is a failure
nested API calls inside a loop seems like a bad practice as it will take much longer to get all the results
Jake
@JakeDVirus
Sep 03 2017 21:07 UTC

@piteto This is the codepen link here of the quirk i mentioned just now.
Ignore the black bullet point shown in the navigation. it just happened while copy-pasting the code to codepen.

https://codepen.io/neel111/pen/EvMmgZ

piteto
@piteto
Sep 03 2017 21:08 UTC
I see it's getting stuck on "hide navigation"
just1witness
@just1witness
Sep 03 2017 21:10 UTC
Oh, I am very bad at this right now, haha. I've been putting off the projects, I'm so much better at the algo's... Now all I have left is projects
@piteto
iso
@iso1048
Sep 03 2017 21:10 UTC
@NeelDVirus if(showPhoneNav.text() =="Show Navigation")
just1witness
@just1witness
Sep 03 2017 21:10 UTC
I have no clue what a promise chain is
@piteto
piteto
@piteto
Sep 03 2017 21:11 UTC

@NeelDVirus

    $("#myNav").slideToggle(function() {
      if (showPhoneNav.text() == "Show Navigation") {
        showPhoneNav.text("Hide Navigation");
      } else {
        showPhoneNav.text("Show Navigation");
      }
    });

That code you got has a bug

oh, batman beat me to it
Siddarth Krishnan
@siddarthk123
Sep 03 2017 21:11 UTC
can anyone
help me solve the least common multiple challenge?
please?
Jake
@JakeDVirus
Sep 03 2017 21:12 UTC
@piteto @gothamknight Oh Fish i interpreted in the wrong way. i should use some different condition in if statement. Damn :D
iso
@iso1048
Sep 03 2017 21:12 UTC
@NeelDVirus but you will need to change the text in the html to "Hide Navigation"
Jake
@JakeDVirus
Sep 03 2017 21:13 UTC
@siddarthk123 send the link. if anyone can then he/she will
piteto
@piteto
Sep 03 2017 21:13 UTC
@just1witness a promise is a way for javascript to go do something that takes a while and "promise" to give you the data later. A promise chain is a bunch of promises all running at once and giving you data back as each of them finishes.
just1witness
@just1witness
Sep 03 2017 21:14 UTC
huh @piteto
Oh! before I forget @piteto Thank you! :)
CamperBot
@camperbot
Sep 03 2017 21:14 UTC
just1witness sends brownie points to @piteto :sparkles: :thumbsup: :sparkles:
:cookie: 52 | @piteto |http://www.freecodecamp.com/piteto
piteto
@piteto
Sep 03 2017 21:14 UTC
@just1witness getJSON has promises built in
$.getJSON(url).done(function(data) {
    // promise to give me the data when you're done getting it from the URL
})
just1witness
@just1witness
Sep 03 2017 21:14 UTC
@siddarthk123 Do you get filters now?
iso
@iso1048
Sep 03 2017 21:15 UTC
@piteto I do not know what a promise is either. Does that mean any success function or .done() in an ajax call is a promise?
just1witness
@just1witness
Sep 03 2017 21:15 UTC
Aren't all my JSON calls promises, I have .done on them
didn't know why, but it's what I saw working
piteto
@piteto
Sep 03 2017 21:16 UTC
well, it's jQuery's way of doing promises it seems. I'm new to them with jQuery. In vanilla JS, you just build a Promise() object
iso
@iso1048
Sep 03 2017 21:17 UTC
so is a promise inherently asynchronous then?
Siddarth Krishnan
@siddarthk123
Sep 03 2017 21:17 UTC
yeah
i get filters now.
piteto
@piteto
Sep 03 2017 21:17 UTC
yeah, that's why we use them in JS. For Twitch, you can call the api for all the streamers at the same time
Siddarth Krishnan
@siddarthk123
Sep 03 2017 21:17 UTC
just1witness
ca you help me on another programming problem
piteto
@piteto
Sep 03 2017 21:18 UTC
if we loop through and call them one at a time, then it's a little slower
Siddarth Krishnan
@siddarthk123
Sep 03 2017 21:18 UTC
can you help me on....
finding least common multiple?
just1witness
@just1witness
Sep 03 2017 21:18 UTC
@siddarthk123 Yup, please share what you've done so far
iso
@iso1048
Sep 03 2017 21:19 UTC
@piteto how do you make the api calls at the same time?
i do not have anything so fa
r
piteto
@piteto
Sep 03 2017 21:19 UTC
@gothamknight you put all of your API calls in an array and then use Promise.all() to process them all at once
Siddarth Krishnan
@siddarthk123
Sep 03 2017 21:19 UTC
can you give me a starting point
and ill go from there.
just1witness
@just1witness
Sep 03 2017 21:20 UTC
k, give me a sec
piteto
@piteto
Sep 03 2017 21:20 UTC
Or, in jQuery, it's $.when()
This is an example with jQuery's way of doing it: https://codepen.io/anon/pen/xLBbjV?editors=0011
but....the problem is, if one api call fails, everything blows up and you get nothing...
and it seems like with jQuery, it's a lot of work to prevent that from happening
just1witness
@just1witness
Sep 03 2017 21:22 UTC
@siddarthk123 start by creating variables to determine your min and max values, in the array your working with.
Siddarth Krishnan
@siddarthk123
Sep 03 2017 21:22 UTC
ok
then?
iso
@iso1048
Sep 03 2017 21:23 UTC
@piteto far out your code is so succinct.
piteto
@piteto
Sep 03 2017 21:23 UTC
I don't like the look of jQuery to be honest...
Thought I would try to do one project with it, but I'm giving up on it
Siddarth Krishnan
@siddarthk123
Sep 03 2017 21:23 UTC
how do i find the min and the max?
values?
iso
@iso1048
Sep 03 2017 21:24 UTC
@piteto do you prefer vanilla, or a framework?
Siddarth Krishnan
@siddarthk123
Sep 03 2017 21:24 UTC
what do i do after creating the min and the max?
piteto
@piteto
Sep 03 2017 21:24 UTC
I use vanilla, but want to get into Node.js
just1witness
@just1witness
Sep 03 2017 21:24 UTC
Look up Math.min() and Math.max() on google
piteto
@piteto
Sep 03 2017 21:24 UTC
found out I have to do front end to get to back end here, so running through this stuff quickly for now
iso
@iso1048
Sep 03 2017 21:25 UTC
@piteto i need to learn vanilla properly. I am wanting to read a book on it but have not had the time yet.
piteto
@piteto
Sep 03 2017 21:25 UTC
If you know jQuery, it is basically the same, just more looping and less dollar signs
just1witness
@just1witness
Sep 03 2017 21:26 UTC
If you want to really understand these algorithms, watch MR Snow's you tube tutorials, he's an excellent teacher. Just try to do it on your own first, you learn the best that way. @siddarthk123
iso
@iso1048
Sep 03 2017 21:26 UTC
true. do you know react, angular or other frameworks?
piteto
@piteto
Sep 03 2017 21:26 UTC
vanilla js returns html collections when you don't use IDs - slightly different method names like innerHTML instead of .html()
Siddarth Krishnan
@siddarthk123
Sep 03 2017 21:26 UTC
just1witness
i created a min and a max.
piteto
@piteto
Sep 03 2017 21:26 UTC
Just enough to get by, but I want to move away from front end
Siddarth Krishnan
@siddarthk123
Sep 03 2017 21:26 UTC

function smallestCommons(arr) {

var maxArray = Math.max(...arr);

var minArray = Math.min(...arr);

}

smallestCommons([1,5]);

iso
@iso1048
Sep 03 2017 21:26 UTC
yeah I kind of know those basics but do not really use them - I am just sticking to jQuery at the moment
Siddarth Krishnan
@siddarthk123
Sep 03 2017 21:27 UTC
what do i do next?
iso
@iso1048
Sep 03 2017 21:28 UTC
@piteto i have to head off. Thanks for all the information.
CamperBot
@camperbot
Sep 03 2017 21:28 UTC
gothamknight sends brownie points to @piteto :sparkles: :thumbsup: :sparkles:
:cookie: 53 | @piteto |http://www.freecodecamp.com/piteto
piteto
@piteto
Sep 03 2017 21:28 UTC
Yeah, no problem, I might have to ask you for jQuery help if we run into any challenges that require it :)
Spent last week learning it only to abandon it for now
Siddarth Krishnan
@siddarthk123
Sep 03 2017 21:29 UTC
just1witness
can you tell me
what to do next?
just1witness
@just1witness
Sep 03 2017 21:32 UTC
Trying to share the link without the giant vid preview...
copy and paste that @siddarthk123
Siddarth Krishnan
@siddarthk123
Sep 03 2017 21:34 UTC
its
not
not.....
woring
working
the link
Lance
@texas2010
Sep 03 2017 21:36 UTC
@siddarthk123 dude. you need to write message once before you send. it you do that repeat. we will think you want to flood this chat. flood the chat is not allow.
that is why i trying to tell you. please write message once before you send...
it seems you dont know how to do that.
Maria Theresa Arruda
@arrudamt
Sep 03 2017 21:38 UTC
hello guys!
Lance
@texas2010
Sep 03 2017 21:40 UTC
@siddarthk123 if you still do that to everyone. people will lose respect to you. that is why they ignore you a lot. because you did ignore their advice a lot
Maria Theresa Arruda
@arrudamt
Sep 03 2017 21:44 UTC
does anyone have experience wity bootcamp here?
Lance
@texas2010
Sep 03 2017 21:49 UTC
@siddarthk123, let you know i am freecodecamp moderator. okay
Jan Shah
@JanShah
Sep 03 2017 21:50 UTC
@arrudamt i've heard good stories about bootcamps.
Maria Theresa Arruda
@arrudamt
Sep 03 2017 21:51 UTC
@JanShah can you tell me more?
LydaTech
@lydatech
Sep 03 2017 21:52 UTC
@siddarthk123 you here?
Jan Shah
@JanShah
Sep 03 2017 21:54 UTC
very intensive courses, costly but a lot of positive results for participants. If you have reasonable coding experience already it I think it can really help you make fast progress and get a job quicker
@arrudamt
but it's a big upfront cost so choose your bootcamp carefully
Maria Theresa Arruda
@arrudamt
Sep 03 2017 21:55 UTC
@JanShah yeah, i could see that
@JanShah i'm having problems with the div element, any suggestion?
Jan Shah
@JanShah
Sep 03 2017 21:56 UTC
@arrudamt I can try
LydaTech
@lydatech
Sep 03 2017 21:57 UTC
@siddarthk123 I sent you a PM you need to respond to
LydaTech
@lydatech
Sep 03 2017 22:09 UTC
@siddarthk123 Once again check your PM!
Roxroy
@roxroy
Sep 03 2017 22:11 UTC
@rafaelmonroy , showCelcius, is a boolean variable. Which means the possible values are true of false.
the statement showCelcius = !showCelcius; flips the value to true if it is false, or to false if it is true. it is the same a if (showCelcius== false) showCelcius = true else showCelcius = false
hifede
@hifede
Sep 03 2017 22:24 UTC
@piteto thank you. could you please give me an example?
CamperBot
@camperbot
Sep 03 2017 22:24 UTC
hifede sends brownie points to @piteto :sparkles: :thumbsup: :sparkles:
:cookie: 54 | @piteto |http://www.freecodecamp.com/piteto
Georgi Yudin
@gyudin
Sep 03 2017 23:42 UTC
Hey, guys! Do you know any worthwhile bootcamps for front-end engineers?