Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Jun 19 2020 20:09
    @krisb1220 banned @Gastony
  • May 14 2020 22:39
    @bjorno43 banned @minitechtips_twitter
  • May 14 2020 22:38
    @bjorno43 banned @real-action
  • Feb 01 2020 00:27
    @bjorno43 banned @Ndoua
  • Jan 07 2020 03:10
    @bjorno43 banned @doctor-sam
  • Aug 17 2019 09:32
    User @bjorno43 unbanned @linkin-park
  • Jun 20 2019 21:19
    @bjorno43 banned @shenerd140
  • Apr 25 2019 17:13
    @mstellaluna banned @cmal
  • Jan 08 2019 22:05
    @mstellaluna banned @dertiuss323
  • Nov 07 2018 04:42
    User @texas2010 unbanned @ows-ali
  • Nov 02 2018 16:25
    @texas2010 banned @ows-ali
  • Oct 12 2018 05:50
    @bjorno43 banned @NACH74
  • Oct 05 2018 23:02
    @mstellaluna banned @JomoPipi
  • Sep 16 2018 12:21
    @bjorno43 banned @yash-kedia
  • Sep 16 2018 12:16
    @bjorno43 banned @vnikifirov
  • Sep 05 2018 08:12
    User @bjorno43 unbanned @androuino
  • Sep 05 2018 07:38
    @bjorno43 banned @androuino
  • Aug 23 2018 16:57
    User @bjorno43 unbanned @rahuldkjain
  • Aug 23 2018 16:23
    @bjorno43 banned @rahuldkjain
  • Jul 29 2018 14:13
    User @bjorno43 unbanned @jkyereh
Ann Kaniga
@annkaniga
yes, is there any red line in console?
i mean browser console
Sweet Coding :)
@SweetCodingInc
@eabg Check this out
Ehidin
@eabg
yeah.. so its just having a problem with the ending script tag
ill check it out and let you know
Ehidin
@eabg
okay yeah I will start over using this method. it seems a lot easier to manage and read
Ehidin
@eabg
@SweetCodingInc :+1:
Sweet Coding :)
@SweetCodingInc
@eabg :+1:
John Hawke
@lolativiwe_twitter
function diffArray(arr1, arr2) {
    var newArr = arr1.concat(arr2);
    newArr.filter(function(index) {
        if (!arr1.includes(index) || !arr2.includes(index)) {
            return newArr;
        }
    });
    console.log(newArr);
}

diffArray([1, 2, 3, 5], [1, 2, 3, 4, 5]);
can someone tell me whats wrong with this?
it always returns the concatenated array of the two
Aditya
@ezioda004
@lolativiwe_twitter .filter() returns a new array and doesnt mutate the original one so you're returning the concatenated array from the 2nd line
John Hawke
@lolativiwe_twitter

oh lol...

newArr = newArr.filter(....

this worked

thanks @ezioda004
CamperBot
@camperbot
lolativiwe_twitter sends brownie points to @ezioda004 :sparkles: :thumbsup: :sparkles:
:cookie: 522 | @ezioda004 |http://www.freecodecamp.org/ezioda004
Stephen James
@sjames1958gm
@lolativiwe_twitter Since the function should return the new array
return newArr.filter(... would probably be the "best" solution as it makes it clear that the filter is the function result.
steve84
@raynor84
I'm trying to solve dna-pairing but i don't know how it works... why is GCG dna-pairing GC, CG, GC again
Stephen James
@sjames1958gm
@raynor84 Each character in the string is paired with its designated value G with C, C with G and G with C again.
@raynor84 The pairing values are given in the instructions
steve84
@raynor84
ok i get it thanks
@sjames1958gm thx
Aditya Dehal
@aditya2000
hello
Stephen James
@sjames1958gm
@sjames1958gm :+1:
quintik
@quintik
how do I get the name of the location from the coordinates?
for the weather app
Stephen James
@sjames1958gm
@Quantomistro3178 There is a name value in the JSON from the FCC URL
quintik
@quintik
oh. Thanks @sjames1958gm
CamperBot
@camperbot
quantomistro3178 sends brownie points to @sjames1958gm :sparkles: :thumbsup: :sparkles:
:star2: 9159 | @sjames1958gm |http://www.freecodecamp.org/sjames1958gm
Stephen James
@sjames1958gm
@Quantomistro3178 :+1: it is near the end
quintik
@quintik
yeah, I found it
is this ok?
Sweet Coding :)
@SweetCodingInc
@Quantomistro3178 looks okay to me
quintik
@quintik
but the the grey background is all messed up, idk what to do about that
Victor Popescu
@VicPopescu
@Quantomistro3178 what do you mean about gray background?
@Quantomistro3178 maybe something like "background-color: rgba(0,0,0,0.6)" for the "container" div would look a little more appealing?
if that's your concern
I think it looks ok and it works ok
Johny Sins
@JohnySi73551906_twitter

can someone tell me why

var arr = new Object();
    arr.first = "lorem";
    arr.last = "ipsum";
    console.log(arr.hasOwnProperty('first'));

returns true

but

var Arr = [{first: "lorem", last: "ipsum"}];
    console.log(Arr.hasOwnProperty('first'));

returns false

Victor Popescu
@VicPopescu
@JohnySi73551906_twitter because arr is an object and Arr is an array
console.log(Arr[0].hasOwnProperty('first'));
you do a for to iterate each object inside the array
Johny Sins
@JohnySi73551906_twitter
ok
Victor Popescu
@VicPopescu
if you have only 1 object inside the array you can use the [index] to access it, but if the number of objects is random or unknown you need a for loop
Johny Sins
@JohnySi73551906_twitter
thanks @VicPopescu
CamperBot
@camperbot
johnysi73551906_twitter sends brownie points to @vicpopescu :sparkles: :thumbsup: :sparkles: