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
Ricardo G.
@Rubenricardo
Ken Haduch
@khaduch
@Rubenricardo - because they are anchor elements (links) and that is the default color.
mazury
@mazury
Anybody knows how to chamge color when hovering over search results and another button? I want background color of those div to change, and so far i onlym managed do to it with random link button http://codepen.io/Adam92/pen/RKROPw?editors=0110
Martynas
@FlintMayers
@khaduch You mean using indexof inside the for loop in the destroy function? or I don't need the for loop at all this way?
MaxLAB
@Max-LAB
@FlintMayers it is because for loop checks only first array member and that is 2. for loop initialise every time new element came in.
Ken Haduch
@khaduch
@Rubenricardo - you can override that, using CSS. Also, you have a typo on one of your attributes for the socialmedia link - hrer instead of href
@FlintMayers - use indexOf instead of a for loop - because you don't need to do both.
Ricardo G.
@Rubenricardo
@khaduch thanks
CamperBot
@camperbot
rubenricardo sends brownie points to @khaduch :sparkles: :thumbsup: :sparkles:
:star2: 2287 | @khaduch |http://www.freecodecamp.com/khaduch
Martynas
@FlintMayers
@khaduch How would I pass the whole args array inside the indexOf?
Ken Haduch
@khaduch
@FlintMayers - since it is in scope, you can just reference it, but if you look at the filter method, you can pass an optional argument that can be referenced via the this variable within the function. You could try it that way.
@Rubenricardo - you're welcome
Martynas
@FlintMayers

@khaduch

function destroy(element){
     if(element.indexOf(args) != 1){
        return element;
     }
  }

IGives me an error

@khaduch why i can't check it like that?
@khaduch I know I am passing in the whole array. I just don't know how to loop throug it without a for loop
Ken Haduch
@khaduch
@FlintMayers - where you have the element you have to have args instead - because .indexOf is an Array method, so your variable has to be an array.
Ritvars
@RitvarsZ
@adamgithub92 kts easy in css
Ken Haduch
@khaduch
so args.indexOf(element) is what you want, and you can just (or should just) pass the result of the comparison back, so you should try return args.indexOf(element) == -1;
Martynas
@FlintMayers
@khaduch changed it. But know it does the opposite of what is asked of me
@khaduch it filters out the wrong values

function destroyer(arr) {
  // Remove all the values
  var args = [];
  for(var i = 1; i < arguments.length; i++){
    args.push(arguments[i]);
  }

  function destroy(element){
     if(args.indexOf(element) != -1){
        return element;
     }
  }


  return arr.filter(destroy);
}

destroyer([3, 5, 1, 2, 2], 2, 3, 5);
DarylKnapp
@DarylKnapp
Hey @jdtdesigns are you still in here at all?
Martynas
@FlintMayers
@khaduch returns 3,5,2,2 while it should only return 1
Ritvars
@RitvarsZ
@adamgithub92 just do `element:hover{ backround-color: color;}
Ken Haduch
@khaduch
@FlintMayers - instead of doing !=, do === --- so you are testing the opposite sense of the value
@FlintMayers - oh, and double check what I posted here: :point_up: January 16, 2017 10:43 AM
you don't want to return the element, but the result of the .indexOf lookup...
Martynas
@FlintMayers
@khaduch thanks. it's solved now but i didn't quite get it
CamperBot
@camperbot
flintmayers sends brownie points to @khaduch :sparkles: :thumbsup: :sparkles:
:star2: 2288 | @khaduch |http://www.freecodecamp.com/khaduch
MaxLAB
@Max-LAB
@adamgithub92 as @RitvarsZ mention, you could
.result-item:hover{
    background-color: red;
}
Ken Haduch
@khaduch
@FlintMayers - take a few minutes to study what is going on - re-read the .filter() documentation and if you have further questions, just post them!
Muhammad Hasham
@MuhammadHasham23
@khaduch can you help me with simon says game?
i am stuck at a function
Ken Haduch
@khaduch
@MohammadHasham - I haven't done that yet, but I can take a look...
Ajay Tanwar
@ajayt365
hey any good sass tutorials ?
mazury
@mazury
@RitvarsZ @Max-LAB yeah, i figured and tried that, but did't work
Muhammad Hasham
@MuhammadHasham23

https://codepen.io/Mohammad_Hasham/pen/JbWOWw?editors=1010

actually i am comparing user generated pattern with computer generated pattern and storing them in an array for comparison.The problem is in the compareArray function might be some logic mistake.
@khaduch

Ken Haduch
@khaduch
@ajayt365 - I had one that I started, not sure if it's the best, but here's a link: http://tutorialzine.com/2016/01/learn-sass-in-15-minutes/
Muhammad Hasham
@MuhammadHasham23
@khaduch
Ken Haduch
@khaduch
@MohammadHasham - I'll give it a shot...
Muhammad Hasham
@MuhammadHasham23
yeah i'll be really thankful
@khaduch
MaxLAB
@Max-LAB
@adamgithub92 I tried on your pen, and it worked. If desired behavior is to change background color when hover returned result item
ehutchllew
@ehutchllew
@MohammadHasham Doesn't let me click any of the buttons after the first round.
playingwithinfinity
@playingwithinfinity

What is wrong with this API call?

$(document).ready(function(){
  var url = 'http://api.wunderground.com/api/myKey/geolookup/conditions/forecast/q/Canada/Toronto.json';
  $.getJSON(url,function(data){
    var request = JSON.parse(data);
    console.log(request[0]);
  });
})

Nothing logs to the console.

Muhammad Hasham
@MuhammadHasham23
@ehutchllew what happens?
yeah actually that is the problem
it doesnt response to anything after the first round