These are chat archives for FreeCodeCamp/Help

27th
Sep 2017
Donnie
@Donnie-D
Sep 27 2017 00:00
@Gersho sorry if I am being incredibly thick but how do I find a quote API?
@Gersho or is quote API something I have to create?
you COULD create one, but that is not the point of this challenge (that back-end stuff, for later ^^)
that's the one i used, it even explains how to operate it you should be fine
and i had found it googling for "keyless quote api" (keyless means it does not need a key)
Donnie
@Donnie-D
Sep 27 2017 00:06
@Gersho yes I tried to google for quotes online and all I got was tons of quotes photographs on many sources I clicked on which got me thinking how would I do this challenge?
Griffin Novetsky
@GriffinN
Sep 27 2017 01:26

Having trouble with 24 (anchor text). link won’t show up

<link href="https://fonts.googleapis.com/css?family=Lobster" rel="stylesheet" type="text/css">

<style>
.red-text {
color: red;
}

h2 {
font-family: Lobster, Monospace;
}

p {
font-size: 16px;
font-family: Monospace;
}

.thick-green-border {
border-color: green;
border-width: 10px;
border-style: solid;
border-radius: 50%;
}

.smaller-image {
width: 100px;
}
</style>

<h2 class="red-text">CatPhotoApp</h2>

<img class="smaller-image thick-green-border" src="https://bit.ly/fcc-relaxing-cat" alt="A cute orange cat lying on its back. ">

<p> Here's a a href="http://freecatphotoapp.com" cat photos</a> for you to follow.</p>

<p class="red-text">Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.</p>
<p class="red-text">Purr jump eat the grass rip the couch scratched sunbathe, shed everywhere rip the couch sleep in the sink fluffy fur catnip scratched.</p>

nor will the actual text
piteto
@piteto
Sep 27 2017 01:35
@GriffinN You're missing the < and > around your anchor element
Darren
@DarrenfJ
Sep 27 2017 04:09
evening fCC
@DevKosov shady's back!
@ericmiller777 in terms of abandonware.. yah , i hear yah.. but there's still so many people/projects that run on slack.. gitter seems better than slack to me tbh
Gersho
@Gersho
Sep 27 2017 04:14
@DarrenfJ :wave:

@ericmiller777 in terms of abandonware.. yah , i hear yah.. but there's still so many people/projects that run on slack.. gitter seems better than slack to me tbh

you can't go changing people habit's every 2 years, honestly if i could i'd still be using MSN messenger

or even icq, i liked that one
Kyle Holm
@thekholm80
Sep 27 2017 04:18
IRC
i miss IRC
Gersho
@Gersho
Sep 27 2017 04:18
it was nice, but i don't know why, i don't really miss that
i used it a couple weeks ago
Albert Cardona II
@daddycardona
Sep 27 2017 04:54
@thekholm80 IRC was nice :)
I am about to go to sleep :)
Emmanuel Akodia
@akodiaemma
Sep 27 2017 05:03
@Gersho can i privae message you ... pelase
please
i have understood call back functions kind of..but in this code,..what exactly do i have to call back
                    var input = Apperyio('result');

                   var word = input.val();

                    var number = word.match(/\d{10}/);

                    var res = parseInt(number);


                    function sendData() {
                     $.post( "app.php", { res: res} );
                       }

                       //sendData();

                    if (sendData()){

                    return 1;
                    }else {
                     return 0;
                    }
Gersho
@Gersho
Sep 27 2017 05:06
i don't see anything wrong with asking in the chat
let's see
Emmanuel Akodia
@akodiaemma
Sep 27 2017 05:08
@Gersho ignore that.. here is the actual code. sorry for the confusion
var input = Apperyio('result');

var word = input.val();

                    var number = word.match(/\d{10}/);

                    var res = parseInt(number);


                    function sendData() {
                     $.post( "http://www.expo2017.ug/app.php", { res: res} );
                       }

                       sendData();

                    if (sendData()){

                    alert('Message sent');
                    }else {
                     alert('Registered');
                    }
Gersho
@Gersho
Sep 27 2017 05:08
ok so jQuery.post( url [, data ] [, success ] [, dataType ] )
Emmanuel Akodia
@akodiaemma
Sep 27 2017 05:09
yes
correct
Gersho
@Gersho
Sep 27 2017 05:09
data is { res: res}
Emmanuel Akodia
@akodiaemma
Sep 27 2017 05:09
yes
correct
Gersho
@Gersho
Sep 27 2017 05:09
so after that, you need another comma ,
and this is where you will put the code you want to run when the info comes back
Emmanuel Akodia
@akodiaemma
Sep 27 2017 05:10
{ res: res},code
do u mean this
Gersho
@Gersho
Sep 27 2017 05:10

because this:


                       sendData();

                    if (sendData()){

this will NOT wait for the data to come back, so it won't work

{ res: res},code
yes
Emmanuel Akodia
@akodiaemma
Sep 27 2017 05:10
i fuckin love you bro
let me give it a shot
Gersho
@Gersho
Sep 27 2017 05:11
should look something like
$.post( "ajax/test.html", {res: res}, function( data ) {
  //do something with that data (the variable data will be what you recieved from the call)
});
Emmanuel Akodia
@akodiaemma
Sep 27 2017 05:13
                    function sendData() {
                     $.post( "app.php", { res: res},sendData());
                       }



                    if (sendData()){

                    alert('Message sent');
                    }else {
                     alert('Registered');
                    }
that is the change..i believe it works like this
Gersho
@Gersho
Sep 27 2017 05:14
no before when you run sendData, when receiving data it will recall sendData
i don't know exactly what you're trying to do but i think it should be something like
   function sendData() {
                     $.post( "app.php", { res: res},  function(data){
                     //do something with the data you received
                       if (data????){ 

                    alert('Message sent');
                    }else {
                     alert('Registered');
                    }

});

}
Emmanuel Akodia
@akodiaemma
Sep 27 2017 05:18
@Gersho what does the function(data) stand for...its not defined in my code. the code is supposed to send res data to the app.php file and return messgae sent if successful
and registered if failed. im sorry if im kinda tiring u out but if u only cud help me understand this
Gersho
@Gersho
Sep 27 2017 05:20
function(data) is an anonymous function (since it has no name) and data stands for what you have received from the call (this is why .post accepts a function callback )

in that case try

   function sendData() {
                     $.post( "app.php", { res: res},  function(data){
                     //do something with the data you received
                      console.log(data);

});

}

try it twice (one where it works, one where it doesn't) so you know what to expect from it, and then you work your "if" around it, for exemple let's say it answers "OK" on success(so data="OK")

    if (data="OK"){ 
                    alert('Message sent');
                    }else {
                     alert('Registered');
                    }
hope i worded it in a way that makes sense
Emmanuel Akodia
@akodiaemma
Sep 27 2017 05:23
yes it makes sense... a lot of sense actually
let me understand then implement this
Gersho
@Gersho
Sep 27 2017 05:24
console.log is your best friend for this kind of stuff, you can check step by step what is going on
Emmanuel Akodia
@akodiaemma
Sep 27 2017 05:25
alright then.. thank you very much @Gersho
CamperBot
@camperbot
Sep 27 2017 05:25
akodiaemma sends brownie points to @gersho :sparkles: :thumbsup: :sparkles:
:cookie: 473 | @gersho |http://www.freecodecamp.com/gersho
Emmanuel Akodia
@akodiaemma
Sep 27 2017 05:29
@Gersho its fuckin worked well bro.... ur the saviour and should replace superman
Gersho
@Gersho
Sep 27 2017 05:31
lol
Mike Batista
@mbmontana
Sep 27 2017 05:42
I know what the problem is here I just don't know how to fix it. The Caesars Cipher challenge, I have to return this string and change each letter to the letter that's 13 spots away in the alphabet. It should return "FREE PIZZA!" but right now I'm just returning the F. Any hints (without spoilers) on how I fill the fromCharCode parentheses so that it acts on each letter in the string?
function rot13(str) { // LBH QVQ VG!
  for (var i = 0; i < str.length; i++) {

  var num =  str.charCodeAt(i);

      if (num >= 65 && num <=77) {
        num = num + 13;
      }

    if (num >= 78 && num <=90) {
      num = num - 13;


   return String.fromCharCode(num);}
  }
}

// Change the inputs below to test
rot13("SERR CVMMN!");
Gersho
@Gersho
Sep 27 2017 05:46
let's see
your return is inside the loop
so on the first loop, return is called and the rot13 function stops
since you don't want too much hints, i'll say that you need to somehow stock up the results you get at each loop, and return it only after you're done
@mbmontana
Mike Batista
@mbmontana
Sep 27 2017 05:50
@Gersho Was it a bad idea to declare the num variable? When I moved the return outside the for loop, I got an error message saying num was used out of scope.
Gersho
@Gersho
Sep 27 2017 05:53
hmm, keeping the logic of your code, you need num, you use it at the start, modify depending and it's value, then make use of if (that last part is not ready in your code) , then the loop goes back to the top, when you are done with all your loops, you shouldn't need num anymore
you'll need another variable, to stock the result you obtained at each oitteration of the loop

oh by the way there's an error logic in your if,
if num = 75
first if is True
num+13 => 88
second if is True
nul-13=>75

you'll want to add an else

Mike Batista
@mbmontana
Sep 27 2017 06:04
@Gersho ok i'll work on that tomorrow. 2 a.m. here on the East Coast of the US
Gersho
@Gersho
Sep 27 2017 06:06
same here ^^
well same timzone at least
Darren
@DarrenfJ
Sep 27 2017 06:10

@Gersho hi buddy.. and i agree

@ericmiller777 in terms of abandonware.. yah , i hear yah.. but there's still so many people/projects that run on slack.. gitter seems better than slack to me tbh

you can't go changing people habit's every 2 years, honestly if i could i'd still be using MSN messenger

Gersho
@Gersho
Sep 27 2017 06:12
yo, still trying to make sense of react :P
Darren
@DarrenfJ
Sep 27 2017 06:13
ha!
yah.. me two
Gersho
@Gersho
Sep 27 2017 06:14
tried to make it fancy by dividing it in multiple component, and now i'm fighting with scope problems
managed to make good progress but i have some obvious bugs
Gersho
@Gersho
Sep 27 2017 06:44
ok my brain has officially given up, cya tomorrow !
Emmanuel Akodia
@akodiaemma
Sep 27 2017 06:47
@Gersho hahaha eventually it had to

var input = Apperyio('result');

var word = input.val();

                var number = word.match(/\d{10}/);

                var res = parseInt(number, 10);

function sendData() {
$.post( "app.php", { res: res}, function(data){
//do something with the data you received
if (data){

                alert('Message sent');
                }else {
                 alert('failed');
                }

});

}

    var newNumbers = res.toString();
                               //this is the variabloe changed to string
    var numbers = ['753741631','2345654356','772556647'];

                //this is the length of the array

                    for(var i = 0; i < numbers.length; i++) {


                    // var numbersLength = numbers.length;
                     if (newNumbers != numbers[i]){ 
                      sendData();

                     }
                     else{alert('user already in the event');}




                 }

someone tell me why this code says user already when i put a number in the array,..then later says message sent
wtf
_

刘俊波
@cutemeeting
Sep 27 2017 07:15

字号是由样式属性font-size来控制的, 如下:

h1 {
font-size: 30px;
}
用下面的文本来创建第二个p元素:
养动物有的时候,就是介于爱与恨之间,当你钦羡别人萌宠这么可爱的时候,你一定没有想过,狗狗和猫猫会到处拉屎,甚至会屯老鼠,啃鞋子,用爪子爬门,你不理它,它就挠你,你要对它发脾气,它会比你更来劲。所以,狗猫慎入,没有一定的准备,切勿随便去侍养动物。它们一旦认定你了,你就是它们的主人,如果你抛弃它们,它们必定心中重创。

任务:让第一个段落和第二个段落的font-size都为16px。

请不要为第二个段落添加 class 属性。

不会走了
怎么弄??让第一个段落和第二个段落的font-size都为16px。
Emmanuel Akodia
@akodiaemma
Sep 27 2017 08:47
                    var res = parseInt(number, 10);


   function sendData() {
                     $.post( "app.php", { res: res},  function(data){
                     //do something with the data you received
                       if (data){ 

                    alert('Message sent');
                    }else {
                     alert('failed');
                    }

});

}

        var newNumbers = res.toString();
                                   //this is the variabloe changed to string
        var numbers = ['753741631','2345654356','772556647'];

                    //this is the length of the array

                        for(var i = 0; i < numbers.length; i++) {


                        // var numbersLength = numbers.length;
                         if (newNumbers != numbers[i]){ 


                             //numbers.push(newNumbers);

                             sendData();

                         }
                         else{alert('user already in the event');}




                     }
someone tell me why when i put a number in the array, i get useralready exists then it also shows message sent
im new to javascript and call back functions, if you could change the code for me,..i might understand better
Edward
@edwardlys
Sep 27 2017 10:01

@akodiaemma your for loop is trying to loop through all the numbers your have in the array called numbers to match with newNumbers.
If you take step by step, when newNumber tries to match with numbers[0] , and if it does not exists, then it will do sendData(). But unfortunately, the loop does not stop there, it continues to match newNumber with numbers[1] which again does not match, then it will again do sendData(). Finally if it matches something in your numbers array, then it will give alert user already in the event.

I have included a small solution below. Its not the best solution. I am new too. But I hope it answers your question

var isFound =true;
for(var i = 0; i < numbers.length; i++) {
if (newNumbers != numbers[i]){
isFound = false;
}
}

if( isFound ) {
alert('user already in the event');
} else {
sendData();
}

Emmanuel Akodia
@akodiaemma
Sep 27 2017 10:08
thank you very much @edwardlys
CamperBot
@camperbot
Sep 27 2017 10:08
akodiaemma sends brownie points to @edwardlys :sparkles: :thumbsup: :sparkles:
:cookie: 7 | @edwardlys |http://www.freecodecamp.com/edwardlys
Manu Saini
@slayercoder
Sep 27 2017 10:13
I am parsing rss feed and then comparing my already stored JSON data in mongodb, using mongoose find method( to prevent repitition of feeds in DB when function is again fired) , with the parsed data in the callback , it says item.title is undefined why?
parser.parseURL("https://nodesource.com/blog/rss", function(error,parsed){       
                var len = parsed.feed.entries.length;
                var item = parsed.feed.entries;
                for(var i = 0; i < len; i++){
                    Nodejs_model.find({"title" : item[i].title}, function(err,x){
                        if(err){
                            var entry = new Nodejs_model({
                                title : item[i].title,
                                description : item[i].content,
                                date : item[i].pubDate,
                                link : item[i].link,
                                creator : item[i].creator,
                                media_url : "www.image.com/image.jpg",
                                category : "nodejs"
                            });

                            entry.save(function(e){
                                if(e) throw e;
                                console.log("feed added from nodesource");
                            });
                        }
                    });                            
                }
            });
this is the parser I am using right now
const parser = require("rss-parser");
I think its because of asynchronous code inside a for loop
thats why its not waiting for the result to come
???
Jake
@JakeDVirus
Sep 27 2017 10:16
can anyone fill me in with the information about the importance of maintaining document outline. what is the advantages and disadvantages of maintaining and not mainting a document outline structure respectively?
Long Nguyen
@longnt80
Sep 27 2017 10:39
@NeelDVirus what is document outline?
Long Nguyen
@longnt80
Sep 27 2017 10:44
@NeelDVirus ah, those HTML5 sections and outlines are for semantic purpose
LydaTech
@lydatech
Sep 27 2017 10:45
@longnt80 not exactly. The topic can get complex
but it comes mostly into play when using assistive technologies
Long Nguyen
@longnt80
Sep 27 2017 10:47
@lydatech well, basically their purpose is just like other HTML tags, to make it clear for machines
so I would say they will be important for accessibility and so is SEO
Emmanuel Akodia
@akodiaemma
Sep 27 2017 10:48
so i have managed to get this thing to work but the appending to the array seems not to work fine
        var numbers = ['753741631','2345654356','772556647'];

var found = false;

                    for (var i=0; i<numbers.length; i++) { if (numbers[i]===newNumbers) found=true; 

                                                         } if(found) 

                                                         { 

                                                             alert('Number exists in the database');
                                                         }

                                                             else { 
                                                                 numbers.push(newNumbers),

                                                                 sendData();
                                                             }




                    //alert
LydaTech
@lydatech
Sep 27 2017 10:49
Not exactly. Have you ever tried to use a web page like a blind person would?
@longnt80 No it isnt SEO
Emmanuel Akodia
@akodiaemma
Sep 27 2017 10:49
        var newNumbers = res.toString();
                                   //this is the variabloe changed to string
        var numbers = ['753741631','2345654356','772556647'];

var found = false;

for (var i=0; i<numbers.length; i++) { if (numbers[i]===newNumbers) found=true; 

} if(found) 

{ 

alert('Number exists in the database');
}

else { 
numbers.push(newNumbers),

sendData();
}
Long Nguyen
@longnt80
Sep 27 2017 10:50

@lydatech

Not exactly. Have you ever tried to use a web page like a blind person would?

That's is accessibility

LydaTech
@lydatech
Sep 27 2017 10:51
right. But then you jump that because it accessibility that its seo which isnt the case
heroiczero
@heroiczero
Sep 27 2017 10:51
Outlines make it more accessible if they know if it is a <article> or a <section> instead of just a <div>
Long Nguyen
@longnt80
Sep 27 2017 10:52
I think if browsers are starting to adopt the standard of those outlines, it would be very important for SEO too
@heroiczero @lydatech do you guys know React?
Jake
@JakeDVirus
Sep 27 2017 10:56
@longnt80 i think you confused html document outline with semantic context. document outline make use of semantic elements. there is a difference and different story of both
LydaTech
@lydatech
Sep 27 2017 10:57
@NeelDVirus yes exactly
Stephen James
@sjames1958gm
Sep 27 2017 10:57
@longnt80 Your componentDidUpdate is getting called again and again and again
Long Nguyen
@longnt80
Sep 27 2017 10:57
@NeelDVirus isn't semantic is about accessibility, too?
@sjames1958gm how do I fix that, I can tell from the devtool that it keeps updating but I'm not sure of other way
LydaTech
@lydatech
Sep 27 2017 10:58
ADA-compliant and ARIA @longnt80 take a read on these topics
Jake
@JakeDVirus
Sep 27 2017 11:03
@longnt80 semantic is about the usage in assisting technology like page-reader. i dont know whether it affects SEO. but it is convenient and advised to follow semantic use. You can have a page without any semantic just with <div> and <span> and you will get the same result but it ain't convenient ...
Stephen James
@sjames1958gm
Sep 27 2017 11:03
@longnt80 I think componentWillReceiveProps instead of update is for this.
You are updating state in component will update which causes another update.
Long Nguyen
@longnt80
Sep 27 2017 11:04
@NeelDVirus if you only have div and span, it can affect SEO. i think they overlap each other, semantic and SEO.
LydaTech
@lydatech
Sep 27 2017 11:05
semantic markup does effect SEO but the topic is the document outline
Long Nguyen
@longnt80
Sep 27 2017 11:06
@sjames1958gm let me try that, thanks
CamperBot
@camperbot
Sep 27 2017 11:06
longnt80 sends brownie points to @sjames1958gm :sparkles: :thumbsup: :sparkles:
:star2: 8487 | @sjames1958gm |http://www.freecodecamp.com/sjames1958gm
Jake
@JakeDVirus
Sep 27 2017 11:07
i had the blurr memory whether semantic affects seo or not. i just checked out out and it do affect. Thanks for pulling out this topic
Long Nguyen
@longnt80
Sep 27 2017 11:30
@sjames1958gm I tried componentWillReceiveProps, but now I have to click 2 times so the Table component can render with the new data:
https://codepen.io/longnt80/pen/oGZejW?editors=0010
Stephen James
@sjames1958gm
Sep 27 2017 12:02
@longnt80 hmm
@longnt80 Appears that setState here does not cause another render :(
Use this as an opportunity to react to a prop transition before render() is called by updating the state using this.setState(). 
The old props can be accessed via this.props. Calling this.setState() within this function will not trigger an additional render.
Stephen James
@sjames1958gm
Sep 27 2017 12:09
@longnt80 An option might be to do the AJAX call in the parent component and pass the array of values in the props
Olga C
@Octopinky
Sep 27 2017 12:27
I have a simple question. How can I call an .html page to run fron js script?
Ene Catalin
@EneCatalin
Sep 27 2017 12:28
huh
you mean open a new page ?
Olga C
@Octopinky
Sep 27 2017 12:28
Oh, the chat has been quiet for a while. Ok.
Well. no. just to run the html
as of right now it is like this
document.body.innerHTML = '</head><body><div id="mainContent"><p id="clock">Time should go here</p></div>';
istead, I would like to call index.html as the variable.
*instead
Long Nguyen
@longnt80
Sep 27 2017 12:58
@sjames1958gm thank you, let me try again
CamperBot
@camperbot
Sep 27 2017 12:58
longnt80 sends brownie points to @sjames1958gm :sparkles: :thumbsup: :sparkles:
:star2: 8488 | @sjames1958gm |http://www.freecodecamp.com/sjames1958gm
Pethaf
@Pethaf
Sep 27 2017 13:04
@Octopinky That would probaly be a GET request to the webserver hosting the .html that you want to access.
Through AJAX.
Olga C
@Octopinky
Sep 27 2017 13:06
@Pethaf how about document.body.innerHTML=index.html? That would be nice
Pethaf
@Pethaf
Sep 27 2017 13:07
@Octopinky I don't think javascript has rights to read files that way.
Olga C
@Octopinky
Sep 27 2017 13:08
@Pethaf do you have a moment to walk me through using GET request, please?
Olga C
@Octopinky
Sep 27 2017 13:14
So, basically, I need to change my manifest file? "web_accessible_resources": ["Embedded_Hello_world.htm"]
rscales02
@rscales02
Sep 27 2017 13:20
if only empty strings are falsey, shouldn't something like "yes" == true be true?
Alex Boquist
@aplchian
Sep 27 2017 13:22
if you do !!”yes” == true
thats tru
so yes is truthy, but it doesn’t equal true
this is what it seems like
rscales02
@rscales02
Sep 27 2017 13:24
ok thanks @aplchian
CamperBot
@camperbot
Sep 27 2017 13:24
rscales02 sends brownie points to @aplchian :sparkles: :thumbsup: :sparkles:
:cookie: 371 | @aplchian |http://www.freecodecamp.com/aplchian
Alex Boquist
@aplchian
Sep 27 2017 13:24
the !! just converts anything to a boolean
rscales02
@rscales02
Sep 27 2017 13:26
Extra cool! thanks!
Edward
@edwardlys
Sep 27 2017 14:20
@akodiaemma yo.. you got the code to work? if you need help i can try take look. just pm me or something
Emmanuel Akodia
@akodiaemma
Sep 27 2017 14:23
@edwardlys ofcourse.... i will send you a message
rscales02
@rscales02
Sep 27 2017 14:27

function addTogether() {
  var arr = [];
  var total = 0;
  if (isNaN(arguments[0])){
    return undefined;
  }
  else if (Number.isInteger(arguments[0]) && Number.isInteger(arguments[1])){
    arr.push(arguments[0]);
    arr.push(arguments[1]);
    total = arr.reduce(function(a,b){return a+b;}, 0);
    return total;
  } 
  else {
    return twoAnd(arguments[0]);
  }
}

function twoAnd(passed){
  var addTo = function(inner){
    return passed + inner;
  };
}

addTogether(2)(3); // should return 5
I am a little stuck with the Closure of this. my error is currently addTogether(...) is not a function
don't think that my inner is defined, but I am not sure how to hold the variable while addToether runs again
Stephen James
@sjames1958gm
Sep 27 2017 14:45
@rscales02 Your twoAnd is not returning anything
function twoAnd(passed){
  return function(inner){
    return passed + inner;
  };
}
rscales02
@rscales02
Sep 27 2017 14:47
else {
    return function twoAnd(num){
      var toSum = arguments[0];
      console.log(toSum);
      return toSum + arguments[0];
    };
updated code... is now returning 6 but not logging 2 at all
Darren
@DarrenfJ
Sep 27 2017 14:47
@Gersho oh cool thanks for sharing the codepen.. sorry I missed it last night
CamperBot
@camperbot
Sep 27 2017 14:47
darrenfj sends brownie points to @gersho :sparkles: :thumbsup: :sparkles:
:cookie: 475 | @gersho |http://www.freecodecamp.com/gersho
rscales02
@rscales02
Sep 27 2017 14:48
How would I store the first addTogether(2) in preparation for running addTogether(3)?
Alex Boquist
@aplchian
Sep 27 2017 15:25
give me a few
will try to help
Darren
@DarrenfJ
Sep 27 2017 15:25
@rscales02 what exercise are you working on? i thought Stephen had you covered (he's a rawk star :D )
rscales02
@rscales02
Sep 27 2017 15:26
arguments optional, but I got help from another friend, thanks @DarrenfJ
CamperBot
@camperbot
Sep 27 2017 15:26
rscales02 sends brownie points to @darrenfj :sparkles: :thumbsup: :sparkles:
:star2: 2058 | @darrenfj |http://www.freecodecamp.com/darrenfj
Darren
@DarrenfJ
Sep 27 2017 15:26
@rscales02 ah cool
imma look up what i did anyway (so long ago)
Alex Boquist
@aplchian
Sep 27 2017 15:28
function twoAnd(passed){ var addTo = function(inner){ return passed + inner; }; return addTo }
you have to return addTwo
addTo *
Darren
@DarrenfJ
Sep 27 2017 15:29
ah gawd. I had forgotten about the pain of that one... thanks @rscales02
CamperBot
@camperbot
Sep 27 2017 15:29
darrenfj sends brownie points to @rscales02 :sparkles: :thumbsup: :sparkles:
:cookie: 290 | @rscales02 |http://www.freecodecamp.com/rscales02
Darren
@DarrenfJ
Sep 27 2017 15:29
might try to redo and refactor...
Alex Boquist
@aplchian
Sep 27 2017 15:31
here is a simple refactor
const addTogether = (...args) => {
  if(args.length === 1){
    return (x) => x + args[0]
  }else if(args.length === 0){
    return undefined
  }else if(args.length === 2){
    return args[0] + args[1]
  }
}
Alex Boquist
@aplchian
Sep 27 2017 15:37
const addTogether = (...args) => {
  const len = args.length
  const hasArgs = len > 0
  if(hasArgs){
    return len === 2
           ? args[0] + args[1] 
           : (x) => x + args[0]
  }
}
rscales02
@rscales02
Sep 27 2017 15:55
addTogether(2, "3"); returns 23 with that lol
Kyle Holm
@thekholm80
Sep 27 2017 15:56
@DarrenfJ :wave:
Alex Boquist
@aplchian
Sep 27 2017 16:06
ah, so just make sure they are numbers :O
and for fun here it is with Ramda / functional programming

  const addTogether = (...args) => {
    const hasArgs = (len) => len > 0
    const hasTwo = (x) => x == 2
    const returnSum = x => hasTwo(x) 
                             ? add(head(args),nth(1,args)) 
                             : add(args[0])
    return compose(
      ifElse(hasArgs, returnSum, always(undefined)),
      length
    )(args)
  } 


console.log('result', addTogether(2, 7))
if anyone is interested in functional programming id def reccommend checking out ramda as the go to library
Sebastian Andil
@selrond
Sep 27 2017 16:18
Hey there! Anybody got a bit of experience with Node.js?
Kyle Holm
@thekholm80
Sep 27 2017 16:21
@selrond a little, but these folks know a lot https://gitter.im/FreeCodeCamp/HelpBackEnd
Sebastian Andil
@selrond
Sep 27 2017 16:22
I mean it's not that backend-y I guess
piteto
@piteto
Sep 27 2017 16:23
@selrond just ask your question, maybe someone here has an answer
Sebastian Andil
@selrond
Sep 27 2017 16:23
So I have this file:
"use strict";
const alfy = require("alfy");
const notifier = require('node-notifier');

var sittingTimer;

function startSittingTimer() {
    sittingTimer = setInterval(function() {
        notifier.notify({
            'title': '5 seconds have passed!',
            'message': 'Stand up, take a walk, stretch a bit and come back to work.'
        })
    }, 5000);
}

function stopSittingTimer() {
    clearInterval(sittingTimer);
}

if (alfy.input == "sit") {
    startSittingTimer() &&
    notifier.notify({
        'title': 'Start working, I\'ll remind you',
        'message': 'Really...'
    });
}    else if (alfy.input == "stand") {
    stopSittingTimer() &&
    notifier.notify({
        'title': 'Call me when you need me',
        'message': 'Please do...'
    });
}
the problem is, stopSittingTimer doesn't seem to execute
clearInterval respectively - I'm not entirely sure where the problem lies
Don't mind other stuff, it's unrelated
@piteto @thekholm80 👆
piteto
@piteto
Sep 27 2017 16:28
I'm not familiar with alfy...but it should work fine as long as the code block is running where alfy.input == "stand"
nothing wrong with calling stopSittingTimer() outside of that code block - it stops the timer successfully
Sebastian Andil
@selrond
Sep 27 2017 16:29
@piteto You don't have to. It's unrelated, as alfy.input == "sit" works as expected. I've tracked the problem down to the stopSittingTimer()
Alex Boquist
@aplchian
Sep 27 2017 16:29
id put a log here to confirm that if block is getting executed
if (alfy.input == "sit") {
  console.log('IS WORKING!')
    startSittingTimer() &&
piteto
@piteto
Sep 27 2017 16:30
stopSittingTimer() isn't getting called is my guess ^ more logs needed
I don't see where that if/else is evaluated again
i.e. when you check that alfy.input == "sit", when does your code call that if/else again to see if alfy.input == "stand"?
Sebastian Andil
@selrond
Sep 27 2017 16:32
@piteto not sure what you mean - this is handled by else if
piteto
@piteto
Sep 27 2017 16:33
@selrond The if/else is only called once though - that's when your timer starts. When is it called again to see if the timer should be stopped?
Sebastian Andil
@selrond
Sep 27 2017 16:34
@aplchian if (alfy.input == "sit") works as expected. Does what it should.
piteto
@piteto
Sep 27 2017 16:34

as soon as you start that timer, the only code that executes is:

        notifier.notify({
            'title': '5 seconds have passed!',
            'message': 'Stand up, take a walk, stretch a bit and come back to work.'
        })

once every 5 seconds. I don't see where in that code, you are calling the if/else again to see if alfy.input == "stand"

Sebastian Andil
@selrond
Sep 27 2017 16:35
@piteto every time input comes from Alfred, the index.js runs and alfred.input is the most current input
piteto
@piteto
Sep 27 2017 16:38
I'm not familiar with that module, but this is what I see in plain JS from your code above:
var sittingTimer;
var i = 0;

function startSittingTimer() {
  sittingTimer = setInterval(function() {
    console.log("hello");
    i++;
  }, 1000);
}

function stopSittingTimer() {
  clearInterval(sittingTimer);
}

startSittingTimer();

if (i == 2) stopSittingTimer();
That timer will run forever because if (i == 2) stopSittingTimer() only gets called once
To fix it, wrap the if in a function that gets called to check the value:
var sittingTimer;
var i = 0;

function startSittingTimer() {
  sittingTimer = setInterval(function() {
    console.log("hello");
    i++;
    checkOnAlfy();
  }, 1000);
}

function stopSittingTimer() {
  clearInterval(sittingTimer);
}

startSittingTimer();

function checkOnAlfy() {
  if (i == 2) stopSittingTimer();
}
you'll want a boolean to see if the timer is already running so you don't have multiple instances of setInterval running at once, but that's the only suggestion I have from the code you sent
I'd be surprised if all of index.js is reloaded repeatedly
Sebastian Andil
@selrond
Sep 27 2017 16:42

That timer will run forever because if (i == 2) stopSittingTimer() only gets called once

How does it not stop the timer? I don't quite get that

piteto
@piteto
Sep 27 2017 16:44
this: if (i == 2) stopSittingTimer(); only runs once when the file is first loaded
that's why it needs to be wrapped in a function so it can run every time i is updated
as soon as you start the timer, only the setInterval function code is running
Sebastian Andil
@selrond
Sep 27 2017 16:46
@piteto yes but the file executes every time it gets input from Alfred. So if I would want to stop it, I'd pass standup as an input and it does get into the if(..) else
piteto
@piteto
Sep 27 2017 16:47
I'm not sure then - this is where I would need to see more code
Sebastian Andil
@selrond
Sep 27 2017 16:47
Chris
@bestintown23
Sep 27 2017 16:54
how can i make my classes (section1 and section2) be side by side.? https://codepen.io/bestintown23/pen/XepNLG
piteto
@piteto
Sep 27 2017 16:55
@selrond I'd have to learn more about alfy to help out more with this - all I can tell is that your if/else needs to be evaluated on input, but I don't know how that module works to provide more guidance :/
Sebastian Andil
@selrond
Sep 27 2017 16:56
@bestintown23
.container {
  display: flex;  
}
@piteto thank you for your time anyway
CamperBot
@camperbot
Sep 27 2017 16:56
selrond sends brownie points to @piteto :sparkles: :thumbsup: :sparkles:
:cookie: 154 | @piteto |http://www.freecodecamp.com/piteto
piteto
@piteto
Sep 27 2017 17:01
sorry I couldn't get a direct answer :(
Darren
@DarrenfJ
Sep 27 2017 18:00
@thekholm80 hey buddy.. slipped out to test
how goes the codewars?
@aplchian hey thanks for the rambda links
CamperBot
@camperbot
Sep 27 2017 18:01
darrenfj sends brownie points to @aplchian :sparkles: :thumbsup: :sparkles:
:cookie: 372 | @aplchian |http://www.freecodecamp.com/aplchian
Manish Giri
@Manish-Giri
Sep 27 2017 18:54
@DarrenfJ :wave:
Kyle Holm
@thekholm80
Sep 27 2017 19:10
@Manish-Giri :wave:
@DarrenfJ i've been slacking on codewars
too many other things going on
Manish Giri
@Manish-Giri
Sep 27 2017 19:11
:wave:
@thekholm80
Yaroslav
@YariPL
Sep 27 2017 19:49
are there anybody here from Lublin, Poland?
piteto
@piteto
Sep 27 2017 20:00
@YariPL You might want to check for a city near you here: https://forum.freecodecamp.org/t/freecodecamp-city-based-local-groups/19574/17
quickspeedy
@quickspeedy
Sep 27 2017 20:02
How do you center a div box right in the middle of the browser and it remains center when browser resize? I tried position: relative; and top: 50%; but it doesn't work. Nor does margin: auto 0 too.
Here is the link to my code: https://codepen.io/quickspeedy/pen/ZXLKXx
Yaroslav
@YariPL
Sep 27 2017 20:03
@piteto I checked but unfortunately there is no official group of my city. There 2 but closed on FB but with 1 and 2 people each and they don't approve new members
piteto
@piteto
Sep 27 2017 20:05
Bummer :(
Sebastian Andil
@selrond
Sep 27 2017 20:07
@quickspeedy try:
.row {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
}
piteto
@piteto
Sep 27 2017 20:07
@quickspeedy change your width to max-width, then you can use auto for your margin
.box {
  max-width: 500px;
  margin: 0 auto;
  text-align: center; /* if you want the button centered too */
}
Ahhh, if you mean vertically centered, use bootstrap classes for that
Sebastian Andil
@selrond
Sep 27 2017 20:10
@quickspeedy you should really learn FlexBox model. It'll save you a ton of time and your code is going to be much more conscise
Gersho
@Gersho
Sep 27 2017 20:11
if you want to center an using text-align, you must do it on the parent element (because it centers what is inside it, so using it on a button would center the button's text inside the button)
quickspeedy
@quickspeedy
Sep 27 2017 20:12
Thanks @selrond I'll take a look at FlexBox. Appreciated!
CamperBot
@camperbot
Sep 27 2017 20:12
quickspeedy sends brownie points to @selrond :sparkles: :thumbsup: :sparkles:
:cookie: 296 | @selrond |http://www.freecodecamp.com/selrond
Gersho
@Gersho
Sep 27 2017 20:13

You might want to check for a city near you here: https://forum.freecodecamp.org/t/freecodecamp-city-based-local-groups/19574/17

is there an equivalent not on facebook ?

piteto
@piteto
Sep 27 2017 20:14
<div class="container-fluid h-100">
  <div class="row h-100 justify-content-center align-items-center">
    <div class="col box text-center" id="divBox">
      <button id="getMessage" class="btn btn-primary">New Quote</button>
    </div>
  </div>
</div>
No css needed with the bootstrap classes @quickspeedy
@Gersho Maybe check https://meetup.com?
Gersho
@Gersho
Sep 27 2017 20:21
i'll try thank @piteto
CamperBot
@camperbot
Sep 27 2017 20:21
gersho sends brownie points to @piteto :sparkles: :thumbsup: :sparkles:
:cookie: 155 | @piteto |http://www.freecodecamp.com/piteto
Eric Miller
@ericmiller777
Sep 27 2017 20:35
@DarrenfJ @Gersho he talked about slack, said not good for big groups.
@piteto when should you use fluid? For me it's not very responsive.
piteto
@piteto
Sep 27 2017 21:23
@ericmiller777 container gives your site a maximum width, container-fluid makes your site 100% wide in all resolutions. In the end, the grid system is what makes a site responsive, and the grid system requires the correct use of containers, rows, and columns for a site to be responsive.
i.e., containers alone don't make a site responsive
Eric Miller
@ericmiller777
Sep 27 2017 21:25
@piteto thanks, I'll go test it later, haven't tried fluid since I started
CamperBot
@camperbot
Sep 27 2017 21:25
ericmiller777 sends brownie points to @piteto :sparkles: :thumbsup: :sparkles:
:cookie: 156 | @piteto |http://www.freecodecamp.com/piteto
piteto
@piteto
Sep 27 2017 21:29

@ericmiller777 An easy way to see the difference is with HTML like this:

<div class="container-fluid bg-success">container-fluid</div>
<div class="container bg-primary">container</div>

Resize your browser after adding that HTML and either bootstrap 3 or 4

as the browser gets wider, the container class stops touching the edges of the screen and reaches its max width
Chris
@bestintown23
Sep 27 2017 22:15
where can i get a free computer?
Eric Miller
@ericmiller777
Sep 27 2017 22:30
@bestintown23 some citys offer a new computer if you get your GED, idk if that applys to you tho
I had a phone interviewer ask me " what the most amazing piece of code that youve done", and wanted a screenshot, i was just like >.>; it was a very strange recruiter and a strange job, so i didn't care, but is that a normal question, and wtf would you show?
Gersho
@Gersho
Sep 27 2017 22:36
...a screenshot ?
i mean asking for an exemple makes sense, but a screenshot ?
hire me
i can't imagine asking for a SS of code
piteto
@piteto
Sep 27 2017 22:54
The first time I got the computer to write Hello World. In fact, I love coding so much, a screenshot of that code is what I use for my computer's desktop background still today.
:)
Gersho
@Gersho
Sep 27 2017 22:56
@piteto is that you uncle scrooge ?
piteto
@piteto
Sep 27 2017 22:57
@Gersho I had to look up uncle scrooge :)
So, uhh, no lol
Gersho
@Gersho
Sep 27 2017 22:58
i mean your first code is like his first coin
it is your precious
piteto
@piteto
Sep 27 2017 22:58
ohhhhhh! I wasn't sure what you meant. It's just a canned answer I'd give to a recruiter if they ever asked me that question
Gersho
@Gersho
Sep 27 2017 22:59
i failed to detect sarcasm
truly not my best day (lines of code written so far today: 0 )
piteto
@piteto
Sep 27 2017 23:00
My desktop is actually an image of Pluto, been that way ever since they declared it wasn't a planet
Gersho
@Gersho
Sep 27 2017 23:00
lol
Kyle Holm
@thekholm80
Sep 27 2017 23:00
#neverforget
poor pluto
Brianna
@brisourceful
Sep 27 2017 23:00
It's that time of day.......
Kyle Holm
@thekholm80
Sep 27 2017 23:01
shh
Brianna
@brisourceful
Sep 27 2017 23:01
Who's ready for some data structures and algorithms!?!?!?!
piteto
@piteto
Sep 27 2017 23:01
binary tree time
Manish Giri
@Manish-Giri
Sep 27 2017 23:02
@brisourceful :hand:
Brianna
@brisourceful
Sep 27 2017 23:02
hey hey hey @Manish-Giri
alright, let's get started!
Manish Giri
@Manish-Giri
Sep 27 2017 23:04
Untitled.png
I give up
Brianna
@brisourceful
Sep 27 2017 23:05
We are going to merge two sorted arrays into one sorted single array. i.e.
function mergeSortedArray([2,5,6,9], [1,2,3,29){
return [1,2,2,3,5,6,9,29]
}
Manish Giri
@Manish-Giri
Sep 27 2017 23:05
spent more than a week on this kata, still it won't work
Brianna
@brisourceful
Sep 27 2017 23:05
Annnnnnnnd GO!
Manish Giri
@Manish-Giri
Sep 27 2017 23:06
@brisourceful return arr1.concat(arr2).sort((a,b) => a -b));
Kyle Holm
@thekholm80
Sep 27 2017 23:06
you stole my answer
Brianna
@brisourceful
Sep 27 2017 23:06
damnnnnn you MANISH!
Manish Giri
@Manish-Giri
Sep 27 2017 23:06
lol
Brianna
@brisourceful
Sep 27 2017 23:07
this was my answer:
function mergeSortedArray(arr1, arr2) {
    var arr3 = [];
    var arr1_el = arr1[0];
    var arr2_el = arr2[0];
    var i = 1;
    var j = 1;

    while (arr1_el || arr2_el) {
        if (arr1_el<arr2_el || (arr1_el && !arr2_el) ) {

            arr.push(arr1_el);
            arr1_el = arr1[i++];
        } else {
            arr.push(arr2_el);
            arr2_el = arr2[j++];
        }
    }

    return arr3;
}
Kyle Holm
@thekholm80
Sep 27 2017 23:07
yikes
Manish Giri
@Manish-Giri
Sep 27 2017 23:07
or return [...arr1, ...arr2].sort((a,b) => a - b));
@brisourceful
Brianna
@brisourceful
Sep 27 2017 23:07
fuck I'm terrible at this
Kyle Holm
@thekholm80
Sep 27 2017 23:07
you'll get there
JS is an art
and @Manish-Giri is an artist
Manish Giri
@Manish-Giri
Sep 27 2017 23:07
of which Kyle is the master
pfffft
Brianna
@brisourceful
Sep 27 2017 23:08
teach me Obi Wan
Kyle Holm
@thekholm80
Sep 27 2017 23:08
on the beach in miami is a single grain of red sand, bring that to me and i'll give you your next task
Brianna
@brisourceful
Sep 27 2017 23:10
:airplane:
Kyle Holm
@thekholm80
Sep 27 2017 23:10
how's the job @brisourceful ?
Brianna
@brisourceful
Sep 27 2017 23:11
It's meh. It's a part-time contract job as a Front End Dev. Doing an absurd amount of HTML and CSS. Just started doing some light JS stuff with Optimizely. Other than that, the job isn't really that challenging. I'm still looking for full-time work.
Kyle Holm
@thekholm80
Sep 27 2017 23:12
I hope you find it
not being challenged sucks
Manish Giri
@Manish-Giri
Sep 27 2017 23:12
i challenge kyle everyday
to solve my kata
yet he doesn't
Kyle Holm
@thekholm80
Sep 27 2017 23:12
lol you're barking up the wrong tree, mate. might as well ask a fish to teach you to fly
your crazy java kata makes my head hurt
Brianna
@brisourceful
Sep 27 2017 23:13
I feel like learning java as JS is starting to irritate me
Kyle Holm
@thekholm80
Sep 27 2017 23:14
I'm not smart enough for java
Brianna
@brisourceful
Sep 27 2017 23:15
that's how I feel about JS :joy:
Kyle Holm
@thekholm80
Sep 27 2017 23:16
JS makes sense to me
Brianna
@brisourceful
Sep 27 2017 23:16
@Manish-Giri the big O notation of the solution you gave isn't very great. Is that correct?
because you are calling .sort on two sorted arrays anyway
Manish Giri
@Manish-Giri
Sep 27 2017 23:17
nope
it calls .sort() on the merged array
and the sort itself would be O(nlogn)
@brisourceful
Brianna
@brisourceful
Sep 27 2017 23:19
sorry I meant the merged array not both of them. But wouldn't it make more sense to just pluck numbers from one array into the other because we already know they are sorted.
Manish Giri
@Manish-Giri
Sep 27 2017 23:19
if you want to take advantage of the fact that the input arrays are sorted
then yea I need to make a different algo
Brianna
@brisourceful
Sep 27 2017 23:21
I guess my question is, can we do it with a better big O notation?
Manish Giri
@Manish-Giri
Sep 27 2017 23:21
whats your algo's notation
O(n)
?
Brianna
@brisourceful
Sep 27 2017 23:22
yeah I'm pretty sure
Manish Giri
@Manish-Giri
Sep 27 2017 23:23
Cool
I guess you could use binary search
To make it O(log n)
Brianna
@brisourceful
Sep 27 2017 23:25
show me the cooddeeee :D
Kyle Holm
@thekholm80
Sep 27 2017 23:26
okay, i did it explicitly without using merge or sort, no clue what the big O score would be
Manish Giri
@Manish-Giri
Sep 27 2017 23:27
As I said
Kyle is the master
Kyle Holm
@thekholm80
Sep 27 2017 23:27
lol i wish
Kyle is mostly just killing time waiting for a game to download
Brianna
@brisourceful
Sep 27 2017 23:29
haha
let's see it Kyle! :)
Kyle Holm
@thekholm80
Sep 27 2017 23:29
const mergeSort = (one, two) => {
  let result = [];
  let i = one.length + two.length;

  while (i) {
    one[0] < two[0]
      ? result.push(one.shift())
      : result.push(two.shift());
    i--;
  }

  return result;
}
Brianna
@brisourceful
Sep 27 2017 23:30
Look at you using ES6 and all. Gettin fancy
Manish Giri
@Manish-Giri
Sep 27 2017 23:30
Lol
Kyle Holm
@thekholm80
Sep 27 2017 23:30
ES6 is so last year
Brianna
@brisourceful
Sep 27 2017 23:30
it legit is actually :joy:
Kyle Holm
@thekholm80
Sep 27 2017 23:35
so what if you have an unknown number of sorted arrays passed into your function?
Gersho
@Gersho
Sep 27 2017 23:35
itterate over arguments ?
Brianna
@brisourceful
Sep 27 2017 23:36
ohhh damn
hmmm good question Kyle
Kyle Holm
@thekholm80
Sep 27 2017 23:37
and still not using concat() or sort()
Brianna
@brisourceful
Sep 27 2017 23:38
how do you even do that when you don't know the number of inputs?
Kyle Holm
@thekholm80
Sep 27 2017 23:38
they are available as an array called arguments
Manish Giri
@Manish-Giri
Sep 27 2017 23:38
you could just do
function sum(...arrays)
then get the number of the input arrays
with arrays.length
Gersho
@Gersho
Sep 27 2017 23:40
can we arguments.reduce() ?
Manish Giri
@Manish-Giri
Sep 27 2017 23:40

arguments is an

array like object

Kyle Holm
@thekholm80
Sep 27 2017 23:40
still iterable?
Manish Giri
@Manish-Giri
Sep 27 2017 23:41
not sure if reduce() would work
Brianna
@brisourceful
Sep 27 2017 23:42
I don't think you can
Gersho
@Gersho
Sep 27 2017 23:43
TypeError: arguments.reduce is not a function
Manish Giri
@Manish-Giri
Sep 27 2017 23:43
arguments.slice().reduce() would work
Gersho
@Gersho
Sep 27 2017 23:43
var args = Array.prototype.slice.call(arguments);
Kyle Holm
@thekholm80
Sep 27 2017 23:44

strange, keep getting

"ReferenceError: arguments is not defined

Kyle Holm
@thekholm80
Sep 27 2017 23:44
but you can [...arguments].reduce()
Manish Giri
@Manish-Giri
Sep 27 2017 23:44
@thekholm80 code?
strange, keep getting
"ReferenceError: arguments is not defined
Kyle Holm
@thekholm80
Sep 27 2017 23:45
const mergeSort = () => {
  const args = [...arguments];
}

console.log(mergeSort([2,3,4], [1, 2, 5], [5, 6, 7]));
Gersho
@Gersho
Sep 27 2017 23:45
maybe it doesn't apply to fat arrow ?
Brianna
@brisourceful
Sep 27 2017 23:45
it doesn't
MDN said no
no arrow functions
Kyle Holm
@thekholm80
Sep 27 2017 23:46
yep, that fixed it
stupid JS
sucks
Brianna
@brisourceful
Sep 27 2017 23:46
AMEN
:pray:
Gersho
@Gersho
Sep 27 2017 23:46
fat arrow are really weird, the make me feel i lack a lot in the inner understandings of JS
Manish Giri
@Manish-Giri
Sep 27 2017 23:47
use rest
prob solved
Gersho
@Gersho
Sep 27 2017 23:47
rest ?
Manish Giri
@Manish-Giri
Sep 27 2017 23:47
you could just do
function sum(...arrays)
:point_up:
rest
Brianna
@brisourceful
Sep 27 2017 23:48
wat?
Kyle Holm
@thekholm80
Sep 27 2017 23:49
oh well, i'm going to dinner
Manish Giri
@Manish-Giri
Sep 27 2017 23:49
"rest parameters"
Gersho
@Gersho
Sep 27 2017 23:49
isn't that spread syntax
Manish Giri
@Manish-Giri
Sep 27 2017 23:49
allows you to group together an unknown number of inputs, all in one array
Gersho
@Gersho
Sep 27 2017 23:49
have a good meal kyle
Manish Giri
@Manish-Giri
Sep 27 2017 23:49
no when you have ... in the func definition, that's rest
not spread
@thekholm80 :wave:
thanks @Manish-Giri
CamperBot
@camperbot
Sep 27 2017 23:50
gersho sends brownie points to @manish-giri :sparkles: :thumbsup: :sparkles:
:star2: 6588 | @manish-giri |http://www.freecodecamp.com/manish-giri
Gersho
@Gersho
Sep 27 2017 23:51
time for a break too, i cannot brain anymore
Manish Giri
@Manish-Giri
Sep 27 2017 23:51
:+1:
Brianna
@brisourceful
Sep 27 2017 23:54
I feel yeah. My brain has had enough
bye @thekholm80
piteto
@piteto
Sep 27 2017 23:59
like:
const mergeSortedArray = (...args) => [].concat(...args).sort((a, b) => a - b);