These are chat archives for FreeCodeCamp/HelpJavaScript

May 2018
May 28 2018 00:21
May 28 2018 01:32
hello all i have some problem i want to solve in the middle distance needs to be a square but i need a automatically resize when its ot of range here some picture examples
i dont know how to approach this
im a beginner and this is learning project for me
Vikash Saini
May 28 2018 06:09
Any React-Native developer
May 28 2018 06:22
arguments optional
Ayush Kumar
May 28 2018 08:13
can anyone help why there is margin on the left of these cards
abraham anak agung
May 28 2018 08:25
@Gr8ayu because you type it on css? line 9?
Pieter Stokkink
May 28 2018 11:22
@Gr8ayu because you use bootstrap? container / container-fluid have some default margins/paddings
Nate Mallison
May 28 2018 11:29
@ezioda004 Now I understand what you are getting at, I believe what is being confusing is not Object's prototype behavior but instanceof. See #4 in the drawbacks of using classes here. Then checkout the instanceof docs. It states right in there that Object instanceof Object returns true despite an undefined prototype. Also proto is not recommended for use as it's implementation wasn't standardized until ECMA 2015.
Nate Mallison
May 28 2018 11:35
Also interestingly:
console.log(Object.getPrototypeOf(Object)); //[function]
console.log(Object.getPrototypeOf(Function)); //[function]
And if you type Object or Function in your browser console:
Screen Shot 2018-05-28 at 7.36.18 AM.png
Nate Mallison
May 28 2018 11:53
Also I think proto is just returning null in your examples of going up the chain, so you're just comparing null to null
Screen Shot 2018-05-28 at 7.52.32 AM.png
May 28 2018 12:30
hi guys, i have a question please. So i'm trying to get an equivalent of in es5 and i decided to go with the for..each loop (?). In practice, i am trying to fetch json data (contacts from a server, i'm trying to build contact list) from a backend and serve it up. Only problem is , i'd love it if it was able to be arranged alphabetically following the kitchen sink provided in a UI library i am using. Can anyone give me a quick primer on how to effect an alphabetic listing from json using a for..each loop? :(
Stephen James
May 28 2018 12:32
@jeffersonnnn es5 has map on array
May 28 2018 12:38
@sjames1958gm does it function the exact same way that map with es6 does?
Stephen James
May 28 2018 12:48
@jeffersonnnn Yes, I believe so
@jeffersonnnn You could have backend serve it sorted
May 28 2018 13:15
Object instanceof Function // true
Function instanceof Object // true
Is this a kind of recursive definition? Like Hurd/Hird?
May 28 2018 13:22

@jeffersonnnn What is a for..each loop? I know regular for (you do everything manually), (you get the enumerable properties, usually numeric properties in ascending order and non-numeric in the order of insertion but no guarantee on that), and for..of (you get values of an interable, but no keys).

Do you have an array? If so, you can sort.

Aakash Srivastav
May 28 2018 16:53
Hey friends
Dimitris Nik.
May 28 2018 17:05
Hey there, I am doin the wiki viewer project and I really, cant find the part, how to get the "May refer to..." url...You know, when you search for something that has many different meanings...
At that time I am here:|pageimages|info|linkshere&inprop=url
May 28 2018 17:22
@Dimitrios51 Those are called disambiguation pages, there are a few options listed here depending on what you want to do with the disambiguation page:
const url = "" +
            "?action=query" +
            "&format=json" +
            "&formatversion=2" +
            "&titles=hacks" +
            "&prop=description|pageimages|info|linkshere" +
            "&inprop=url" +
            "&list=querypage" +
            "&qppage=DisambiguationPageLinks" +

  .then(res => res.json())
  .then(data => {
    console.log(data.query.pages[0].linkshere) // gives all the disambiguation page links