These are chat archives for FreeCodeCamp/HelpJavaScript

28th
May 2018
Aditya
@ezioda004
May 28 2018 00:21
:thumbsup:
dyongerwen
@dyongerwen
May 28 2018 01:32
@dyongerwen
good.jpg
bug.jpg
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
@Enigma10
May 28 2018 06:09
Any React-Native developer
dadafather
@wangkui1991
May 28 2018 06:22
arguments optional
Ayush Kumar
@Gr8ayu
May 28 2018 08:13
can anyone help why there is margin on the left of these cards https://codepen.io/gr8ayu/pen/ELrRXp?editors=1100
abraham anak agung
@padunk
May 28 2018 08:25
@Gr8ayu because you type it on css? line 9?
Pieter Stokkink
@forkerino
May 28 2018 11:22
@Gr8ayu because you use bootstrap? container / container-fluid have some default margins/paddings
Nate Mallison
@NJM8
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
@NJM8
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
@NJM8
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
Jefferson
@jeffersonnnn
May 28 2018 12:30
hi guys, i have a question please. So i'm trying to get an equivalent of array.prototype.map 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
@sjames1958gm
May 28 2018 12:32
@jeffersonnnn es5 has map on array
Jefferson
@jeffersonnnn
May 28 2018 12:38
@sjames1958gm does it function the exact same way that map with es6 does?
Stephen James
@sjames1958gm
May 28 2018 12:48
@jeffersonnnn Yes, I believe so
@jeffersonnnn You could have backend serve it sorted
Blauelf
@Blauelf
May 28 2018 13:15
Object instanceof Function // true
Function instanceof Object // true
Is this a kind of recursive definition? Like Hurd/Hird?
Blauelf
@Blauelf
May 28 2018 13:22

@jeffersonnnn What is a for..each loop? I know regular for (you do everything manually), for..in (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
@aakashsr
May 28 2018 16:53
Hey friends
Dimitris Nik.
@dimitrissnk
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: https://en.wikipedia.org/w/api.php?action=query&format=json&titles=hacks&prop=description|pageimages|info|linkshere&inprop=url
Gulsvi
@gulsvi
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: https://www.mediawiki.org/wiki/Extension:Disambiguator
const url = "https://en.wikipedia.org/w/api.php" +
            "?action=query" +
            "&format=json" +
            "&formatversion=2" +
            "&titles=hacks" +
            "&prop=description|pageimages|info|linkshere" +
            "&inprop=url" +
            "&list=querypage" +
            "&qppage=DisambiguationPageLinks" +
            "&origin=*";

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