These are chat archives for FreeCodeCamp/Help

9th
Oct 2018
Manish Giri
@Manish-Giri
Oct 09 2018 00:37
@JohnnyBizzel :wave:
Johnny
@JohnnyBizzel
Oct 09 2018 01:02
@Manish-Giri Good evening! Hope you are good buddy.
It's way past bed time so I must hit the sack.
Manish Giri
@Manish-Giri
Oct 09 2018 01:52
@JohnnyBizzel all right bud, catch ya next time
sleep tight
Joseph
@revisualize
Oct 09 2018 02:52
Hey
Claudio Restifo
@Marmiz
Oct 09 2018 04:08
Ho
glitz20
@glitz20
Oct 09 2018 04:41
anybody familiar with css
?
glitz20
@glitz20
Oct 09 2018 04:47
my animation is not working in ie
Henry
@GitHub-Henry
Oct 09 2018 05:03
you probably need to use some sort of css prefixer to add the correct prefixes
Henry
@GitHub-Henry
Oct 09 2018 05:23
btw CRA2 is out, with added functionality
Claudio Restifo
@Marmiz
Oct 09 2018 05:25
too scared to update.
abraham anak agung
@padunk
Oct 09 2018 05:27
:fearful:
they add some great feat tho
Claudio Restifo
@Marmiz
Oct 09 2018 05:34
yeah but for stuff in production...
i don't want to be to one who broke something that's working...
abraham anak agung
@padunk
Oct 09 2018 05:36
yup, totally agree. i love importing svg as react comp and yarn plug n play, but it pnp is not working in my computer, don't know why
Henry
@GitHub-Henry
Oct 09 2018 07:40
when i manually change the value with css, my object moves,so i'm wondering why it's not moving with js
Anand Potukuchi
@anandpotukchi
Oct 09 2018 07:47
var findPeopleByName = function(personName, done) {
    Person.find(personName, (err, done) => {
      if(err) {
         done(err); 
      }
    done(null, personName);
    }) 
};
what's wrong here
Nicolas Ramirez
@kamatheuska
Oct 09 2018 07:47
@GitHub-Henry which value are you talking about?
Henry
@GitHub-Henry
Oct 09 2018 07:51
c2X should be updated and move the object. so if you look at transform3d() the first parameter should move the object along the x axis
change the first parameter in css and the object moves, so i'm wondering why it doesn't move with my js
Nicolas Ramirez
@kamatheuska
Oct 09 2018 07:52
@anandpotukchi try returning some value
Henry
@GitHub-Henry
Oct 09 2018 07:52
i'm thinking i'm missing something simple, but not sure what
Nicolas Ramirez
@kamatheuska
Oct 09 2018 07:53
I do not see any function with that name transform3d()
not even a function with any parameters foir that matter @GitHub-Henry
oh, in your css
my bad
Henry
@GitHub-Henry
Oct 09 2018 07:56
actually i'm trying to change the property with js
Anand Potukuchi
@anandpotukchi
Oct 09 2018 07:59
@kamatheuska not working
Parameter "filter" to find() must be an object, got r@nd0mN4m3
this is the error
Nicolas Ramirez
@kamatheuska
Oct 09 2018 08:04
@GitHub-Henry I tried to debbug it but don't find the error sorry :)
Henry
@GitHub-Henry
Oct 09 2018 08:04
@kamatheuska np, appreciate the attempt
Nicolas Ramirez
@kamatheuska
Oct 09 2018 08:05
@GitHub-Henry still, it seems to have something to do with requestAnimationFrame
everything else seems ok
Henry
@GitHub-Henry
Oct 09 2018 08:06
I'm checking that by using another property to move the object
Nicolas Ramirez
@kamatheuska
Oct 09 2018 08:08
@anandpotukchi what is find? what is Person? If it is an array method, Array.prototype.find must return a boolean.
Anand Potukuchi
@anandpotukchi
Oct 09 2018 08:09
it's a mongo challenge @GitHub-Henry
Nicolas Ramirez
@kamatheuska
Oct 09 2018 08:09
it seems though that it is some kind of database method
yeah, you shoudl say so, no gurus here man @anandpotukchi
mongoose, perhaps?
Henry
@GitHub-Henry
Oct 09 2018 08:10
@anandpotukchi no just trying to learn
Anand Potukuchi
@anandpotukchi
Oct 09 2018 08:10
@ezioda004 any ideas
Parameter "filter" to find() must be an object, got r@nd0mN4m3
Aditya
@ezioda004
Oct 09 2018 08:12
@anandpotukchi Log and see what personName is, if its a string then change it to an object.
.find({name: personName}, callback)
Assuming the model has name
Anand Potukuchi
@anandpotukchi
Oct 09 2018 08:16
Yup. worked
but why pass name as a n object
its a string right
Nicolas Ramirez
@kamatheuska
Oct 09 2018 08:17
@anandpotukchi man read the instructions, also called the docs
it is daunting at first, but you will learn more, trust me!
db.collection.find(query, projection)
Aditya
@ezioda004
Oct 09 2018 08:19
@anandpotukchi That's just how query work, you pass an object with the fields/modifiers in it
Nicolas Ramirez
@kamatheuska
Oct 09 2018 08:21
That was my first question :smile: @ezioda004
Still, works the same
(almost)
Henry
@GitHub-Henry
Oct 09 2018 08:35
got it to work with style.left. i'd like to get it to work with style.transform = translate3d()
abraham anak agung
@padunk
Oct 09 2018 08:41
@GitHub-Henry delete the last ; in your translate3d
it should be translate3d(${c2X}px, 100px, 0) i think.
Henry
@GitHub-Henry
Oct 09 2018 08:43
thanks, it works with translate3d
abraham anak agung
@padunk
Oct 09 2018 08:45
@GitHub-Henry great, never work with requestAnimationFrame before, nice to know this.
Henry
@GitHub-Henry
Oct 09 2018 08:47
requestAnimationFramework is good, but the thing for animation and transition is to use translate3d and scale3d because both call on GPU instead of CPU
so if you want to move stuff around, use translate3d, and if you want to scale stuff , use scale3d. those are the go to properties
Nicolas Ramirez
@kamatheuska
Oct 09 2018 08:48
nice! I never used it before it
abraham anak agung
@padunk
Oct 09 2018 08:48
ah, it use GPU, nice....
Nicolas Ramirez
@kamatheuska
Oct 09 2018 09:41
@diomed @bjorno43 @ezioda004
Johnny
@JohnnyBizzel
Oct 09 2018 09:48
@kamatheuska
class ProductsCollection {
    constructor () {
}
/// put this outside the constructor
    generateModel () {
        let model = { name: 'testing' }
        return model
    }

    static mapToModel (legacy) {
        if (!isObject(legacy))
            return legacy

        let current = this.generateModel() // Here!!!
        for (let key in legacy) {
          // some code...
        }
        return current
    }
}
Maybe?
psyperl
@psyperl
Oct 09 2018 09:49
static method have this?
maybe this.generateModel() to ProductsCollection().generateModel() ? .. I am not so sure how static works in JS
Johnny
@JohnnyBizzel
Oct 09 2018 09:52
The code you posted on Stack overflow has unbalanced brackets
Nicolas Ramirez
@kamatheuska
Oct 09 2018 09:57
@JohnnyBizzel yep, already edited but still got down voted :cry:
@psyperl me neither, trying to learn, but it is quite puzzling...it seems that it is just not possible to access an instance inside it
psyperl
@psyperl
Oct 09 2018 10:00
yeah it should not be possible.. that's why is a static method
May Kittens Devour Your Soul
@diomed
Oct 09 2018 10:02
is anyone okay with CSS --variables?
Yashwardhan Pauranik
@yashwp
Oct 09 2018 10:06
Can anyone help me with this issue?
iamkun/dayjs#297
May Kittens Devour Your Soul
@diomed
Oct 09 2018 10:20
where is wizard @ezioda004 when you need him?
Anand Potukuchi
@anandpotukchi
Oct 09 2018 10:28
var findEditThenSave = function(personId, done) {
  var foodToAdd = "hamburger";
  Person.findById(personId, function(err, data) {
    if (err) {
      done(err);
    }

    data.favoriteFoods
      .push(foodToAdd)
      .save((err, data) => (err ? done(err) : done(null, data)));
  });
I'm getting a timeout
Andre
@AndreRudyk
Oct 09 2018 10:30
Hello everybody. I need your help please. When I try to install the bundle by running “bundle install --without production” script in the terminal, It says "Could not locate Gemfile". What do I do?
Anand Potukuchi
@anandpotukchi
Oct 09 2018 10:31
@AndreRudyk Create your own Gemfile
touch Gemfile
@ezioda004
Andre
@AndreRudyk
Oct 09 2018 10:34

@anandpotukchi , Ok. Just so you know, i'm at the stage where you have to open your first app using VS Code and edit the existing Gemfile by replacing gem 'sqlite3' with group :development, :test do
gem 'sqlite3'
end

group :production do
gem 'pg'
end

Anand Potukuchi
@anandpotukchi
Oct 09 2018 10:35
@AndreRudyk are you doing theodinproject?
Andre
@AndreRudyk
Oct 09 2018 10:35
@anandpotukchi , yes
Anand Potukuchi
@anandpotukchi
Oct 09 2018 10:36
I think you're in te wrong chat room
Andre
@AndreRudyk
Oct 09 2018 10:36
Sorry
Anand Potukuchi
@anandpotukchi
Oct 09 2018 10:36
Yo'd get better help on thir gitter @AndreRudyk
not a problem
But I uess, you'd rarely find soemone with knowledge of ruby
Nicolas Ramirez
@kamatheuska
Oct 09 2018 10:40
@anandpotukchi so, you want to insert a new food on a Persons Document
Anand Potukuchi
@anandpotukchi
Oct 09 2018 10:41
@kamatheuska yes
Nicolas Ramirez
@kamatheuska
Oct 09 2018 10:41
have you tried something like findOneAndUpdate?
let me look
Nicolas Ramirez
@kamatheuska
Oct 09 2018 10:46
@GitHub-Henry yep, found that a while ago thanks!
still, It was confusing
May Kittens Devour Your Soul
@diomed
Oct 09 2018 10:52
@kamatheuska do you know some css --variables
Michael Bomholt
@bomholtm
Oct 09 2018 11:13
hey everyone
i haven't been active for quite a while and the new curriculum seems to be out of beta
my old projects are also registered for the new certificates even the don't match all new rules
do i have to redo them to claim a new certificate?
May Kittens Devour Your Soul
@diomed
Oct 09 2018 11:18
@bomholtm most likely
but I think that there are some minor changes for existing projects
Michael Bomholt
@bomholtm
Oct 09 2018 11:21
i already redid one project while i tested the beta but when i link a new version for a new certificate it also changes the link for the legacy certification
mstellaluna
@mstellaluna
Oct 09 2018 11:21
@bomholtm you can still complete the old projects under "Take home projects", some old projects you may have credit for you need to check each section. You would need to complete the missing projects for the certificates
Michael Bomholt
@bomholtm
Oct 09 2018 11:24
@mstellaluna the point i don't understand is... i completed the legacy front end projects (old certificate)
the links to my pens are automaticly pulled into the new certifications
for example the link for tribute page of the legacy certificate and responsive web design projects is the same
by default... so even if put in the work and redo all the projects i'm not able to keep the old ones linked
May Kittens Devour Your Soul
@diomed
Oct 09 2018 11:26
@channinghall answer is 42
Nicolas Ramirez
@kamatheuska
Oct 09 2018 11:27
@diomed I used to know, now is forgotten :laughing:
mstellaluna
@mstellaluna
Oct 09 2018 11:27
@bomholtm you still have your old certificate and you can keep your old projects that still count for the new certificates.
they will count that's why they been pulled in. not all the legacy projects are credited for the new certs
May Kittens Devour Your Soul
@diomed
Oct 09 2018 11:28
hi @mstellaluna :cat:
long time no seen
mstellaluna
@mstellaluna
Oct 09 2018 11:28
@diomed hello
May Kittens Devour Your Soul
@diomed
Oct 09 2018 11:29
how goes it?
mstellaluna
@mstellaluna
Oct 09 2018 11:29
busy. u?
May Kittens Devour Your Soul
@diomed
Oct 09 2018 11:29
-unbusy
Michael Bomholt
@bomholtm
Oct 09 2018 11:29
@mstellaluna even if they don't fulfil of of the test?
May Kittens Devour Your Soul
@diomed
Oct 09 2018 11:29
:cat: is sleeping all the time
mstellaluna
@mstellaluna
Oct 09 2018 11:30
@bomholtm yes, its fine for the old projects
Michael Bomholt
@bomholtm
Oct 09 2018 11:30
@mstellaluna they are matching the old user stories but not the new ones
mstellaluna
@mstellaluna
Oct 09 2018 11:30
its the new projects that count for the tests
your still have your old cert, it wasn't removed and the original link to the cert is still valid. I can see it on your public FCC profile. It is up to you if you wish to bring those up to date, you don't have to
Michael Bomholt
@bomholtm
Oct 09 2018 11:32
ahh okay i was worried i break the academic honesty policy if i just continue with just the new projects
@mstellaluna thank you so much
mstellaluna
@mstellaluna
Oct 09 2018 11:32
No. the academic policy is more if you take a copy of FCC example project or steal someone's project and pass it as your own
then its cheating
Michael Bomholt
@bomholtm
Oct 09 2018 11:33
btw i was inactive for QUITE A WHILE and i somehow remember your name. seems like its not the first time you helped me somehow
i appreciate that ;)
mstellaluna
@mstellaluna
Oct 09 2018 11:33
im usually around :)
anytime
May Kittens Devour Your Soul
@diomed
Oct 09 2018 11:34
anyplace
anywhere....
mstellaluna
@mstellaluna
Oct 09 2018 11:34
im usually around even if im quite
May Kittens Devour Your Soul
@diomed
Oct 09 2018 11:34
drunk?
mstellaluna
@mstellaluna
Oct 09 2018 11:34
no busy with java
May Kittens Devour Your Soul
@diomed
Oct 09 2018 11:34
:yum:
Michael Bomholt
@bomholtm
Oct 09 2018 11:35
@diomed hmmmmm
it think i follow you on github :D
May Kittens Devour Your Soul
@diomed
Oct 09 2018 11:35
oh, you meant quiet :yum:
mstellaluna
@mstellaluna
Oct 09 2018 11:35
yea...
I have to go... ciao
Michael Bomholt
@bomholtm
Oct 09 2018 11:35
its been quite a while jeeeeez
May Kittens Devour Your Soul
@diomed
Oct 09 2018 11:36
@bomholtm that's nice. I follow you too coz you had bestest portfolio examples and then they disappeared. lol
@mstellaluna ciao, bella
Michael Bomholt
@bomholtm
Oct 09 2018 11:36
@mstellaluna have a good one and see you around
May Kittens Devour Your Soul
@diomed
Oct 09 2018 11:37
@bomholtm u familiar with css --variables :grey_question:
Michael Bomholt
@bomholtm
Oct 09 2018 11:37
@diomed haha thanks ... but its more like a disappeared :D which portfolio examples do you mean? the fcc projects are still only
but yeah probably deleted my own portfolio 80 times :D
@diomed yea i guess :) only worked with react and gatsby for the last month
work very little to not at all is probably more accurate
May Kittens Devour Your Soul
@diomed
Oct 09 2018 11:40
got a gatsby blog?
your random quote machine is top notch :thumbsup:
Michael Bomholt
@bomholtm
Oct 09 2018 11:49
@diomed gatsby is quite versatile and you can build pretty much everything with it
it think its a better alternative to things like wordpress but i haven't build a blog with it (planning one though)
and thank you for the compliment ... i really appreciate that. i'm trying to be less perfectionistic and get more done though
Renaud
@Renaudcr7
Oct 09 2018 11:59

https://codepen.io/je_maverick/pen/VEPVQd

unable to change the font (Under body tag in css)

Aditya
@ezioda004
Oct 09 2018 12:03
@Renaudcr7 I don't see where you've imported that font
Aditya
@ezioda004
Oct 09 2018 12:18
@kamatheuska Just adding to the answer since I dont see in the SO or MDN. You could access the instance methods in static methods by doing this.prototype.method:
class Test {
  constructor(){
    this.constructor.method2();
  }
  method1(){
    console.log("I'm from instance method");
  }
  static method2(){
    console.log("I'm from static method");
    this.prototype.method1();
  }
}
const x = new Test();
/* 
I'm from static method
I'm from instance method
*/
Johnny
@JohnnyBizzel
Oct 09 2018 13:04
@Renaudcr7 Try Arial
Supra01
@Supra01
Oct 09 2018 13:21
Hello I hope everyone is doing well. I have a react.js question. I'm making a login component and I was wondering how can I call a function in a child component with another function in the parent component. Sorry I'm not wording this well so I have provided an example below:https://codesandbox.io/s/wkkwo59my5
Nicolas Ramirez
@kamatheuska
Oct 09 2018 13:26
@ezioda004 That's an awesome answer too!
Aditya
@ezioda004
Oct 09 2018 13:39

@Supra01 Not sure if I got this 100% correctly but you can pass the child function reference back to the parent and then parent can execute it.
Example:

class Parent extends Component {
  someHandler = func => {
    func(stuff);
  }
  render(){
    return (
       <Child passChildFuncToMe = {this.someHandler} />
     );
  }
}
class Child extends Component {
  anotherHandler = () => {
    this.props.passChildFuncToMe(this.someFunc);
  }
  someFunc = stuff => {
    //do something here
  }
  render(){
    return (
      <div onClick = {this.anotherHandler} />
    );
  }
}

In this example we're passing someFunc from <Child />component to <Parent /> component when the <div> in Child component is clicked.

Supra01
@Supra01
Oct 09 2018 13:40
Thanks @ezioda004 I will give that a try
Aditya
@ezioda004
Oct 09 2018 13:45
I suppose you could instead do onClick = {this.props.passChildFuncToMe(this.someFunc)}cutting the middle man anotherHandlerfunction.
May Kittens Devour Your Soul
@diomed
Oct 09 2018 14:02
Aditya
@ezioda004
Oct 09 2018 14:03
@diomed x
May Kittens Devour Your Soul
@diomed
Oct 09 2018 14:05
roll. this why we can't have memes :yum:
or mythical creatures
@ezioda004 can stuff like this jgthms/bulma#451 be achieved via css variables?
Aditya
@ezioda004
Oct 09 2018 14:09
Idk what I'm looking at
May Kittens Devour Your Soul
@diomed
Oct 09 2018 14:13
@ezioda004 you're looking @ margin/padding being controlled via sass
Ariel
@ArielLeslie
Oct 09 2018 14:14
@diomed Underwater Blues Clues?
May Kittens Devour Your Soul
@diomed
Oct 09 2018 14:15
indeed. smth. like that
Aditya
@ezioda004
Oct 09 2018 14:20
@diomed If it just uses preprocessor variables then I guess you could use CSS variables instead (dont quote me on that)
May Kittens Devour Your Soul
@diomed
Oct 09 2018 14:21
@ezioda004 could you take a look @ JS in my pen and tell me where I failed: pen
Aditya
@ezioda004
Oct 09 2018 14:23
@diomed Seems like you're missing a } before var chart
May Kittens Devour Your Soul
@diomed
Oct 09 2018 14:31
that was right, but it's all blank now
Aditya
@ezioda004
Oct 09 2018 14:35
Check console, there's a type error
abraham anak agung
@padunk
Oct 09 2018 14:51
@diomed all those curly braces... use vscode then
Renaud
@Renaudcr7
Oct 09 2018 15:28
@ezioda004 i dont think i needed to import them as they are already in the css library
Renaud
@Renaudcr7
Oct 09 2018 15:38
@JohnnyBizzel yeah that worked
Thank You!!
Ariel
@ArielLeslie
Oct 09 2018 15:38
@diomed Your series is inside the dataLabels object. It needs to be a property of options
The error is happening in the checkEmptySeries function because options.seriesis `undefined.
 t.series = this.checkEmptySeries(t.series),
 }
            }, {
                key: "checkEmptySeries",
                value: function(t) {
                    return 0 === t.length ? [{ // this is where "cannot read length of undefined" happens
                        data: []
                    }] : t
                }
            }
Renaud
@Renaudcr7
Oct 09 2018 15:39
Arial worked but the later one didnt
not able to find "Avenir" font anywhere
Aditya
@ezioda004
Oct 09 2018 15:48
@Renaudcr7 You could use Nunito instead, it looks similar to Avenir
Renaud
@Renaudcr7
Oct 09 2018 15:50
Yeah that'll work..thank you very much
an idea of d3
anybody know d3
Aditya
@ezioda004
Oct 09 2018 15:58
@anandpotukchi Sorry, havent done data vis section yet, try the other room
Niraj Nandish
@Nirajn2311
Oct 09 2018 16:22
@diomed what are you working on?
May Kittens Devour Your Soul
@diomed
Oct 09 2018 16:25
I was doing a chart for number of books in library
like, which category has most, which least.
@Nirajn2311 fix my CSS :yum:
Niraj Nandish
@Nirajn2311
Oct 09 2018 16:27
Wait until November second week, I’m booked until then by exams
May Kittens Devour Your Soul
@diomed
Oct 09 2018 16:27
but it's #Hacktober, man
Niraj Nandish
@Nirajn2311
Oct 09 2018 16:27
@diomed are you using d3
May Kittens Devour Your Soul
@diomed
Oct 09 2018 16:28
no
I used ApexCharts coz they already have done template :yum:
they actually have quite a few sets of done templates :)
I even managed to request a new one - non existed. haha :smirk_cat:
c
May Kittens Devour Your Soul
@diomed
Oct 09 2018 17:10
NaN
psyperl
@psyperl
Oct 09 2018 17:13
hello
May Kittens Devour Your Soul
@diomed
Oct 09 2018 17:15
hello, Indian person
psyperl
@psyperl
Oct 09 2018 17:15
lol I am not Indian
May Kittens Devour Your Soul
@diomed
Oct 09 2018 17:18
I know you aint Indian from India.
sorry I can't say hello in Native American Indian
psyperl
@psyperl
Oct 09 2018 17:21
lol
just use feather hat, you'll be fine
May Kittens Devour Your Soul
@diomed
Oct 09 2018 17:21
If I bow my hat all my fishes will fall out
psyperl
@psyperl
Oct 09 2018 17:30
https://learn.freecodecamp.org/responsive-web-design/basic-css/improve-compatibility-with-browser-fallbacks
i don't understand that challenge... as in .. why bother using it if it's not supported?
that would be duplicate code everywhere
May Kittens Devour Your Soul
@diomed
Oct 09 2018 17:31
what is not supported?
psyperl
@psyperl
Oct 09 2018 17:31
For example, if you use a CSS variable to assign a background color on a site, Internet Explorer will ignore the background color because it does not support CSS variables
May Kittens Devour Your Soul
@diomed
Oct 09 2018 17:32
oh, that dinosaur
Ariel
@ArielLeslie
Oct 09 2018 17:57
@psyperl Because IE exists.
psyperl
@psyperl
Oct 09 2018 17:59
^ another thing that i don't understand
Nicolas Ramirez
@kamatheuska
Oct 09 2018 18:03
hey people of narnja, I come with a question: One of my repos has just wake up with +100 vulnerabilties, from diferent dependencies. Since I cannot change directly those packages, how should I aproach that issue? Any chance I could ignore the warnings?
Aditya
@ezioda004
Oct 09 2018 18:15
@kamatheuska Newer npm have audits, you could do npm audit fix
Nicolas Ramirez
@kamatheuska
Oct 09 2018 18:18
@ezioda004 I did that a while ago, got a long and cryptic error, no changes
May Kittens Devour Your Soul
@diomed
Oct 09 2018 18:18
what is narnja? FFS
Meaningless statistics were up one-point-five per cent this month over last month.
Nicolas Ramirez
@kamatheuska
Oct 09 2018 18:19
:facepalm:
Aditya
@ezioda004
Oct 09 2018 18:19
@kamatheuska Hmm manually update packages? Seems like a lot of work, theres also npm audit fix --force but I'd use that with caution
Nicolas Ramirez
@kamatheuska
Oct 09 2018 18:19
@ezioda004 already tried
Aditya
@ezioda004
Oct 09 2018 18:20
@kamatheuska That doesnt work either?
Nicolas Ramirez
@kamatheuska
Oct 09 2018 18:20
it seems the vulnerabilities could be ignored
noup
I think is one of the packages that is kaput
Aditya
@ezioda004
Oct 09 2018 18:21
Its not a direct dependency right? Its in package.lock?
Tried npm audit fix --force in one of my projects which github was showing vulnerabilities, it fixed them.
Ogechi Ike
@BlackMG27
Oct 09 2018 18:22
Does anyone know of the spread operator? if so, could you look ay my code for the waypoint? Thanks in advance.
const sum = (function() {
  "use strict";
  return function sum(...x) {
   // const args = [ x, y, z ];
    return x.reduce((a, b) => a + b, 0);
  };
})();
console.log(sum(1, 2, 3)); // 6
May Kittens Devour Your Soul
@diomed
Oct 09 2018 18:23
Aditya
@ezioda004
Oct 09 2018 18:26
@diomed Does it support IE though?
@BlackMG27 That seems fine
With functions, its called Rest parameter (Opposite of Spread)
Ogechi Ike
@BlackMG27
Oct 09 2018 18:37
@ezioda004 The console said that I had to use the spread/rest operator on the args const, but when I do the console outputs NaN.
Aditya
@ezioda004
Oct 09 2018 18:43
@BlackMG27 Your example works in my console, I guess you're talking about this challenge? In that case you need to use args variable instead of x, so just replace x with args and it should pass the tests.
romule
@romule
Oct 09 2018 19:08
Hello. Have a problem with adding IMG to my title in HTML page. I look the answer in stackoverflow, Ive write in head -
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Liudmila Romashchenko - Painter, artists, designer
    </title>
    <link rel="LogoIcon" type="image/ico" href="logo.ico" />
</head>
Aditya
@ezioda004
Oct 09 2018 19:12
@romule Any error in the console? Also, is the path correct? Try changing rel to rel = "shortcut icon"
Ogechi Ike
@BlackMG27
Oct 09 2018 19:14
@ezioda004 thanks
it worked.
Nicolas Ramirez
@kamatheuska
Oct 09 2018 19:14
@ezioda004 it is in package.lock
@diomed oh my god that is the best repo in the whole github existence. I am crying hahaha
Aditya
@ezioda004
Oct 09 2018 19:16
@BlackMG27 Awesome :thumbsup:
Nicolas Ramirez
@kamatheuska
Oct 09 2018 19:16
I am on the floor haha
romule
@romule
Oct 09 2018 19:16
@ezioda004 wooow, why that. its kind of code or smth???? its help, thank u a lot but can u tell me more about it?
Aditya
@ezioda004
Oct 09 2018 19:19
@romule Yes, that rel attribute is what you use for favicons. You can read more about it here.
romule
@romule
Oct 09 2018 19:19
@ezioda004 again - THANKS A LOOT!
Aditya
@ezioda004
Oct 09 2018 19:20
No problem :smile:
romule
@romule
Oct 09 2018 19:20
:)
May Kittens Devour Your Soul
@diomed
Oct 09 2018 19:54
reme
psyperl
@psyperl
Oct 09 2018 20:29
rerne
Karma Drukpa
@coderkarma
Oct 09 2018 21:17
@ezioda004 are you online?
Aditya
@ezioda004
Oct 09 2018 21:18
@coderkarma Yes
Karma Drukpa
@coderkarma
Oct 09 2018 21:20
simple question to you. I got confused with inputs of this challenge, some are in objects and some are in arr.
let me show you the inputs
I just basically need to check the value are same or not.
Test.assertEquals(areEqual([{a:3},{b:4}],[{a:'3'},{b:'4'}]), false);
 Test.assertEquals(areEqual({a:[2,3],b:[4]},{b:[4],a:[2,3]}), true);
 Test.assertEquals(areEqual({adam:3, laura:4},{laura:4, adam:3}), true);
 Test.assertEquals(areEqual({adam:3, laura:4, maisie:2},{adam:3, laura:4}), false);
 Test.assertEquals(areEqual({a:3},{b:4},{b:3},{a:4}), false);
i could use every on this one right
or includes but I have to make sure values are same.
my confusion is inputs are in array, objects and string.
should I do for loop?
Aditya
@ezioda004
Oct 09 2018 21:27
@coderkarma Yes, that seems like a way to go
Bjorn van de Peut
@bjorno43
Oct 09 2018 21:27
So now ppl are contacting me and asking if I want to mentor them personally..
Aditya
@ezioda004
Oct 09 2018 21:27
@coderkarma For two objects to be equal, they need to have same key: value pair, you cant do === because objects are passed by reference
Karma Drukpa
@coderkarma
Oct 09 2018 21:28
@bjorno43 I do need your mentorship but that has to be free of cost though since I am broke now.
lol
Bjorn van de Peut
@bjorno43
Oct 09 2018 21:28
If only I had enough time on my hands to do that, lol
Aditya
@ezioda004
Oct 09 2018 21:28
@bjorno43 You'd be a great mentor
Bjorn van de Peut
@bjorno43
Oct 09 2018 21:29
@ezioda004 I know. I've actually been a mentor in real life for about a year, haha. Unfortunetely that school closed after
Karma Drukpa
@coderkarma
Oct 09 2018 21:31
@ezioda004 so I need to do for in loops over the obj?
Nicolas Ramirez
@kamatheuska
Oct 09 2018 21:31
I like more the idea of learning together. Being a sempai its to time consuming
Aditya
@ezioda004
Oct 09 2018 21:32
@coderkarma Correct
Bjorn van de Peut
@bjorno43
Oct 09 2018 21:32
It's just that mentoring takes up a lot of time. You can't do that for 15 minutes a day or something. So I can't fit it into my currently life. If I decided to do it, I'd have to charge people for it as it would mean quiting my currect job
Karma Drukpa
@coderkarma
Oct 09 2018 21:32
@bjorno43 I want you as my programming mentor.
Bjorn van de Peut
@bjorno43
Oct 09 2018 21:33
@coderkarma Haha thanks, that's nice of you to say
Perhaps at some point I'll write a udemy course or something. I've had many ppl request me to do that
Karma Drukpa
@coderkarma
Oct 09 2018 21:36
that would be perfect. You should do it.
Bjorn van de Peut
@bjorno43
Oct 09 2018 21:37
And hopefully somewhere soon, I'll start a bit of tutorial like livestream on twitch or Discord where I'll be creating a project like JSFiddle and Codepen
Karma Drukpa
@coderkarma
Oct 09 2018 21:37
@ezioda004[{a:3},{b:4}],[{a:'3'},{b:'4'}])
how can I do for in loop if it is an array?
Nicolas Ramirez
@kamatheuska
Oct 09 2018 21:43
@bjorno43 maybe you Mattias Johansson, with his youtube channel Fun Fun Function? That's a good reference to cool code mentor/teacher for me.
Bjorn van de Peut
@bjorno43
Oct 09 2018 21:48
@kamatheuska Maybe me what? Sorry, think something went wrong when you typed that one :P
Nicolas Ramirez
@kamatheuska
Oct 09 2018 21:52
know! maybe you know haha sorry
Bjorn van de Peut
@bjorno43
Oct 09 2018 21:53
Ah, lol. No I don't know him. I hardly ever watch youtube vids like that tbh :P
It's because I've seen a couple of PHP teaching vids over there that just made me cry. Too many bad practices or just plain wrong, deprecated code in those vids :P
Though that's not just in those vids
Bjorn van de Peut
@bjorno43
Oct 09 2018 21:58
Before I finished my master in C# software engineering 1.5 years ago, our teacher started to teach us MSSQL with code wide open to SQL injection. I almost kicked him out of the room for that :laughing:
Now the guy mails me from time to time to verify his material before he takes it to class :joy:
Karma Drukpa
@coderkarma
Oct 09 2018 22:17
@ezioda004 @bjorno43
function areEqual(value1, value2) {
  // loop through value1
  // check the key and value of value1 is equal to value2
  // if it is then return true or return false;
  for (let key in value1){
    if (JSON.stringify(value1[key]) === JSON.stringify(value2[key])){
      return true;
    }
  }
  return false;
}
this didn't work for all the test.
Bjorn van de Peut
@bjorno43
Oct 09 2018 22:26
@coderkarma Of course that doesn't work. Read the challenge again :)
Karma Drukpa
@coderkarma
Oct 09 2018 22:26
it say's key and the value right
Bjorn van de Peut
@bjorno43
Oct 09 2018 22:26
No it doesn't
Karma Drukpa
@coderkarma
Oct 09 2018 22:27
wait same values and same number
Bjorn van de Peut
@bjorno43
Oct 09 2018 22:27
"Create the areEqual function that will return true if the two supplied arguments hold exactly the same values and the same number of values (not necessarily in the same order) and false if they do not." --> "hold exactly the same values and the same number of values"
The keys don't even matter. They can be completely different
Karma Drukpa
@coderkarma
Oct 09 2018 22:28
okay
function areEqual(value1, value2) {
  for (let key in value1){
    if (value1[key] !== value2[key]){ 
return false;
    }
  }
  return true;
}
Manish Giri
@Manish-Giri
Oct 09 2018 22:31
won't you need to check for other data types
strings, etc
Karma Drukpa
@coderkarma
Oct 09 2018 22:34
@Manish-Giri doing typeof
Bjorn van de Peut
@bjorno43
Oct 09 2018 22:34
Ye, like @Manish-Giri says. I'd start with checking the data type. Then verifying array / object lengths. Then actually verify equality
Karma Drukpa
@coderkarma
Oct 09 2018 22:35
Okay thanks.
Aditya
@ezioda004
Oct 09 2018 22:57
@coderkarma Okay, I dont think its doable with just a loop, because there can be nested structures like [[[{a: [1, 2, 3]}]]] and so on
Your best bet would be to use recursion in some way
Could also use regex to flatten structures (I did it that way)
Karma Drukpa
@coderkarma
Oct 09 2018 22:59
yea that's right. that threw me off, i was console.logging it showed nested stuff and value2 being emtpy etc
in some test cases
Aditya
@ezioda004
Oct 09 2018 23:00
Lol, const areEqual = require('lodash').isEqual;
Karma Drukpa
@coderkarma
Oct 09 2018 23:00
flatten
wait what is that ?
I didn't get it.
const areEqual = require('lodash').isEqual;
Manish Giri
@Manish-Giri
Oct 09 2018 23:01
function areEqual(value1, value2) {
  return require("lodash").isEqual(value1, value2);
}
i didn't feel like changing function declaration, but essentially same idea
Karma Drukpa
@coderkarma
Oct 09 2018 23:02
what is lodash?
Manish Giri
@Manish-Giri
Oct 09 2018 23:02
utility library for JS
Aditya
@ezioda004
Oct 09 2018 23:02
Yeah, the former is passing the reference to the lodash's isEqual function
Manish Giri
@Manish-Giri
Oct 09 2018 23:02
lodash, underscore, etc
Aditya
@ezioda004
Oct 09 2018 23:03
Lodash's isEqual function checks for deep equality
Karma Drukpa
@coderkarma
Oct 09 2018 23:03
what require it doing there?
Manish Giri
@Manish-Giri
Oct 09 2018 23:04
gotta import the library to use it
Aditya
@ezioda004
Oct 09 2018 23:04
Its how you import in node.js
Its cheating lol, dont use that solution @coderkarma
Karma Drukpa
@coderkarma
Oct 09 2018 23:06
i tested at codewars that actually works but yeah I wouldn't do as of now, because i am not understanding what's going behind the scene.
Aditya
@ezioda004
Oct 09 2018 23:08
@coderkarma Its a relatively difficult problem for 6kyu, but yeah using here recursion would make most sense
Bjorn van de Peut
@bjorno43
Oct 09 2018 23:09
I'm working on it. Quite challenging indeed
Karma Drukpa
@coderkarma
Oct 09 2018 23:10
@ezioda004 so you did with recursion and fatten ?
okay
Bjorn van de Peut
@bjorno43
Oct 09 2018 23:10
This is what I have so far, lol:
function areEqual(value1, value2) {
  if(arguments.length > 2){ return false; }
  if(typeof(value1) === typeof(value2)){
    if(typeof(value1) === 'string'){
      if(value1 == value2){
        return true;
      }
    } else if(typeof(value1) === 'object'){
      if(Object.keys(value1).length === Object.keys(value2).length){
        for(let key in value1){
          if(value1.hasOwnProperty(key)){
            let result = Object.keys(value2).find(getkey => value2[getkey] === value1[key]);

            if(result === 'undefined' || result === null){
              return false;
            } else {
              continue;
            }
          }
        }
        return true;
      } else {
        return false;
      }
    }
  } else {
    return false;
  }
}
Karma Drukpa
@coderkarma
Oct 09 2018 23:11
wow @bjorno43 you are killing each edge cases.
Aditya
@ezioda004
Oct 09 2018 23:11
@coderkarma No, I didnt use recursion. I used regex and used a while loop until some condition was met. I'll try with recursion tomorrow (brain doesnt work at 4am)
Karma Drukpa
@coderkarma
Oct 09 2018 23:12
function areEqual(value1, value2) {
  console.log(`${JSON.stringify(value1, value2)}`);
  for (let key in value1){
    if (value1[key] !== value2[key] || value1.length === 0 && value2.length === 0){
      return false;
    }
  }
  return true;
}
@ezioda004 what time do you sleep?
damn
Aditya
@ezioda004
Oct 09 2018 23:13
@bjorno43 Some solutions are 100+ lines lol
Manish Giri
@Manish-Giri
Oct 09 2018 23:13
I think
Karma Drukpa
@coderkarma
Oct 09 2018 23:13
lol
Manish Giri
@Manish-Giri
Oct 09 2018 23:13
you can actually use Object.keys() on arrays and strings as well, to make the length comparison
Aditya
@ezioda004
Oct 09 2018 23:13
@coderkarma Oh I should be sleeping, will be off in a bit
Manish Giri
@Manish-Giri
Oct 09 2018 23:13
that way you can reuse the code for objects everywhere
thereby saving you a few lines
Bjorn van de Peut
@bjorno43
Oct 09 2018 23:13
Ghehe. I first check if more than 2 arguments are given. If so, fail. Then check if it's a string and compare. Then if object, loop through it and search if the value exists in the second object
Manish Giri
@Manish-Giri
Oct 09 2018 23:13
@bjorno43
Bjorn van de Peut
@bjorno43
Oct 09 2018 23:14
Thanks @Manish-Giri That'll help
Karma Drukpa
@coderkarma
Oct 09 2018 23:15
@ezioda004 alright. thanks for hint, i will try solving it. And goodnight. By the way are you attending college these days?