These are chat archives for FreeCodeCamp/Help

10th
Mar 2015
Suzanne Atkinson
@AdventureBear
Mar 10 2015 00:28
That's a really good video up there!
Suzanne Atkinson
@AdventureBear
Mar 10 2015 01:05
Hello!
I have a solution for Missing Letters, that's almost there.
Cristián Berríos
@crisberrios
Mar 10 2015 01:10
hi!
never trust in almost while programming
substractive errors might lead you to think you are close
but in this case I bet you are close!
Suzanne Atkinson
@AdventureBear
Mar 10 2015 01:12
haha, well in your honor I even converted to an array so I could interate the string...but then that didn't work.
so I wnet back to string methods.
So it works for a missing letter if I remove the else return undefined part.
the loop goes through teh whole string, so my letter gets overwritten wiht undefined (I htink).
Suzanne Atkinson
@AdventureBear
Mar 10 2015 01:17
OK, @crisberrios this works, but is there a better way?
I'm sure there is...please direct... ;)
Cristián Berríos
@crisberrios
Mar 10 2015 01:18
what is the bonfire url?
Cristián Berríos
@crisberrios
Mar 10 2015 01:20
your code is pretty good
if (missing === "") {
    return undefined; 
} else {
    return missing; 
}
you can express that as
if (!missing) {
return missing
}
Suzanne Atkinson
@AdventureBear
Mar 10 2015 01:21
wow, I got a pretty good from you? Woohoo!
that's a cool trick
Cristián Berríos
@crisberrios
Mar 10 2015 01:21
other than that is pretty straightforward
you could turn the for loop into a reduce maybe, but for this task a simple for loop is more than good and very easy to read
Suzanne Atkinson
@AdventureBear
Mar 10 2015 01:22
yay!
at least I have iterators on the mind...will keep looking!
Cristián Berríos
@crisberrios
Mar 10 2015 01:22
missing = "";
remember to never, ever, ever define variables without using var xxxx
also that :P
Christopher Nguyen
@crosscris
Mar 10 2015 01:36
Hello, I'd like some help on assigning an element to a javascript variable via clicking.
I'm opening up a modal window and trying to copy my opener object into a modal.
Should I ask it here or nonprofit projects?
Cristián Berríos
@crisberrios
Mar 10 2015 01:40
you can ask here
are you using any library?
jQuery makes it very easy to do
but if not, you can crawl your way up using queryselector, events and properties
Christopher Nguyen
@crosscris
Mar 10 2015 01:41
Mix of both.
I activate overlay with...
$container.on("click", ".heart", function() {

 activateoverlay();
});
then activateoverlay holds
function activateoverlay() {
overlay.setAttribute('aria-hidden', 'false');
var heartSelected = 0;
}
the changing of the aria opens the overlay
and now....the heart that I clicked...must now be copied into the body of the overlay
Do you want me to invite you to c9?
and screen hero?
Cristián Berríos
@crisberrios
Mar 10 2015 01:46
can you wait a few minutes? I'm making bread as we speak
Christopher Nguyen
@crosscris
Mar 10 2015 01:47
Currently. I'm trying to put the heart selected into var heartSelected. And I'm hoping to pull it in by calling this. Sure.
yqyeoh
@yqyeoh
Mar 10 2015 01:48
how many bonfire challenges are there in total?
Cristián Berríos
@crisberrios
Mar 10 2015 01:52
@crosscris have you tried $(this).clone().appendTo('.overlay');?
or passing func($(this).html) and from inside the function $(html).appendTo('.overlay');
Avremel Kaminetzky
@avremel
Mar 10 2015 01:59
@yqyeoh 40 bonfires
Tyler Haas
@tylerthehaas
Mar 10 2015 02:25
Ok...so I am still confused how to use this equation T = 2pisqrt{a^3/mu} in map the debris
where does the earths radius fit in there
??
oh and avg altitude
Tyler Haas
@tylerthehaas
Mar 10 2015 02:31
I think avg altitude is the semi major axis
Cristián Berríos
@crisberrios
Mar 10 2015 02:40
^
Suzanne Atkinson
@AdventureBear
Mar 10 2015 02:55
stumped on Boo who so going to bed. (boo who)
Todd Smith
@tenspeed
Mar 10 2015 04:07
hey everyone
has anyone had trouble with the challenge pages loading on http://discover-devtools.codeschool.com/ for exercise 14?
Christopher Nguyen
@crosscris
Mar 10 2015 04:16
Hmm...been working allright with me.
Cristián Berríos
@crisberrios
Mar 10 2015 04:20
did the code work @crosscris ?
Christopher Nguyen
@crosscris
Mar 10 2015 04:30
It worked, but we ultimately decided to generate the heart on the fly rather than copying. Thank you though. Probably gonna need a similar operation again.
Darryl Dixon - Piece Digital
@piecedigital
Mar 10 2015 04:32
@tenspeed Yes, skip them. They're bugged.
well not the whole thing but at least watch the videos.
Ashley Drake
@aldraco
Mar 10 2015 11:35
collaboration question: is it better to have a team of people just do pull requests to a central repo, or should they all be admins of one repo? what's the best and most efficient workflow?
Nathan
@terakilobyte
Mar 10 2015 11:52
so..
each person would work on their own fork
with another remote set to the original repo
they’d work on their own branch, push to their own repo, then submit prs to the main repo
then they can fetch and merge the main repo back into their working repo
@aldraco that’s what two different senior devs have advised me to do now, and I’ve adopted it. It’s actually easy
Ashley Drake
@aldraco
Mar 10 2015 11:55
thanks @terakilobyte . that's what I was thinking, but wanted to make sure.
seems like it would keep things from getting messy
Nathan
@terakilobyte
Mar 10 2015 11:58
if you have a minute on screenhero I can explain the workflow a bit more
and a few other things they recommended
Ashley Drake
@aldraco
Mar 10 2015 11:59
thanks
Jorge
@jdesotoi
Mar 10 2015 13:41
hi im stuck in diff two arrays :( can some one guide me ?
Nareg Khoshafian
@nkhoshaf
Mar 10 2015 16:52
How many bonfire challenges are their total? How do I see my progress?
Oliver
@Dadsaster
Mar 10 2015 16:59
There are 40 - they are working on a mechanism to allow you to track your progress and review older bonfires but it isn't up yet. You can look at this for now: https://github.com/FreeCodeCamp/freecodecamp/blob/master/seed_data/bonfires.json
Tyler Haas
@tylerthehaas
Mar 10 2015 17:56
can someone help me with the logic they used to do the cash register challenge? I’m having trouble coming up with a good way to do it
Cristián Berríos
@crisberrios
Mar 10 2015 17:58
I haven't done that one
but I think it could be done with a "waterfall" approach
Tyler Haas
@tylerthehaas
Mar 10 2015 17:59
what does that mean
Cristián Berríos
@crisberrios
Mar 10 2015 17:59
when doing change, start popping from the biggest bills
and finish with the coins
watching if there's enough in the register
and first, you have to tokenize the available cash into some object
so you can keep track
Tyler Haas
@tylerthehaas
Mar 10 2015 18:01
thats a good way…how would I account for multiple bills…like if the change is only like 254 and I have 3 one hundreds how would I tell it to only take two of the one hundreds
Oliver
@Dadsaster
Mar 10 2015 18:08
You can use something like Math.floor() to get at how many times 100 goes into 254.
Vince
@Vince33
Mar 10 2015 18:47
Hey guys, any one into angular at the moment
?
Ashley Drake
@aldraco
Mar 10 2015 19:07
you can also use modulus
i'm pretty sure i did that in my solution.
Tyler Haas
@tylerthehaas
Mar 10 2015 19:20
so I got the cash register challenge except it is returning .5 instead of .50 anyone know the best way to fix this?
Darryl Dixon - Piece Digital
@piecedigital
Mar 10 2015 19:21
@haasDev It's not broken.
Tyler Haas
@tylerthehaas
Mar 10 2015 19:21
i know its not broken I just need to know how to change my code so it’ll return .50
let me post my code
function drawer(price, cash, cid) {
  var change = cash - price;
  console.log(change);
  var total = 0;
  var cidLength = cid.length;
  var values = [100, 20, 10, 5, 1, 0.25, 0.1, 0.05, 0.01];
  var money = {
    hundreds: Math.round(cid[8][1] / 100),
    twenties : Math.round(cid[7][1] / 20),
    tens : Math.round(cid[6][1] / 10),
    fives : Math.round(cid[5][1] / 5),
    ones : Math.round(cid[4][1] / 1),
    quarters : Math.round(cid[3][1] / 0.25),
    dimes : Math.round(cid[2][1] / 0.1),
    nickels : Math.round(cid[1][1] / 0.05),
    pennies : Math.round(cid[0][1] / 0.01)
  };
  var changeBills = [['ONE HUNDRED', 0], ['TWENTIES', 0], ['TENS', 0],['FIVES', 0],['ONES', 0], ['QUARTERS', 0], ['DIMES', 0], ['PENNIES', 0]];
  //use for loop to iterate through cid and return total cid
  for (var i = 0; i < cidLength; i++){
    total += cid[i][1];
  }
  total = Math.round(total*100) / 100;

  for (var prop in money){
    for (var i = 0; i < changeBills.length; i++){
      while (money[prop] > 0 && change >= values[i]){
        total -= values[i];
        money[prop]--;
        changeBills[i][1] += values[i];
        change -= values[i];
      }
    }
  }

  changeBills = changeBills.filter(function(arr){
    if (arr.indexOf(0) > -1){
      return false;
    }
    return true;
  });
  console.log(changeBills);
  //if total < change return 'Insufficient Funds'
  if (total < change){return 'Insufficient Funds';}
  //if total === change return 'Closed'
  if (total === change){return 'Closed';}
  //else return change.sort(highest -> lowest)
  // Here is your change, ma'am.
  return changeBills;
}

// Example cash-in-drawer array:
// [['PENNY', 1.01],
// ['NICKEL', 2.05],
// ['DIME', 3.10],
// ['QUARTER', 4.25],
// ['ONE', 90.00],
// ['FIVE', 55.00],
// ['TEN', 20.00],
// ['TWENTY', 60.00],
// ['ONE HUNDRED', 100.00]]

drawer(19.50, 20.00, [['PENNY', 1.01], ['NICKEL', 2.05], ['DIME', 3.10], ['QUARTER', 4.25], ['ONE', 90.00], ['FIVE', 55.00], ['TEN', 20.00], ['TWENTY', 60.00], ['ONE HUNDRED', 100.00]]);
may not be the best way to do it but it basically works
just dont know how to format it correctly
Darryl Dixon - Piece Digital
@piecedigital
Mar 10 2015 19:23
.toFixed();
Tyler Haas
@tylerthehaas
Mar 10 2015 19:24
where should I put that? on my return in the for…in?
Darryl Dixon - Piece Digital
@piecedigital
Mar 10 2015 19:26
When you save the value to the array.
[value] = [value].toFixed(2);
I believe.
Tyler Haas
@tylerthehaas
Mar 10 2015 19:36
for some reason I get an error
undefined is not a function
tried doing it with a map later down right before I return the array but still get the same thing
Oliver
@Dadsaster
Mar 10 2015 19:43
@haasDev I also don't see where you are testing to see if you have the proper funds. For example - you have 60 in $20s in the register but you need to return $80 in twenties. Your approach will return $80 in twenties even though they aren't available.
Tyler Haas
@tylerthehaas
Mar 10 2015 19:47
I thought money[prop] > 0 would check if there are any twenties available to be used
would that not work?
Oliver
@Dadsaster
Mar 10 2015 19:49
take a look: drawer(.01, 100.00, [['PENNY', 1.01], ['NICKEL', 2.05], ['DIME', 3.10], ['QUARTER', 4.25], ['ONE', 90.00], ['FIVE', 55.00], ['TEN', 20.00], ['TWENTY', 60.00], ['ONE HUNDRED', 100.00]]);
Tyler Haas
@tylerthehaas
Mar 10 2015 19:50
yeah thats what I’m working through right now…why is my test not working in the while loop?
Oliver
@Dadsaster
Mar 10 2015 19:53
Also - why does the above input not return any pennies?
Tyler Haas
@tylerthehaas
Mar 10 2015 19:56
probably because its returning too many twenties so its less than 1 sent when it gets down to pennies
1 cent sorry
Oliver
@Dadsaster
Mar 10 2015 19:58
It happens if I send in $20 instead of $100 too
Tyler Haas
@tylerthehaas
Mar 10 2015 20:06
so the twenties are acting weird for some reason
it first starts at 1 and then is decremented to 0 and then starts over at the correct amount of 20’s
Oliver
@Dadsaster
Mar 10 2015 20:12
It's a complicated approach. Maybe try and think of a way to simplify? Do you really need an object and two arrays to solve this?
Tyler Haas
@tylerthehaas
Mar 10 2015 20:13
there probably is a better way I just don’t know what it is
Oliver
@Dadsaster
Mar 10 2015 20:20
The approach I took involved reversing the input array "cid" and creating a baseValue array like this [100, 20, 10, 1, etc.]. This way you can iterate through both with a for loop as there indexes will align. You can also read about parseInt. and .toPrecision(). That might help you. Let me know if this helps at all.
Suzanne Atkinson
@AdventureBear
Mar 10 2015 20:21
Anyone know of a native fuction to test for primitiveness of Boolean's (Boo Hoo) challenge. This code passes, but I'm wondering if there is a better, slicker way)
Oliver
@Dadsaster
Mar 10 2015 20:29
function boo(bool) {
 return typeof bool === "boolean";
}
I think that's as slick as it gets.
Suzanne Atkinson
@AdventureBear
Mar 10 2015 20:34
that's what I was looking for but i couldn't get typeof to work
Avremel Kaminetzky
@avremel
Mar 10 2015 20:34
function primeFactorization(num){

  var root = Math.sqrt(num), 
  result = arguments[1] || [],  //get unnamed paremeter from recursive calls
  x = arguments[2] || 2; 
  if(x === 2 && num % x){//if not divisible by 2 
   x = 3;//assign first odd
  }

  while((num % x) && ((x = x + 2) < root)){}//iterate odds
  //if no factor found then num is prime
  x = (x <= root) ? x : num;
  result.push(x);//push latest prime factor

  //if num isn't prime factor make recursive call
  return (x === num) ? result : primeFactorization(num/x, result, x) ;
}
I am doing Smallest Common Multiple bonfire and found this code online to get prime factorization. Can someone explain “arguments1” at the beginning of the code, where was the arguments array created?
Suzanne Atkinson
@AdventureBear
Mar 10 2015 20:35
@Dadsaster why doens't this version work? I can't see what's wrong with it
also @Dadsaster where can I read more about taht streamlined code you have above, whci looks like a short version of an if () else statement?
Oliver
@Dadsaster
Mar 10 2015 20:44
@AdventureBear here is the long version:
function boo(bool) {
    if (typeof bool === "boolean") {
        return true;
    } else {
        return false;
    }
}
The key is understanding the short code is paying attention to what bool === "boolean" can evaluate to. It turns out it can only be true or false. In either case I simply want to return whatever bool === "boolean" evaluates to - either true or false. You should get to understand the short version because it is much more common than the long version.
Suzanne Atkinson
@AdventureBear
Mar 10 2015 20:47
I think you or someone shared that yesterday with me.
Looks liek I'm just using typeof incorrectly for one thing
thanks!
Tyler Haas
@tylerthehaas
Mar 10 2015 20:48
@Dadsaster I’m not sure how I can use the reversed array in a for loop…can you explain your logic a little further for me?
Suzanne Atkinson
@AdventureBear
Mar 10 2015 20:49
OK, I got it now! Using typeof correctly in my 'longform' code.
Oliver
@Dadsaster
Mar 10 2015 20:51
Sure - if you reverse the input array and you iterate through your base value array the value of each when i = 0 will be (baseVal[0]) = 100 and (reverseIn[0]) = ['ONE HUNDRED', 1]
you have all the information you need available to you to make change
Suzanne Atkinson
@AdventureBear
Mar 10 2015 20:52
@Dadsaster and I got the short form to work. It works b/c the expression evaluates to some value, and i'm just returing that value, so I don't kneed the longer if then else statement at all. it's not that it's a short version of an if then statement, it's just a better way to return the result of the expression in this case. Thinking out loud here
Oliver
@Dadsaster
Mar 10 2015 20:52
@AdventureBear Yes!
Suzanne Atkinson
@AdventureBear
Mar 10 2015 20:54
@Dadsaster awesome! Thanks for the help. VERY SLOWLY these things are sinking in...
Oliver
@Dadsaster
Mar 10 2015 20:56
The logic of making change is just - if change > baseVal[i] and reverseIn[i][1] has what we need... - if you progress through the array of money values in reverse order and update your totals as you go you should end up with the correct output array.
Jorge
@jdesotoi
Mar 10 2015 21:00
can some one guide me or give me some read materaial for Check if a value is classified as a boolean primitive. Return true or false.
Suzanne Atkinson
@AdventureBear
Mar 10 2015 21:02
look above!
or post what you've tried already
I can help. :)
Avremel Kaminetzky
@avremel
Mar 10 2015 21:05
anyone?
kian
@meecoder
Mar 10 2015 21:08
@avremel what do you need help with?
Avremel Kaminetzky
@avremel
Mar 10 2015 21:09
Smallest Common Multiple bonfire, I am trying to figure out how to do prime factorization, any good resources? All i found was this http://jsfiddle.net/CodeRenaissance/9LD2u/, but don’t understand the code...
kian
@meecoder
Mar 10 2015 21:10
@avremel nested for loops or something? i don't know, haven't finished that one
Suzanne Atkinson
@AdventureBear
Mar 10 2015 21:10
i havn't done it yet either
Avremel Kaminetzky
@avremel
Mar 10 2015 21:10
@meecoder It’s a little more complex :smile: I had to brush up on a lot of math
I am at the point that if I understand how someone else coded it, I will be a happy person
Avremel Kaminetzky
@avremel
Mar 10 2015 21:15
@Dadsaster Thanks
Christian
@crisxian
Mar 10 2015 21:26
can someone help me decipher this question to english? http://www.freecodecamp.com/bonfires/pairwise
nvm I think I figured it out
Oliver
@Dadsaster
Mar 10 2015 21:30
[1,4,2,3,0,5], 5 means look through the array [1,4,2,3,0,5] and pair up elements in the array that total to 5. In this example 1 + 4 is one pair , 2+3 is another and 0+5 is the last. The return would be 3 because you could add to 5 three times.
Suzanne Atkinson
@AdventureBear
Mar 10 2015 21:49
^^ I can use that for a cribbage simulation!
^^ my blog about the call stack/ event loop
Christian
@crisxian
Mar 10 2015 21:50
@Dadsaster it was actually more convuluted than that... it was sum of the indices arr[0] = 1, arr[1] = 4, arr[2]=2, arr[3]=3, arr[4]=0, arr[5]=5. so it was 0+1+2+3+4+5 = 15...
and can't use a key in value[key] more than once
I guess parsing specs is the hard part, just like in the real world
Tyler Haas
@tylerthehaas
Mar 10 2015 22:12

@Dadsaster is this close to how you did it? I cant get the final test to pass…can you look at what I am doing wrong still
```
function drawer(price, cash, cid) {
var change = cash - price;
console.log(change);
var baseVal = [100, 20, 10, 5, 1, 0.25, 0.10, 0.05, 0.01];
var reverseIn = cid.reverse();
var total = 0;

for (var i = 0; i < cid.length; i++){
total += cid[i][1];
}

/Sure - if you reverse the input array and you iterate through your base value array the value of each when i = 0 will be (baseVal[0]) = 100 and (reverseIn[0]) = ['ONE HUNDRED', 1]
you have all the information you need available to you to make change. The logic of making change is just - if change > baseVal[i] and reverseIn[i][1] has what we need... - if you progress through the array of money values in reverse order and update your totals as you go you should end up with the correct output array.
/
//if total < change return 'Insufficient Funds'
if (total < change){return 'Insufficient Funds';}
//if total === change return 'Closed'
if (total === change){return 'Closed';}

for (var i = 0; i < reverseIn.length; i++){
if(change > baseVal[i] && reverseIn[i][1] > change){
var num = change / baseVal[i];
num = num.toPrecision(1);
reverseIn[i][1] = num * baseVal[i];
change -= reverseIn[i][1];
} else {
reverseIn[i][1] = 0;
}
}

reverseIn = reverseIn.filter(function(arr){
if (arr.indexOf(0) > -1){
return false;
}
return true;
});

// Here is your change, ma'am.
return reverseIn;
}

// Example cash-in-drawer array:
// [['PENNY', 1.01],
// ['NICKEL', 2.05],
// ['DIME', 3.10],
// ['QUARTER', 4.25],
// ['ONE', 90.00],
// ['FIVE', 55.00],
// ['TEN', 20.00],
// ['TWENTY', 60.00],
// ['ONE HUNDRED', 100.00]]
drawer(19.50, 20.00, [['PENNY', 1.01], ['NICKEL', 2.05], ['DIME', 3.10], ['QUARTER', 4.25], ['ONE', 90.00], ['FIVE', 55.00], ['TEN', 20.00], ['TWENTY', 60.00], ['ONE HUNDRED', 100.00]]);

@Dadsaster is this close to how you did it? I cant get the final test to pass…can you look at what I am doing wrong still
function drawer(price, cash, cid) {
  var change = cash - price;
  console.log(change);
  var baseVal = [100, 20, 10, 5, 1, 0.25, 0.10, 0.05, 0.01];
  var reverseIn = cid.reverse();
  var total = 0;

  for (var i = 0; i < cid.length; i++){
    total += cid[i][1];
  }

  /*Sure - if you reverse the input array and you iterate through your base value array the value of each when i = 0 will be (baseVal[0]) = 100 and (reverseIn[0]) = ['ONE HUNDRED', 1]
you have all the information you need available to you to make change. The logic of making change is just - if change > baseVal[i] and reverseIn[i][1] has what we need... - if you progress through the array of money values in reverse order and update your totals as you go you should end up with the correct output array.*/
  //if total < change return 'Insufficient Funds'
  if (total < change){return 'Insufficient Funds';}
  //if total === change return 'Closed'
  if (total === change){return 'Closed';}

  for (var i = 0; i < reverseIn.length; i++){
    if(change > baseVal[i] && reverseIn[i][1] > change){
      var num = change / baseVal[i];
      num = num.toPrecision(1);
      reverseIn[i][1] = num * baseVal[i];
      change -= reverseIn[i][1];
    } else {
      reverseIn[i][1] = 0;
    }
  }

  reverseIn = reverseIn.filter(function(arr){
    if (arr.indexOf(0) > -1){
      return false;
    }
    return true;
  });

  // Here is your change, ma'am.
  return reverseIn;
}

// Example cash-in-drawer array:
// [['PENNY', 1.01],
// ['NICKEL', 2.05],
// ['DIME', 3.10],
// ['QUARTER', 4.25],
// ['ONE', 90.00],
// ['FIVE', 55.00],
// ['TEN', 20.00],
// ['TWENTY', 60.00],
// ['ONE HUNDRED', 100.00]]
drawer(19.50, 20.00, [['PENNY', 1.01], ['NICKEL', 2.05], ['DIME', 3.10], ['QUARTER', 4.25], ['ONE', 90.00], ['FIVE', 55.00], ['TEN', 20.00], ['TWENTY', 60.00], ['ONE HUNDRED', 100.00]]);
I think i’m not getting how to decide whether we have what we need
Suzanne Atkinson
@AdventureBear
Mar 10 2015 22:41
onto sorted unions... I'm getting the proper elements returned for the first 2 arrays. I'm having trouble identifying that the 3rd set is already contained in my union and skipping over it. Here I have it commneted out and just have some testing that shows it can't find the number '2' inside of an array which Does contain 2, using arr.indexOf
Suzanne Atkinson
@AdventureBear
Mar 10 2015 23:00
@crisberrios I'm trying to use iterators and built in array methods. but also struggling with the nested/not-nested requirements of the bonfire. @terakilobyte
Cristián Berríos
@crisberrios
Mar 10 2015 23:04
it would be better if you use filter instead of forEach
forEach is only a masked for loop
map-reduce-filter is the "holy trinity" of iterators
Nathan
@terakilobyte
Mar 10 2015 23:20
map reduce and filter internally use forEach as an fyi
Suzanne Atkinson
@AdventureBear
Mar 10 2015 23:26
@terakilobyte that sounds super insightful...could you add some puntuation though? Not sure I follow
@crisberrios thanks, I'll try that next. Still getting the hang of things.
at least I get some output
Nathan
@terakilobyte
Mar 10 2015 23:26
no no, I was just saying map filter and reduce use forEach to iterate
cris is right about using filter
Suzanne Atkinson
@AdventureBear
Mar 10 2015 23:26
what you say about forEach makes sense maybe that's why I am more comfortable with it
Nathan
@terakilobyte
Mar 10 2015 23:26
you’ve essentially recreated it in your repl
so I’d do these steps
Suzanne Atkinson
@AdventureBear
Mar 10 2015 23:27
I've recreated filter?
Nathan
@terakilobyte
Mar 10 2015 23:27
yes
Suzanne Atkinson
@AdventureBear
Mar 10 2015 23:27
cool!
Nathan
@terakilobyte
Mar 10 2015 23:27
steps
Suzanne Atkinson
@AdventureBear
Mar 10 2015 23:27
still i should learn filter
Nathan
@terakilobyte
Mar 10 2015 23:27
you should
steps...
a. figure out how to iterate over arguments
b. if using map to do so (you should), you need to flatten one level to have a concatenated array
c. remove duplicates
b.5 sort ;)
sorting before removing duplicates will make it super easy
Suzanne Atkinson
@AdventureBear
Mar 10 2015 23:32
the instructions for THIS bonfire said to sort by array, but not within the array?
Nathan
@terakilobyte
Mar 10 2015 23:32
if an array has subarrays then no, don’t sort
Suzanne Atkinson
@AdventureBear
Mar 10 2015 23:32
also when arr1,arr2,arr3 are passed, are they still arguments to be iteratd over? (as opposed to passing 3 arrays in one argument.) am I making any sense?
Nathan
@terakilobyte
Mar 10 2015 23:32
though looking at it I might make a follow on one that you should do so
Suzanne Atkinson
@AdventureBear
Mar 10 2015 23:32
thanks I'll examine this this evening.
Nathan
@terakilobyte
Mar 10 2015 23:33
Suzanne Atkinson
@AdventureBear
Mar 10 2015 23:33
Ok, cool.
Nathan
@terakilobyte
Mar 10 2015 23:33
you can use filter to remove duplicates
Suzanne Atkinson
@AdventureBear
Mar 10 2015 23:33
did you see my blog post on callbacks?
Nathan
@terakilobyte
Mar 10 2015 23:33
I didn’t, send me the link
off to work!
I'm off to work too! overnight call shift. We are in sync! :)
Cristián Berríos
@crisberrios
Mar 10 2015 23:36
see you Suzanne
Priscilla P. Wood
@RailsGirl
Mar 10 2015 23:36
Hi CFF people!
FCC lol
kian
@meecoder
Mar 10 2015 23:36
@RailsGirl lol CFF :) hello!
Priscilla P. Wood
@RailsGirl
Mar 10 2015 23:37
oh hi:)
too much code today!
kian
@meecoder
Mar 10 2015 23:37
@railsgirl I've been at school
so not much coding for me
Priscilla P. Wood
@RailsGirl
Mar 10 2015 23:38
well, today is my day off so that’s why...
Cristián Berríos
@crisberrios
Mar 10 2015 23:38
hi @RailsGirl
Suzanne Atkinson
@AdventureBear
Mar 10 2015 23:38
@crisberrios it's a call shift, so I'll still be nosing around in here and playing with code n other stuff.
Priscilla P. Wood
@RailsGirl
Mar 10 2015 23:38
I’ve been doing the challenges but not in order, I was wondering if it matters...
hi @crisberrios
Suzanne Atkinson
@AdventureBear
Mar 10 2015 23:38
@RailsGirl do them in the order that makes sense to you
Cristián Berríos
@crisberrios
Mar 10 2015 23:38
sometimes it does, sometimes not really
but save the bonfires for the last
Suzanne Atkinson
@AdventureBear
Mar 10 2015 23:39
listen to @crisberrios
Priscilla P. Wood
@RailsGirl
Mar 10 2015 23:39
I just try to pick whatever fits depending on the amount of time I have :/
Cristián Berríos
@crisberrios
Mar 10 2015 23:39
or at least do every js-related challenge first
Priscilla P. Wood
@RailsGirl
Mar 10 2015 23:39
oh i see, I thought about doing both simultaneously
kian
@meecoder
Mar 10 2015 23:40
lol... I'd forgotten what 2-sided sound was like because I'd been using half-broken headphones until now...
Priscilla P. Wood
@RailsGirl
Mar 10 2015 23:41
oh that’s interesting, I hacked the terminal today and now I have only one-side earbuds working
Cristián Berríos
@crisberrios
Mar 10 2015 23:46
one is better than zero
but I couldn't live without a good pair of headphones
kian
@meecoder
Mar 10 2015 23:48
@crisberrios I agree :)
Priscilla P. Wood
@RailsGirl
Mar 10 2015 23:48
True.