These are chat archives for FreeCodeCamp/HelpJavaScript

5th
Aug 2016
BeefHazard
@BeefHazard
Aug 05 2016 00:00 UTC
@nickeyvee statement two is where num comes in. num is just any number and so is i! So we can make sure that it will only run if i is also a number given by num. Translated to code: i <= num because i can never be bigger than num
@nickeyvee now every time the loop has ran, we want to increase i by one so the loop can continue running. This is statement 3: i++
now go ahead and implement that first
Nicholas Vorraso
@nickeyvee
Aug 05 2016 00:03 UTC
@BeefHazard i see
Skasper1
@Skasper1
Aug 05 2016 00:04 UTC

@Skasper1
can some one help me figure out why this isn't working.
var count = 0;

function cc(card) {
// Only change code below this line

var result = 0;
if(card >1 && card< 7){
result = ++count;
return (result +" "+"Bet");
}

else if (card >6 && card <10){ //result = 0; if(count>0){
return count+" Bet";
}
return (count +" " +"Hold");
}else{
result = --count;
return (result +" "+"Hold");
}

// Only change code above this line
}

cc(2); cc(2); cc(10);

Nicholas Vorraso
@nickeyvee
Aug 05 2016 00:04 UTC
@BeefHazard my next step would be to figure out how to decrease num until it us equal to 0
so if num == 5, i need to return 4, 3, 2, 1.
Brendan Kinahan
@BKinahan
Aug 05 2016 00:05 UTC
Here's a super neat regex debugger I haven't seen before: https://www.debuggex.com/
Diego Mayer
@Chrono79
Aug 05 2016 00:06 UTC
@Skasper1 don't return when evaluating card
Nicholas Vorraso
@nickeyvee
Aug 05 2016 00:06 UTC
including 5 actually
Mois茅s Man
@moigithub
Aug 05 2016 00:06 UTC
@nickeyvee factorial. u need to multiply numbers.. but
5*4*3*2*1
will give same result as 1*2*3*4*5
BeefHazard
@BeefHazard
Aug 05 2016 00:06 UTC
@moigithub can you explaing factorial to him properly? it messes with my head too much :joy:
Nicholas Vorraso
@nickeyvee
Aug 05 2016 00:06 UTC
@moigithub haha yes its the factorial
@moigithub im not sure where i got that order from
Diego Mayer
@Chrono79
Aug 05 2016 00:08 UTC
@Skasper1 do a separate if/else and evaluate count value there and return there too
caseytherocket
@caseytherocket
Aug 05 2016 00:09 UTC

Question for the community:

What is the ONE single most important thing to learn in JavaScript?

Promise Tochi
@Promhize
Aug 05 2016 00:09 UTC
yay!!!! i'm finally almost there with my tic tac toe code, this is the most difficult and tricky yet, phew!!
BeefHazard
@BeefHazard
Aug 05 2016 00:11 UTC
@caseytherocket when and how to use loops
Skasper1
@Skasper1
Aug 05 2016 00:11 UTC
@Chrono79 can you show me what that looks like, its kinda confusing
Promise Tochi
@Promhize
Aug 05 2016 00:12 UTC
@caseytherocket the most important thing is fully understand the basics i think, and then understand things like closures, recursion, lexical scoping, the tricky parts
Diego Mayer
@Chrono79
Aug 05 2016 00:12 UTC
@Skasper1
if (card>1 && card <7) {
  count++;
} else {
  ...
}

if (count < 0) {
  return ...
} else { 
  return ...
}
Promise Tochi
@Promhize
Aug 05 2016 00:12 UTC
douglas crockfords has a small book for javascript good parts @caseytherocket
caseytherocket
@caseytherocket
Aug 05 2016 00:12 UTC
@Promhize you can only choose "ONE" thing 馃槤
Mike
@MikeJSchorah
Aug 05 2016 00:12 UTC
@caseytherocket Patience
caseytherocket
@caseytherocket
Aug 05 2016 00:13 UTC
haha patience is probably right!
Mois茅s Man
@moigithub
Aug 05 2016 00:13 UTC
@caseytherocket where to find documentation :)
Mike
@MikeJSchorah
Aug 05 2016 00:13 UTC
@Promhize I read that. Good book. Not as good as A Smarter Way to Learn JavaScript, though.
Eddie
@Ndaraya
Aug 05 2016 00:14 UTC
Yes, eaves dropping on this. Lol
Promise Tochi
@Promhize
Aug 05 2016 00:14 UTC
@caseytherocket okay, i'd say the most thing is javascript's functional programming related parts
Eddie
@Ndaraya
Aug 05 2016 00:14 UTC
@caseytherocket shed light please
Promise Tochi
@Promhize
Aug 05 2016 00:14 UTC
@MikeJSchorah i haven't read that
Mike
@MikeJSchorah
Aug 05 2016 00:15 UTC
@Ndaraya I don't think he was saying that he has the answer. I think he was asking everyone else what their answer is.
Wilson
@wilsonhyng
Aug 05 2016 00:15 UTC
@Skasper1 i don't think you ever set a count variable ie var count = 0;
Mike
@MikeJSchorah
Aug 05 2016 00:15 UTC
@Promhize It's excellent. It's 89 chapters, but they're only 2 pages long. But, each chapter comes with 20 exercises... That's 1,800 exercises.
Promise Tochi
@Promhize
Aug 05 2016 00:15 UTC
@caseytherocket thouhgt you were a newbie, my bad
Mike
@MikeJSchorah
Aug 05 2016 00:15 UTC
And the exercises are online.
Promise Tochi
@Promhize
Aug 05 2016 00:16 UTC
@MikeJSchorah i would definitely check it out
caseytherocket
@caseytherocket
Aug 05 2016 00:16 UTC
@Ndaraya I'm looking to master one area of javascript first
Wilson
@wilsonhyng
Aug 05 2016 00:16 UTC
can someone help explain this reduce function for me? i'm having trouble understanding the purpose of the i argument in the reduce function http://jsbin.com/pucezeyeqe/edit?js,console
caseytherocket
@caseytherocket
Aug 05 2016 00:16 UTC
I want to start with the most important one first - basics aside
Eddie
@Ndaraya
Aug 05 2016 00:17 UTC
@Promhize @MikeJSchorah have you guys tried Eloquent JavaScript?
Wilson
@wilsonhyng
Aug 05 2016 00:17 UTC
i guess i could just copy it here:

function findDup(arr){
return arr.reduce(function(n, v, i){
if(arr.indexOf(v) == i) {
return n;
} else {
return v;}
}, null);
}

console.log(findDup([1,3,2,5,5,4,7,6]))

Mike
@MikeJSchorah
Aug 05 2016 00:17 UTC
@Promhize It definitely helped with the Beginning JavaScript questions on FCC. I blew through that section in an hour or two. But, it didn't really seem to help with algorithms. LOL.
Skasper1
@Skasper1
Aug 05 2016 00:17 UTC
@nosl1w that was how the page was set up
Mike
@MikeJSchorah
Aug 05 2016 00:17 UTC
@Promhize What is that?
Eddie
@Ndaraya
Aug 05 2016 00:17 UTC
@caseytherocket me too dude. I'm still looking for the best beginner's book
Mois茅s Man
@moigithub
Aug 05 2016 00:18 UTC
@nosl1w what are the reduce callback parameters ?
what n,v,i means ?
Promise Tochi
@Promhize
Aug 05 2016 00:18 UTC
@Ndaraya yeah i read a bit of it
Mike
@MikeJSchorah
Aug 05 2016 00:18 UTC
@Ndaraya I can't recommend A Smarter Way to Learn JavaScript highly enough
Wilson
@wilsonhyng
Aug 05 2016 00:19 UTC
yeah, i understand the purpose of each of them, but i'm having trouble understanding why i am checking if each value (v) is equal to each index (i)
Eddie
@Ndaraya
Aug 05 2016 00:19 UTC
Haha! Thanks @MikeJSchorah googling right noW
CamperBot
@camperbot
Aug 05 2016 00:19 UTC
ndaraya sends brownie points to @mikejschorah :sparkles: :thumbsup: :sparkles:
:cookie: 249 | @mikejschorah |http://www.freecodecamp.com/mikejschorah
Promise Tochi
@Promhize
Aug 05 2016 00:20 UTC
@nosl1w paste the code here
@MikeJSchorah referring to "A smarter way to learn javascript"
Wilson
@wilsonhyng
Aug 05 2016 00:20 UTC

function findDup(arr){
return arr.reduce(function(n, v, i){
if(arr.indexOf(v) == i) {
return n;
} else {
return v;}
}, null);
}

console.log(findDup([1,3,2,5,5,4,7,6])) // purpose is to return the duplicate value

Mike
@MikeJSchorah
Aug 05 2016 00:20 UTC
@Ndaraya It's on Amazon. I don't think I've ever seen a book on Amazon that had over 1,000 reviews and a perfect 5 star rating.
caseytherocket
@caseytherocket
Aug 05 2016 00:20 UTC
Checking out these books boys!
the reviews are crazy good
Promise Tochi
@Promhize
Aug 05 2016 00:21 UTC
the best beginners book for javascript is "javascript and jquery" but its more related to clientside javascript
Mike
@MikeJSchorah
Aug 05 2016 00:22 UTC
By John Ducket? @Promhize
Promise Tochi
@Promhize
Aug 05 2016 00:22 UTC
yes
Mike
@MikeJSchorah
Aug 05 2016 00:22 UTC
I liked his "HTML & CSS". Best book I've read on those "languages".
Promise Tochi
@Promhize
Aug 05 2016 00:23 UTC
yep, read that too, he's brilliant in making stuff simple, i was smiling the first time i read "javascript and jquery", cos i just understood easily
Lucas
@molinskai
Aug 05 2016 00:24 UTC
hi?
Mike
@MikeJSchorah
Aug 05 2016 00:25 UTC
@molinskai Hello
Eddie
@Ndaraya
Aug 05 2016 00:25 UTC
Wow! 5 Star rating for all! Thanks @MikeJSchorah
CamperBot
@camperbot
Aug 05 2016 00:25 UTC
ndaraya sends brownie points to @mikejschorah :sparkles: :thumbsup: :sparkles:
:warning: ndaraya already gave mikejschorah points
Lucas
@molinskai
Aug 05 2016 00:25 UTC
how is everybody doing?
Mike
@MikeJSchorah
Aug 05 2016 00:25 UTC
@molinskai Trying to figure out Repeat a string repeat a string
Lucas
@molinskai
Aug 05 2016 00:26 UTC
haha
Eddie
@Ndaraya
Aug 05 2016 00:26 UTC
Doing well @molinskai
BeefHazard
@BeefHazard
Aug 05 2016 00:26 UTC
Okay folks, i'm calling it a day
Eddie
@Ndaraya
Aug 05 2016 00:26 UTC
How about you?
BeefHazard
@BeefHazard
Aug 05 2016 00:26 UTC
time to get some shut-eye
Promise Tochi
@Promhize
Aug 05 2016 00:28 UTC
@nosl1w n represents previous, v represent current value, and i represent index. IndexOf returns the first index of v(currrent value) in the arr, and checks if its equal to the current index, if it's not equal then it means the number is duplicate since the second occurence index won't be equal to the first occurrence index which indexOf returns
Lucas
@molinskai
Aug 05 2016 00:28 UTC
i haven't got there yet
caseytherocket
@caseytherocket
Aug 05 2016 00:30 UTC
thanks @Promhize
CamperBot
@camperbot
Aug 05 2016 00:30 UTC
caseytherocket sends brownie points to @promhize :sparkles: :thumbsup: :sparkles:
:cookie: 23 | @promhize |http://www.freecodecamp.com/promhize
caseytherocket
@caseytherocket
Aug 05 2016 00:31 UTC
thanks @MikeJSchorah
CamperBot
@camperbot
Aug 05 2016 00:31 UTC
caseytherocket sends brownie points to @mikejschorah :sparkles: :thumbsup: :sparkles:
:cookie: 250 | @mikejschorah |http://www.freecodecamp.com/mikejschorah
Lucas
@molinskai
Aug 05 2016 00:32 UTC
hey, may someone check what i had write in an exercise?
and tell me if it is the orthodox way to do it?
have a look, it is from the counting cards exercise

var count = 0;

function cc(card) {
// Only change code below this line
var change = 0;
switch(card){
case 2:
case 3:
case 4:
case 5:
case 6: change = +1;
break;
case 7:
case 8:
case 9: change = +0;
break;
case 10:
case "J":
case "Q":
case "K":
case "A": change = -1;
}

count = count + change;

if (count >=1){
return count + " Bet";
} else{
return count + " Hold";
}

// Only change code above this line
}

// Add/remove calls to test your function.
// Note: Only the last will display
cc(2); cc(3); cc(7); cc('K'); cc('A');

Mike
@MikeJSchorah
Aug 05 2016 00:33 UTC
var result;
function repeatStringNumTimes(str, num) {
  for (var i = 0; i < num; i++) {
    if (num > 0) {
      console.log(result);
    }
    else {
      result = "";
    }
  }
  return result;
}

repeatStringNumTimes("abc", 3);
Could someone please give me a hint regarding Repeat a string repeat a string?
@molinskai What do you mean by orthodox?
Stephen James
@sjames1958gm
Aug 05 2016 00:36 UTC
@MikeJSchorah 1) don't use globals or the tests will not pass. 2) the num > 0 should be outside the loop num has to be > 0 to get in the loop.
3) initialize result to "" 4) inside the loop concatenate str to result
Promise Tochi
@Promhize
Aug 05 2016 00:38 UTC
@caseytherocket you are welcome :+1:
Jeffrowetull
@Jeffrowetull
Aug 05 2016 00:46 UTC
how do I type the logical "or" operator in javascript? It looks like two vertical lines but I don't know what button that is.
Bryan Mark Fajutag
@brynmrk
Aug 05 2016 00:46 UTC
shift + backslash i think
or fint the vertical line in your keyboard, when it is in the upper part you should use shift
Jeffrowetull
@Jeffrowetull
Aug 05 2016 00:47 UTC
@brynmrk Thanks
CamperBot
@camperbot
Aug 05 2016 00:47 UTC
jeffrowetull sends brownie points to @brynmrk :sparkles: :thumbsup: :sparkles:
:cookie: 16 | @brynmrk |http://www.freecodecamp.com/brynmrk
Bryan Mark Fajutag
@brynmrk
Aug 05 2016 00:47 UTC
@Jeffrowetull no problem
Scotty Strahan
@volcar
Aug 05 2016 00:48 UTC
I do love pizza n beer
Nicholas Vorraso
@nickeyvee
Aug 05 2016 00:52 UTC
@BeefHazard @MikeJSchorah thanks for the pointers! I was able to solve it.
CamperBot
@camperbot
Aug 05 2016 00:52 UTC
nickeyvee sends brownie points to @beefhazard and @mikejschorah :sparkles: :thumbsup: :sparkles:
:cookie: 251 | @mikejschorah |http://www.freecodecamp.com/mikejschorah
:cookie: 280 | @beefhazard |http://www.freecodecamp.com/beefhazard
Mike
@MikeJSchorah
Aug 05 2016 00:58 UTC
@sjames1958gm It's still not passing. Whew! This has been a tough challenge...
Stephen James
@sjames1958gm
Aug 05 2016 00:59 UTC
@MikeJSchorah Let's see.
Bryan Mark Fajutag
@brynmrk
Aug 05 2016 01:00 UTC
@MikeJSchorah you should log the str i think?
Joseph
@revisualize
Aug 05 2016 01:02 UTC
Hello.
Stephen James
@sjames1958gm
Aug 05 2016 01:02 UTC
@MikeJSchorah Can you describe your algorithm, just in English?
@revisualize Hey
nmaca
@nmaca
Aug 05 2016 01:02 UTC
Hey guys. First time using this because i need some help with "reverse a string"
Bryan Mark Fajutag
@brynmrk
Aug 05 2016 01:02 UTC
@MikeJSchorah your variable result doesnt have any value even when the loops finishes, so i think it will not print the string the way you need it
Stephen James
@sjames1958gm
Aug 05 2016 01:02 UTC
@nmaca What do you have.
Zachary Taylor
@taylorz0917
Aug 05 2016 01:02 UTC
Can someone help me understand how the filter() works? I still am having issues with that one. filter(boolean) is what I needed but I cant understand why. In the documentation it does not seem that easy.
nmaca
@nmaca
Aug 05 2016 01:03 UTC

@sjames1958gm function reverseString(str) {
var a = str.split("");
var b = a.reverse(a);
var c = b.join(b);
return c==str;

}

reverseString("hello");

I feel like theres a much better way to do it
Joseph
@revisualize
Aug 05 2016 01:03 UTC
@nmaca You can chain methods.
nmaca
@nmaca
Aug 05 2016 01:03 UTC
i tried that
Stephen James
@sjames1958gm
Aug 05 2016 01:03 UTC
@nmaca reverse doesn't take a parameter, join needs a parameter("") to just join the letters
@nmaca just return c
Joseph
@revisualize
Aug 05 2016 01:04 UTC
@nmaca reverse doesn't take a param.
nmaca
@nmaca
Aug 05 2016 01:04 UTC
by take a parameter, you mean there is no parameter attached?
John Magee
@jemagee
Aug 05 2016 01:04 UTC
@nmaca There's a quicker daisy chain way to do it if you want - but yeah - the parameter is wrong
Joseph
@revisualize
Aug 05 2016 01:05 UTC
@nmaca you just .reverse()
nmaca
@nmaca
Aug 05 2016 01:05 UTC
So i just keep it as reverse()
ok
John Magee
@jemagee
Aug 05 2016 01:05 UTC
It's the best way to write it - but not the most fun in my opinion :)
Joseph
@revisualize
Aug 05 2016 01:05 UTC
myArray.reverse();
John Magee
@jemagee
Aug 05 2016 01:05 UTC
str.split("").reverse().join("");
nmaca
@nmaca
Aug 05 2016 01:05 UTC
Ok thanks
Mike
@MikeJSchorah
Aug 05 2016 01:05 UTC
@sjames1958gm Line 1 - The function with parameters; Line 2 - Initializing variable to an empty string; Line 3 - For loop that has the iterator less than num; Line 4 - Concatenating result to str; Line 5 - For loop closing bracket; Line 6 - Console.log statement; 7 - Function closing bracket
Stephen James
@sjames1958gm
Aug 05 2016 01:06 UTC
@taylorz0917 filter takes each element of the array and calls the provided function passing the element, index and the array itself.
if the function returns true filter puts the element in the result array if it returns false it drops it.
For .filter(Boolean) the function is Boolean which takes its input and returns true if truthy and false if falsy.
That is why .filter(Boolean) filters out falsy values
Joseph
@revisualize
Aug 05 2016 01:06 UTC
@nmaca If you split you need an argument to split on. In turn if you join.. You need to supply an argument.
nmaca
@nmaca
Aug 05 2016 01:06 UTC
just so i can know: how would i refer to an array if it is a variable
John Magee
@jemagee
Aug 05 2016 01:06 UTC
@nmaca your question doesn't make sense without context
nmaca
@nmaca
Aug 05 2016 01:07 UTC
ok thanks for the tips btw. Im definitely going to be using this in the future
function reverseString(str) {
var a = str.split("");
var b = a.reverse();
var c = b.join(b);
return c==str;
Stephen James
@sjames1958gm
Aug 05 2016 01:07 UTC
@MikeJSchorah Check num before iterating.
I meant more like this
init result to "" if num is greater than zero then loop num times adding str to result parameter. Return result
Joseph
@revisualize
Aug 05 2016 01:07 UTC
@nmaca Example....
var myStr = "Hello Amazing World";
var myArr = myStr.split(" "); // ["Hello", "Amazing", "World"]
If you want join them back together you need to pass an argument.
b is an array
Stephen James
@sjames1958gm
Aug 05 2016 01:08 UTC
@nmaca a variable can refer to an array in your case a is a variable which refers to an array.
Joseph
@revisualize
Aug 05 2016 01:08 UTC
You can't join like that.
Join and split are similar.
Andrew Kay
@andrewjkay
Aug 05 2016 01:08 UTC
Can someone look at my Profile Lookup code? It passes 3/5, but there's something up with the brackets. It either passes the first three or the last two tests depending on where they are
function lookUpProfile(firstName, prop){
// Only change code below this line
  for (i=0; i<contacts.length; i++) {
    if (firstName==contacts[i].firstName && contacts[i].hasOwnProperty(prop)===true) {
      return contacts[i][prop];}

    if (contacts[i].hasOwnProperty===false){
      return "No such property";} 
  }
      if (firstName !== contacts[i].firstname){
      return "No such contact";}

}  
// Only change code above this line
nmaca
@nmaca
Aug 05 2016 01:08 UTC
Ok thanks for all the help
Zachary Taylor
@taylorz0917
Aug 05 2016 01:08 UTC
@sjames1958gm Can you show me the page with documentation on this? I would just like something for reference :sparkles:
Stephen James
@sjames1958gm
Aug 05 2016 01:09 UTC
@taylorz0917 search MDN filter and it should describe filter. The Boolean part is unique to the challenge.
Joseph
@revisualize
Aug 05 2016 01:09 UTC
@andrewjkay If I had a list of 20000 contacts.. When should you return that there is no contact in the list? When are you returning that there isn't a contact in the list? Do you know return halts the function in turn halting the loop? ... How many times is your loop running?
Stephen James
@sjames1958gm
Aug 05 2016 01:10 UTC
@andrewjkay if you exit the loop, then you can return no such contact with out that if statement. i is not valid outside the loop anyway
Joseph
@revisualize
Aug 05 2016 01:10 UTC
@andrewjkay Sorry, I know I hit you with a bunch of questions all at once.
Andrew Kay
@andrewjkay
Aug 05 2016 01:10 UTC
@revisualize its fine! I've been coming at it that way. It keeps ending the loop too early
Stephen James
@sjames1958gm
Aug 05 2016 01:11 UTC
@revisualize Atually I think his no such contact is outside the loop here.
Andrew Kay
@andrewjkay
Aug 05 2016 01:11 UTC
It looks at one and says "ok nope it doesn't match" and then just quits the loop
Joseph
@revisualize
Aug 05 2016 01:11 UTC
Oh.
hmm...
Andrew Kay
@andrewjkay
Aug 05 2016 01:11 UTC
@sjames1958gm it is now, but when it's in it passes the other two tests
Stephen James
@sjames1958gm
Aug 05 2016 01:11 UTC
@revisualize I think trying to follow the {}
Joseph
@revisualize
Aug 05 2016 01:11 UTC
I don't like if statments like that.
Damn it.
Andrew Kay
@andrewjkay
Aug 05 2016 01:11 UTC
@revisualize me either but nothing else was working
Joseph
@revisualize
Aug 05 2016 01:12 UTC
@andrewjkay contact[i] means nothing outside of the loop.
Stephen James
@sjames1958gm
Aug 05 2016 01:12 UTC
@andrewjkay Don't put } at the end of the line, it makes it hard to see where the if ends.
Joseph
@revisualize
Aug 05 2016 01:12 UTC
I was just re-reading the code and flipped off my screen.
;} is annoying.
Andrew Kay
@andrewjkay
Aug 05 2016 01:12 UTC
@sjames1958gm repasting it @revisualize good point, was cutting and pasting stuff
Zachary Taylor
@taylorz0917
Aug 05 2016 01:12 UTC
Then how would I have known about that command otherwise? @sjames1958gm
Stephen James
@sjames1958gm
Aug 05 2016 01:13 UTC
@taylorz0917 I learned about Boolean here, so I am not sure.
Joseph
@revisualize
Aug 05 2016 01:13 UTC
@andrewjkay outside of the loop you don't need an if statement. Because if the function would have found the contact before.. It would have already halted the function.
John Magee
@jemagee
Aug 05 2016 01:14 UTC
if you have 20000 contacts you would put them in some sort of database that optimized querying
Joseph
@revisualize
Aug 05 2016 01:14 UTC
@jemagee not the point.
But, yes.
Zachary Hyder
@zacharyhyder
Aug 05 2016 01:14 UTC

function caseInSwitch(val) {
var answer = "";
// Only change code below this line

switch (val) {
case 1:
console.log("alpha");
break;
case 2:
console.log("beta");
break;
case 3:
console.log("gamma");
break;
case 4:
console.log("delsta");
break;
}

// Only change code above this line
return answer;
}

// Change this value to test
caseInSwitch(2);

Stephen James
@sjames1958gm
Aug 05 2016 01:14 UTC
@andrewjkay Keeping your code formatted correctly allows you to visualize (or revisualize) the structure and flow.
Joseph
@revisualize
Aug 05 2016 01:14 UTC
I wasn't reading the code correctly because I was missing the inline }s
Andrew Kay
@andrewjkay
Aug 05 2016 01:15 UTC
function lookUpProfile(firstName, prop){
// Only change code below this line
  for (i=0; i<contacts.length; i++) {
    if (firstName==contacts[i].firstName && contacts[i].hasOwnProperty(prop)===true) {
      return contacts[i][prop];
    }

    if (contacts[i].hasOwnProperty===false){
      return "No such property";
    } 
  }
    if (firstName !== contacts.firstname){
      return "No such contact";
    }

}
Joseph
@revisualize
Aug 05 2016 01:15 UTC
@zacharyhyder You don't console.log. You need to change answer.
Stephen James
@sjames1958gm
Aug 05 2016 01:15 UTC
@zacharyhyder You need to assign the values not console.log
Zachary Taylor
@taylorz0917
Aug 05 2016 01:15 UTC
@sjames1958gm Haha fair enough! Thank you for the help
CamperBot
@camperbot
Aug 05 2016 01:15 UTC
taylorz0917 sends brownie points to @sjames1958gm :sparkles: :thumbsup: :sparkles:
:star2: 2353 | @sjames1958gm |http://www.freecodecamp.com/sjames1958gm
Andrew Kay
@andrewjkay
Aug 05 2016 01:15 UTC
better? Still new to formatting stuff
Stephen James
@sjames1958gm
Aug 05 2016 01:15 UTC
@taylorz0917 :+1:
Mois茅s Man
@moigithub
Aug 05 2016 01:15 UTC
@andrewjkay hasownproperty syntax is wrong (2nd if)
and contacts on 3rd if
Joseph
@revisualize
Aug 05 2016 01:15 UTC
@andrewjkay Read what I wrote.
Andrew Kay
@andrewjkay
Aug 05 2016 01:15 UTC
Also I removed the [i] and now only one test fails
oh man
Joseph
@revisualize
Aug 05 2016 01:15 UTC
You don't need the if conditional at all.
Stephen James
@sjames1958gm
Aug 05 2016 01:16 UTC
@andrewjkay Dump the if at the end , only return "No such contact"; if you exit the loop without returning before you know that you didn't find the contact.
Joseph
@revisualize
Aug 05 2016 01:16 UTC
Are you checking the whole array?
John Magee
@jemagee
Aug 05 2016 01:16 UTC
@andrewjkay I wouldn't use the compound if statement at the beginning myself - a nested if else after the first if allows for a cleaner code
Andrew Kay
@andrewjkay
Aug 05 2016 01:16 UTC
@revisualize for prop? no, it should just be one section of the array
Brandon Bowers
@Bowers96
Aug 05 2016 01:16 UTC
// Example
function ourReusableFunction() {
  console.log("Heyya, World");
}

ourReusableFunction();

// Only change code below this line
function ReusableName() {
  console.log("Hello World");
}

ReusableFunction();
Stephen James
@sjames1958gm
Aug 05 2016 01:16 UTC
@Bowers96 Why ReusableName?
Brandon Bowers
@Bowers96
Aug 05 2016 01:16 UTC
Where am I going wrong guys?
Joseph
@revisualize
Aug 05 2016 01:16 UTC
@andrewjkay the rest of your code is correct.
@andrewjkay just the stuff after the for loop is incorrect.
Stephen James
@sjames1958gm
Aug 05 2016 01:17 UTC
@Bowers96 And not ReusableFunction
Andrew Kay
@andrewjkay
Aug 05 2016 01:17 UTC
@jemagee definitely going to be looking up better ways of doing it but for now I'm thrilled it's almost working at all :D
@revisualize @sjames1958gm thanks guys, rechecking the syntax
CamperBot
@camperbot
Aug 05 2016 01:18 UTC
andrewjkay sends brownie points to @revisualize and @sjames1958gm :sparkles: :thumbsup: :sparkles:
:star2: 1548 | @revisualize |http://www.freecodecamp.com/revisualize
Stephen James
@sjames1958gm
Aug 05 2016 01:18 UTC
@andrewjkay In the future think about how you might do the algorithm without code, before committing to code
John Magee
@jemagee
Aug 05 2016 01:18 UTC
@andrewjkay it took me a bit of time to work through the logic of that exercise - i find that working through the 'psuedocode' often helps me solve the problem faster
CamperBot
@camperbot
Aug 05 2016 01:18 UTC
:star2: 2354 | @sjames1958gm |http://www.freecodecamp.com/sjames1958gm
Brandon Bowers
@Bowers96
Aug 05 2016 01:18 UTC
Got it thank you. @sjames1958gm
CamperBot
@camperbot
Aug 05 2016 01:18 UTC
bowers96 sends brownie points to @sjames1958gm :sparkles: :thumbsup: :sparkles:
:star2: 2355 | @sjames1958gm |http://www.freecodecamp.com/sjames1958gm
Stephen James
@sjames1958gm
Aug 05 2016 01:18 UTC
@Bowers96 :+1:
Andrew Kay
@andrewjkay
Aug 05 2016 01:19 UTC
@sjames1958gm I started doing that when I logged off last night and came up with this in 5-10 minutes this morning, wish I'd have written it out sooner it's a great tip
John Magee
@jemagee
Aug 05 2016 01:19 UTC
@andrewjkay As you get deeper into it and starting writing your own stuff - psuedocode is absolutely vital for complicated things
Zachary Hyder
@zacharyhyder
Aug 05 2016 01:22 UTC
function caseInSwitch(val) {
  var answer = "";
  // Only change code below this line

  switch (val) {
    case 1:
     answer = "alpha";
      break;
    case 2:
      answer = "beta";
      break;
    case 3:
      answer = "gamma";
      break;
    case 4:
      answer = "delta";
      break;
  }


  // Only change code above this line  
  return answer;  
}

// Change this value to test
caseInSwitch(2);
thank you @revisualize @sjames1958gm
CamperBot
@camperbot
Aug 05 2016 01:22 UTC
zacharyhyder sends brownie points to @revisualize and @sjames1958gm :sparkles: :thumbsup: :sparkles:
:star2: 2356 | @sjames1958gm |http://www.freecodecamp.com/sjames1958gm
:star2: 1549 | @revisualize |http://www.freecodecamp.com/revisualize
Joseph
@revisualize
Aug 05 2016 01:22 UTC
@zacharyhyder Grats. :)
Andrew Kay
@andrewjkay
Aug 05 2016 01:22 UTC
It works! Not optimal, but it works
Stephen James
@sjames1958gm
Aug 05 2016 01:23 UTC
@zacharyhyder :+1:
Joseph
@revisualize
Aug 05 2016 01:23 UTC
Your code?
Stephen James
@sjames1958gm
Aug 05 2016 01:23 UTC
@andrewjkay lol : )
Zachary Taylor
@taylorz0917
Aug 05 2016 01:23 UTC
function destroyer(arr) {
  // Remove all the values
  var arr = arr.filter() 


  return arr;
  //return destroy;
}

destroyer([1, 2, 3, 1, 2, 3], 2, 3);
For this question, i dont understand how to pass the arguments that arent part of the array without changing the destroyer function. Is it okay to do that? Or is there a special filter callback for this one too? lol
Stephen James
@sjames1958gm
Aug 05 2016 01:23 UTC
@taylorz0917 check the arguments object link -
Mike
@MikeJSchorah
Aug 05 2016 01:24 UTC
Thanks @Masd925 @sjames1958gm @revisualize @llamatarianism @BeefHazard
CamperBot
@camperbot
Aug 05 2016 01:24 UTC
mikejschorah sends brownie points to @masd925 and @sjames1958gm and @revisualize and @llamatarianism and @beefhazard :sparkles: :thumbsup: :sparkles:
:cookie: 281 | @beefhazard |http://www.freecodecamp.com/beefhazard
:star2: 2357 | @sjames1958gm |http://www.freecodecamp.com/sjames1958gm
:star2: 2240 | @masd925 |http://www.freecodecamp.com/masd925
:star2: 1550 | @revisualize |http://www.freecodecamp.com/revisualize
:star2: 1127 | @llamatarianism |http://www.freecodecamp.com/llamatarianism
Stephen James
@sjames1958gm
Aug 05 2016 01:24 UTC
@MikeJSchorah :+1:
Mike
@MikeJSchorah
Aug 05 2016 01:25 UTC
This message was deleted
@sjames1958gm Not sure how to use emojis on here...
Zachary Taylor
@taylorz0917
Aug 05 2016 01:26 UTC
@sjames1958gm :+1:
John Magee
@jemagee
Aug 05 2016 01:29 UTC
@MikeJSchorah That's a good thing?:)
So - out of curiosity - did anyone write this on the confirm the ending if (str.substr(-(target.length), target.length) == target)
Mike
@MikeJSchorah
Aug 05 2016 01:31 UTC
Yes. I did earlier today. Why? @jemagee
John Magee
@jemagee
Aug 05 2016 01:32 UTC
@MikeJSchorah I was just curious - FCC has avoided the 'negative number' accessing of things but it's an awesome tool to have in your belt
Mike
@MikeJSchorah
Aug 05 2016 01:33 UTC
@jemagee No, sorry. I just reread my code... Close, but no, I ended up using if (str.substr(str.length - target.length) === target {
John Magee
@jemagee
Aug 05 2016 01:35 UTC
@MikeJSchorah That's an interesting solution - still working on understanding the MDN format - didn't realize the length was an optional parameter
can you do string math in javascript?
darn - you can't - score one for ruby
llamatarianism
@llamatarianism
Aug 05 2016 01:38 UTC
string math?
you mean like, string interpolation?
cuz JS has that
John Magee
@jemagee
Aug 05 2016 01:39 UTC
String math - in ruby if you write "dog" * 3 - you get "dogdogdog" - you can do some string math in javascript (+=) works
llamatarianism
@llamatarianism
Aug 05 2016 01:39 UTC
ah, right
yeah JS has no operator overloading, unlike python and ruby
Justin Steele
@JustinSteele02
Aug 05 2016 01:39 UTC
$.getJSON isn't working for me in codepen. Trying to use it with the weather app but also codepen's own example from the blog isn't working either:
$(document).ready(function() {
  $.getJSON("http://codepen.io/chriscoyier/pen/EAIJj.js", function(data) {

    // Success! Do stuff with data.
    console.log(data);

  });
});
llamatarianism
@llamatarianism
Aug 05 2016 01:40 UTC
@JustinSteele02 have you actually imported jquery
Justin Steele
@JustinSteele02
Aug 05 2016 01:40 UTC
@llamatarianism Yeah I did
Mike
@MikeJSchorah
Aug 05 2016 01:40 UTC
@jemagee @llamatarianism Why are all of the jobs in sql, java, and javascript?
llamatarianism
@llamatarianism
Aug 05 2016 01:40 UTC
@MikeJSchorah they aren't?
John Magee
@jemagee
Aug 05 2016 01:40 UTC
@MikeJSchorah Um - where? CyberCoders has tons of ruby on rails jobs
no junior developer but still
llamatarianism
@llamatarianism
Aug 05 2016 01:41 UTC
@JustinSteele02 are you 100% super duper absolutely sure?
John Magee
@jemagee
Aug 05 2016 01:41 UTC
Does js have array ranges? i.e. - can i select array[0..5] in some way?
llamatarianism
@llamatarianism
Aug 05 2016 01:41 UTC
cuz I don't see anything wrong with that code
llamatarianism
@llamatarianism
Aug 05 2016 01:41 UTC
@jemagee no, but it has the Array.prototype.slice method
@MikeJSchorah I wouldn't take any "top 9" blog post seriously
especially one about programming
John Magee
@jemagee
Aug 05 2016 01:42 UTC
@MikeJSchorah What curriculum does coding dojo focus on?
Mike
@MikeJSchorah
Aug 05 2016 01:42 UTC
@jemagee I'd love to work for CyberCoders... $200K/year?!?!?! SIGN ME UP!!!
John Magee
@jemagee
Aug 05 2016 01:42 UTC
Javascript is very popular and sought after - but a lot of other things are too
llamatarianism
@llamatarianism
Aug 05 2016 01:42 UTC
but if you want me to explain why SQL, java and JS are commonly used
John Magee
@jemagee
Aug 05 2016 01:42 UTC
java not so popular
Mike
@MikeJSchorah
Aug 05 2016 01:42 UTC
@llamatarianism ...because?...
llamatarianism
@llamatarianism
Aug 05 2016 01:42 UTC
@MikeJSchorah give me a goddamn second man
I'm not jesus
Justin Steele
@JustinSteele02
Aug 05 2016 01:42 UTC
@llamatarianism I don't either, I can't figure it out. I've also tried just having it alert "anything". Nothing's happening
John Magee
@jemagee
Aug 05 2016 01:42 UTC
PS - there is no 'SQL' honestly - there's mySQL, PostGres - SQL Server, but SQL itself is really just a set of rules and guidelines for RDBMSs
Mike
@MikeJSchorah
Aug 05 2016 01:42 UTC
Last time I checked on Monster and Careerbuilder, that "top 9" proven to be very accurate...
...many Java and JavaScript jobs. The closest Ruby on Rails job was 100 miles away...
John Magee
@jemagee
Aug 05 2016 01:43 UTC
@MikeJSchorah CyberCoders is job placement - i'd hate to work at a place like that - commission work sucks
So wait - geography - where do you live?
Mike
@MikeJSchorah
Aug 05 2016 01:44 UTC
Oooohhhh. Makes sense. That's why they were making $200K/year. Makes alot of sense now.
llamatarianism
@llamatarianism
Aug 05 2016 01:44 UTC
  • SQL is commonly used over other databases because other databases haven't been around as long
  • JS is commonly used because it's the only language that's supported in all browsers
  • java is commonly used because it has a mature ecosystem, it's pretty fast, and it's imperative, object oriented and known by a lot of people, which makes it easier to hire for java jobs
also static typing
Mike
@MikeJSchorah
Aug 05 2016 01:45 UTC
@johnmagee Baltimore/Philadelphia
llamatarianism
@llamatarianism
Aug 05 2016 01:46 UTC
@MikeJSchorah one of the most commonly used websites for ranking languages based on popularity is the TIOBE index
you know what they do?
Mike
@MikeJSchorah
Aug 05 2016 01:46 UTC
@llamatarianism Nice! I'm taking notes here...
llamatarianism
@llamatarianism
Aug 05 2016 01:46 UTC
they search google for those programming languages
and they see how many results they get.
John Magee
@jemagee
Aug 05 2016 01:46 UTC
I grew up in Philadelphia and see ruby and rails jobs posted there all the time
llamatarianism
@llamatarianism
Aug 05 2016 01:46 UTC
any list of programming languages that literally ranks programming languages consecutively based on popularity
is probably full of s###
John Magee
@jemagee
Aug 05 2016 01:47 UTC
And I still think CodingDojo has a self serving motivation for that article - aren't they a javascript focused bootcamp?
Mike
@MikeJSchorah
Aug 05 2016 01:48 UTC
@jemagee Ok. 50 miles. Sorry for the exaggeration. Put a ruler connecting Baltimore to Philadelphia and draw a line. I'm smack-dab in the center of that line.
John Magee
@jemagee
Aug 05 2016 01:48 UTC
PS - who do i tell that the wording of the truncate a string exercise is poorly explained
Mike
@MikeJSchorah
Aug 05 2016 01:48 UTC
@jemagee Aah. So don't trust Google's algorithm?
llamatarianism
@llamatarianism
Aug 05 2016 01:48 UTC
submit an issue to the github repo
John Magee
@jemagee
Aug 05 2016 01:49 UTC
Don't trust codingdojo
Jorge Casta帽o Delgado
@jhcastanod
Aug 05 2016 01:49 UTC
function titleCase(str){
  var newTitle = str.toLowerCase().split(' ');

  for(var i = 0; i < newTitle.length; i++){
    var singlePos = newTitle[i].split(' ');
  }
}
hey guys, when the for loop is running it isn't storing the word splited in singlePos variable. What am I doing wrong? I need something like e.g singlePos = ['h', 'e', 'l', 'l', 'o'].
Brandon Bowers
@Bowers96
Aug 05 2016 01:49 UTC
// Declare your variable here
var myGlobal = (10); {

}

function fun1() {
  // Assign 5 to oopsGlobal Here
  oopsGlobal(5);
}
// Only change code above this line
function fun2() {
  var output = "";
  if (typeof myGlobal != "undefined") {
    output += "myGlobal: " + myGlobal;
  }
  if (typeof oopsGlobal != "undefined") {
    output += " oopsGlobal: " + oopsGlobal;
  }
  console.log(output);
}
please help.
Where am I going wrong?
John Magee
@jemagee
Aug 05 2016 01:49 UTC
actually coding dojo has expanded recently - wish i had time for one of those damn bood camps
Justin Steele
@JustinSteele02
Aug 05 2016 01:50 UTC
ok so I discovered getJSON is working in codepen if I open it in firefox but not chrome. Any idea what browser setting could be causing this?
Mike
@MikeJSchorah
Aug 05 2016 01:50 UTC
@jhcastanod I don't think you should be using spit inside the for loop
Stephen James
@sjames1958gm
Aug 05 2016 01:50 UTC
@jhcastanod The word has no spaces and you are splitting on spaces (use "")
llamatarianism
@llamatarianism
Aug 05 2016 01:50 UTC
@jhcastanod it is storing it in the variable
you're just not doing anything with that variable
John Magee
@jemagee
Aug 05 2016 01:50 UTC
@Bowers96 you've got an empty {} pair and i don't think you're using oopsGlobal right
Mike
@MikeJSchorah
Aug 05 2016 01:51 UTC
@Bowers96 For one the second if statement should be either "else if" or "else"
Stephen James
@sjames1958gm
Aug 05 2016 01:51 UTC
@Bowers96 this oopsGlobal(5); is calling a function not setting a variable
John Magee
@jemagee
Aug 05 2016 01:52 UTC
can you do logical comparisons on switch statements or is it only an 'equals' declaration?
llamatarianism
@llamatarianism
Aug 05 2016 01:52 UTC
it's only used for checking the value of something
Brandon Bowers
@Bowers96
Aug 05 2016 01:52 UTC
Hmmmmm still not understanding. @sjames1958gm
Stephen James
@sjames1958gm
Aug 05 2016 01:53 UTC
@Bowers96 oopsGlobal = 5; is assigning 5 to oopsGlobal
John Magee
@jemagee
Aug 05 2016 01:53 UTC
crap - ruby wins again - this truncate thing would be so darn easier if i could use a switch statement like that :)
Mike
@MikeJSchorah
Aug 05 2016 01:53 UTC
@jemagee You don't think FCC is good enough for entry level employment?
John Magee
@jemagee
Aug 05 2016 01:53 UTC
@MikeJSchorah Not in ruby on rails - no :)
Mike
@MikeJSchorah
Aug 05 2016 01:54 UTC
@jemagee Of course I'm talking about JavaScript!
Have you looked at TOP?
John Magee
@jemagee
Aug 05 2016 01:54 UTC
The onion router? No i haven't
Brandon Bowers
@Bowers96
Aug 05 2016 01:54 UTC
Changing that to what you said worked. @sjames1958gm
Mike
@MikeJSchorah
Aug 05 2016 01:54 UTC
@jemagee The Odin Project
...unless that's a bad word around here...
Ken Haduch
@khaduch
Aug 05 2016 01:56 UTC
@JustinSteele02 - check for loading your page with https:// and the getJSON URL is http://? (Just a guess, since you don't have a URL posted) It can result in an error because of the mix of the two.
John Magee
@jemagee
Aug 05 2016 01:56 UTC
I've seen the odin project
I am wary of 'we guarantee you a job and then you pay us back when you work'
plus - us folks in their 40s often already have full time jobs we can't just bail on :)
Jorge Casta帽o Delgado
@jhcastanod
Aug 05 2016 01:57 UTC
@llamatarianism What I want it's to get the first word in newTitle and splited again and then store it in my singlePos variable. if you say that singlePos var is doing anything how could I get the result that I want? thanks all you guys for your answers
CamperBot
@camperbot
Aug 05 2016 01:57 UTC
jhcastanod sends brownie points to @llamatarianism :sparkles: :thumbsup: :sparkles:
:star2: 1128 | @llamatarianism |http://www.freecodecamp.com/llamatarianism
Mike
@MikeJSchorah
Aug 05 2016 01:59 UTC
@jemagee No. TOP is actually just like FCC. Harder to use and wwwaaayyy more difficult, but like FCC is in JavaScript, TOP is in Ruby. I have a full time job as well and a house and I have concerns about bailing on my job, too. But, I figure I need to take the risk to realize my dream of becoming a developer.
John Magee
@jemagee
Aug 05 2016 02:00 UTC
I've got manning publications - stack overflow - and my own project needs (http://www.github.com/jemagee)
llamatarianism
@llamatarianism
Aug 05 2016 02:01 UTC
@jhcastanod you create the variable
you don't do anything with it
Justin Steele
@JustinSteele02
Aug 05 2016 02:01 UTC
thanks @khaduch
CamperBot
@camperbot
Aug 05 2016 02:01 UTC
justinsteele02 sends brownie points to @khaduch :sparkles: :thumbsup: :sparkles:
:star2: 1511 | @khaduch |http://www.freecodecamp.com/khaduch
John Magee
@jemagee
Aug 05 2016 02:01 UTC
TOP seems to have changed recently - ilast time i was looking at it - it included sinatra- and i loathe sinatra
Mike
@MikeJSchorah
Aug 05 2016 02:03 UTC
Is that a technology or are you talking about the musician?
John Magee
@jemagee
Aug 05 2016 02:03 UTC
Sinatra is a Ruby based framework that is sort of like a barebone rails - i did not get along with it very well
Mike
@MikeJSchorah
Aug 05 2016 02:04 UTC
Ah. Thought that sounded familiar.
So is this a hobby for you or do you plan on getting a job?
Jorge Casta帽o Delgado
@jhcastanod
Aug 05 2016 02:08 UTC
I am learning some stuff about Ruby and ROR. My sources are those Michael Harlt books. Have you heard about it? do you recommend them? what do you think about it both of you guys?
John Magee
@jemagee
Aug 05 2016 02:10 UTC
@jhcastanod Hartl works for a lot of people he just recently upgraded it for 5 - it did not work for me - recreating twitter aggravated me
Mike
@MikeJSchorah
Aug 05 2016 02:10 UTC
@jhcastanod My only experience with Ruby is from CodeCademy
John Magee
@jemagee
Aug 05 2016 02:10 UTC
The only book i really would advise against is the pragmatic agile development book - they use scaffolds WAY too much
llamatarianism
@llamatarianism
Aug 05 2016 02:10 UTC
@jhcastanod I think it's a good book
John Magee
@jemagee
Aug 05 2016 02:11 UTC
The PickAxe Book and Learning to Code by Pine are great if you want to learn ruby first (which i ssuggest) before learning rails
Well Grounded Rubyist is quite good too
MightKamioka
@MightKamioka
Aug 05 2016 02:11 UTC
I don't understands the Word Blanks problem at all
llamatarianism
@llamatarianism
Aug 05 2016 02:11 UTC
@MightKamioka you have to use + to join all the strings together with spaces inbetween
Mike
@MikeJSchorah
Aug 05 2016 02:11 UTC
@MightKamioka That's common.
llamatarianism
@llamatarianism
Aug 05 2016 02:11 UTC
example
John Magee
@jemagee
Aug 05 2016 02:11 UTC
Man i love non traditional answers :) arr.slice(-(arr.length-howMany))
llamatarianism
@llamatarianism
Aug 05 2016 02:12 UTC
let foo = "foo";
let bar = "bar";
console.log(foo + " " + bar); // "foo bar"
Joseph
@revisualize
Aug 05 2016 02:12 UTC
@MightKamioka Do you know how to concatenate a string?
MightKamioka
@MightKamioka
Aug 05 2016 02:12 UTC
@llamatarianism Thanks,
CamperBot
@camperbot
Aug 05 2016 02:12 UTC
mightkamioka sends brownie points to @llamatarianism :sparkles: :thumbsup: :sparkles:
:star2: 1129 | @llamatarianism |http://www.freecodecamp.com/llamatarianism
Jorge Casta帽o Delgado
@jhcastanod
Aug 05 2016 02:12 UTC
awesome! I really appreciate your advice (Y) @MikeJSchorah @llamatarianism @jemagee thanks
CamperBot
@camperbot
Aug 05 2016 02:12 UTC
jhcastanod sends brownie points to @mikejschorah and @llamatarianism and @jemagee :sparkles: :thumbsup: :sparkles:
:warning: jhcastanod already gave llamatarianism points
:cookie: 264 | @jemagee |http://www.freecodecamp.com/jemagee
:cookie: 253 | @mikejschorah |http://www.freecodecamp.com/mikejschorah
John Magee
@jemagee
Aug 05 2016 02:12 UTC
oh yeah - i'd also suggest anyone interested in serious learning stay away from the zombies
MightKamioka
@MightKamioka
Aug 05 2016 02:12 UTC
@revisualize Yes, I just learned that, I just didn't understand the problem asking me to do.
thanks
Mike
@MikeJSchorah
Aug 05 2016 02:13 UTC
@jemagee Lol. Because?
John Magee
@jemagee
Aug 05 2016 02:13 UTC
@MikeJSchorah It's a course thing - rails for zombies - ii'd stay away from it
llamatarianism
@llamatarianism
Aug 05 2016 02:13 UTC
clojure for the brave and true is a great book
and it has plenty of zombies
cuddle zombies specifically
John Magee
@jemagee
Aug 05 2016 02:14 UTC
if you are bored and read my blog you'll see i tried a lot of crap until Manning
Team Treehouse isn't terrible
Mike
@MikeJSchorah
Aug 05 2016 02:14 UTC
@jemagee No. I was just curious. I tried it before with The Odin Project. It made things super easy. Kinda like CodeCademy.
John Magee
@jemagee
Aug 05 2016 02:14 UTC
Lynda isn't terrible
but they're costly
(so is treehouse)
There's a coding shop in boston whose name escapes me right now that does some courses - i have little experience with them -
but i've heard good things - (also not free)
Mike
@MikeJSchorah
Aug 05 2016 02:15 UTC
Treehouse is just a bunch of videos, right?
John Magee
@jemagee
Aug 05 2016 02:15 UTC
If i had cash and money i'd go to one of the 'launch' bootcamps - i forget which one exactly but one really appealed to me
Treehouse has exercises too
Video Learning can work for people - it doesn't work for my abnormal brain
Richard
@richao03
Aug 05 2016 02:15 UTC
hello FCC'ers
Mike
@MikeJSchorah
Aug 05 2016 02:15 UTC
The boot camp up the street from me was praised by Obama (I'm not a democrat, though).
Richard
@richao03
Aug 05 2016 02:15 UTC
can some one help me with a jquery question?
Mike
@MikeJSchorah
Aug 05 2016 02:16 UTC
@jemagee When it comes to coding, it's all trial and error for me
John Magee
@jemagee
Aug 05 2016 02:17 UTC
@MikeJSchorah Read books, try stuff out, fail A LOT - and use stack overflow )
@richao03 Rich - what you got?
Richard
@richao03
Aug 05 2016 02:17 UTC
so i have a bunch of id's named "_1" "_2" "_3"
Mike
@MikeJSchorah
Aug 05 2016 02:17 UTC
The boot camp up the street from me is $10,000. But, $8,000 is paid for by an employer if you sign up for a 6 month apprenticeship paying $26/hour. And the other $2,000 is waive if you make less than $24,000/year (I make 2x that, though)
Richard
@richao03
Aug 05 2016 02:17 UTC
and they can sometimes be assigned a class "active"
how can count which id's also have class active?
this is what i have for now
function failed(){
var numItems = $('.active').find('[id^="_"]')
console.log(numItems)
}
Mike
@MikeJSchorah
Aug 05 2016 02:18 UTC
@jemagee I don't really like stack overflow. It's not very friendly to new programmers.
I never had negative points given, but just because I haven't had positive points given, they suspended my account for a couple of days. Even if I was an experienced developer, I don't think I'd use them.
John Magee
@jemagee
Aug 05 2016 02:19 UTC
@MikeJSchorah You're absolutely right about that - I've never had a question answered myself - BUT any question i have ever had has had an answer in StackOVerflow (even if the answer was carrierwave doesn't work with namespaces so suck it)
I am up to like 100 points or something - not sure how - i got a few answers right
Primarily I just use it as a resource - there are very few 'new' problems in programming and SO has the answers to most of the old ones
sometimes finding it is a pain -
adokic
@adokic
Aug 05 2016 02:21 UTC
for this problem,
function uniteUnique(arr) {
}
Mike
@MikeJSchorah
Aug 05 2016 02:21 UTC
@jemagee Big pain for me. But you're absolutely right. At least half of the issues that I've had with programming are further understood by clicking a stack overflow link after pulling a Google search.
@adokic What's the full solution that you have for what problem?
adokic
@adokic
Aug 05 2016 02:22 UTC
is there an easy way to combine all of the arrays passed in as args into one array?
Mike
@MikeJSchorah
Aug 05 2016 02:23 UTC
@adokic Which problem are we talking about?
llamatarianism
@llamatarianism
Aug 05 2016 02:23 UTC
@adokic if your browser supports ecmascript 6
you can do this
adokic
@adokic
Aug 05 2016 02:23 UTC
@MikeJSchorah sortedUnion
llamatarianism
@llamatarianism
Aug 05 2016 02:23 UTC
function uniteUnique(...args) {
  // ...
}
adokic
@adokic
Aug 05 2016 02:24 UTC
so far I have this:
var args = Array.from(arguments);
llamatarianism
@llamatarianism
Aug 05 2016 02:24 UTC
and you can also do stuff like
function f(a, b, c, ...stuff) {
  // ...
}
@adokic Array.from(arguments) will also work
again, provided your browser supports it
adokic
@adokic
Aug 05 2016 02:24 UTC
but I am trying to combine all of the arrays within the array into one array
without using a double for loop
llamatarianism
@llamatarianism
Aug 05 2016 02:24 UTC
you can flatten an array by doing this
[].concat.apply([], array);
// or the ES6 version
[].concat(...array);
Puvendran Pillay
@puven12
Aug 05 2016 02:26 UTC
hi guys can a return statement stop a recursive function?
adokic
@adokic
Aug 05 2016 02:26 UTC
@llamatarianism that's what I tried initially but it didnt work
llamatarianism
@llamatarianism
Aug 05 2016 02:27 UTC
if it didn't work you messed something up
Puvendran Pillay
@puven12
Aug 05 2016 02:27 UTC
for example
function loop(a) {
return loop(a+1);
}
llamatarianism
@llamatarianism
Aug 05 2016 02:27 UTC
@puven12 yes, as long as you return something other than the function itself.
example
Ken Haduch
@khaduch
Aug 05 2016 02:27 UTC
@richao03 - hey there
llamatarianism
@llamatarianism
Aug 05 2016 02:27 UTC
function factorial(n) {
  if (n === 0) {
    return 1; // recursive loop ends here.
  }
  return n * factorial(n - 1); // recursive loop continues.
}
Richard
@richao03
Aug 05 2016 02:28 UTC
@khaduch hello
adokic
@adokic
Aug 05 2016 02:29 UTC
@llamatarianism thanks!
CamperBot
@camperbot
Aug 05 2016 02:29 UTC
adokic sends brownie points to @llamatarianism :sparkles: :thumbsup: :sparkles:
:star2: 1130 | @llamatarianism |http://www.freecodecamp.com/llamatarianism
Puvendran Pillay
@puven12
Aug 05 2016 02:29 UTC
thank you @llamatarianism
CamperBot
@camperbot
Aug 05 2016 02:29 UTC
puven12 sends brownie points to @llamatarianism :sparkles: :thumbsup: :sparkles:
:star2: 1131 | @llamatarianism |http://www.freecodecamp.com/llamatarianism
Ken Haduch
@khaduch
Aug 05 2016 02:29 UTC
@richao03 - did you get an answer to your question?
Richard
@richao03
Aug 05 2016 02:29 UTC
no sir
var numItems = $('[.active][id^="_"]').length
Mandy
@YoungPlutus
Aug 05 2016 02:30 UTC
Can someone help me with the "Increment a Number with JavaScript" challenge??
Ken Haduch
@khaduch
Aug 05 2016 02:30 UTC
@richao03 - do you have a URL for what you're trying to do?
Richard
@richao03
Aug 05 2016 02:30 UTC
i am trying to capture the number of elements that has an ID that starts with "_" that also has the class of "active"
Stephen James
@sjames1958gm
Aug 05 2016 02:30 UTC
@YoungPlutus Sure.
Richard
@richao03
Aug 05 2016 02:31 UTC
sorry i actually dont have the code online anywhere..
Teresa Garriot
@garriottteresa
Aug 05 2016 02:31 UTC

// Setup
var myObj = {
  gift: "pony",
  pet: "kitten",
  bed: "sleigh"
};

function checkObj(checkProp) {
  if (myObj.hasOwnProperty() === true){// Your Code Here
   return  myObj.checkProp;
}
  else {
    return  "Not Found";
  }
}
// Test your code by modifying these values
checkObj("gift");
Stephen James
@sjames1958gm
Aug 05 2016 02:31 UTC
@YoungPlutus Follow the pattern on the left. i = i + 1 can be replaced by i++
comaeternal
@comaeternal
Aug 05 2016 02:31 UTC
This message was deleted
Teresa Garriot
@garriottteresa
Aug 05 2016 02:31 UTC
what am I missing??
Stephen James
@sjames1958gm
Aug 05 2016 02:31 UTC
@garriottteresa hasOwnProperty need the property to be had, use [] when property is in a variable
comaeternal
@comaeternal
Aug 05 2016 02:31 UTC

function wordBlanks(myNoun, myAdjective, myVerb, myAdverb) {
  var result = "";
  // Your code below this line

  result = 

  // Your code above this line
  return result;
}

// Change the words here to test your function
wordBlanks("dog", "big", "ran", "quickly");
Mandy
@YoungPlutus
Aug 05 2016 02:32 UTC
@sjames1958gm so I keep the i++?
comaeternal
@comaeternal
Aug 05 2016 02:32 UTC
I'm confused on this word bank challenge.
Stephen James
@sjames1958gm
Aug 05 2016 02:32 UTC
@YoungPlutus you have myVar = myVar + 1?
Richard
@richao03
Aug 05 2016 02:32 UTC
@khaduch do u have any suggestions of how i should select the correct elements?
guys. help me with that one pls.
Mandy
@YoungPlutus
Aug 05 2016 02:33 UTC
@sjames1958gm yes
Stephen James
@sjames1958gm
Aug 05 2016 02:33 UTC
@YoungPlutus just do what was done for i to myVar
Yaroslav Newman
@YaroNew
Aug 05 2016 02:33 UTC

// Setup
var myObj = {
  gift: "pony",
  pet: "kitten",
  bed: "sleigh"
};

function checkObj(checkProp) {
  // Your Code Here

 myObj.hasOwnProperty("gift"); 
 myObj.hasOwnProperty("pet"); 
 myObj.hasOwnProperty("house"); 

  return  "Not Found";


}

// Test your code by modifying these values
checkObj("gift");
Stephen James
@sjames1958gm
Aug 05 2016 02:33 UTC
@YaroNew use checkProp for your property to test. and use if
John Magee
@jemagee
Aug 05 2016 02:35 UTC
good lord that letter comparison one was annoying
Stephen James
@sjames1958gm
Aug 05 2016 02:35 UTC
@comaeternal combine the variables passed in the function with other strings to make a sentence.
John Magee
@jemagee
Aug 05 2016 02:37 UTC
@comaeternal review string concatenation and remember that variables can be strings as well
variables can be set to strings
Stephen James
@sjames1958gm
Aug 05 2016 02:38 UTC
@YoungPlutus did you get it? If not post what you have
Teresa Garriot
@garriottteresa
Aug 05 2016 02:39 UTC
@sjames1958gm Thanks parens, brackets, periods I need more practice and explanation why and when they fit.
CamperBot
@camperbot
Aug 05 2016 02:39 UTC
garriottteresa sends brownie points to @sjames1958gm :sparkles: :thumbsup: :sparkles:
:star2: 2359 | @sjames1958gm |http://www.freecodecamp.com/sjames1958gm
Stephen James
@sjames1958gm
Aug 05 2016 02:40 UTC
@garriottteresa The arcana of programming :)
Yaroslav Newman
@YaroNew
Aug 05 2016 02:42 UTC
@sjames1958gm

// Setup
var myObj = {
  gift: "pony",
  pet: "kitten",
  bed: "sleigh"
};

function checkObj(checkProp) {
  // Your Code Here

 myObj.hasOwnProperty("gift"); 
 myObj.hasOwnProperty("pet"); 
 myObj.hasOwnProperty("house"); 

  if ( checkProp === gift) {
    return "pony";
  } else if ( checkProp === pet)
  retun "kitten";
  else {
  return  "Not Found";

}

// Test your code by modifying these values
checkObj("gift");
doesn't work like that
Stephen James
@sjames1958gm
Aug 05 2016 02:42 UTC
@YaroNew Nope, that is not close. Your code should not have reference any of the values in myObj,
Use myObj and checkProp only
Anh Phan
@kemoemo
Aug 05 2016 02:43 UTC
somebody help me in challenge 210
Stephen James
@sjames1958gm
Aug 05 2016 02:43 UTC
@kemoemo challenges don't have numbers, that is your progress number, what is the name?
Anh Phan
@kemoemo
Aug 05 2016 02:43 UTC
it's record collection
Yaroslav Newman
@YaroNew
Aug 05 2016 02:44 UTC
@sjames1958gm

// Setup
var myObj = {
  gift: "pony",
  pet: "kitten",
  bed: "sleigh"
};

function checkObj(checkProp) {
  // Your Code Here

 myObj.hasOwnProperty("gift"); 
 myObj.hasOwnProperty("pet"); 
 myObj.hasOwnProperty("house"); 

  if ( checkProp === myObj) {
    return "pony";
  } else if ( checkProp === myObj)
  return "kitten";
  else {
  return  "Not Found";
  }
}
// Test your code by modifying these values
checkObj("gift");
Stephen James
@sjames1958gm
Aug 05 2016 02:44 UTC
@kemoemo That is one of the first tough ones. What do you have
Yaroslav Newman
@YaroNew
Aug 05 2016 02:44 UTC
Do you mean like that? but it makes no sence
Anh Phan
@kemoemo
Aug 05 2016 02:45 UTC

// Setup
var collection = {
"2548": {
"album": "Slippery When Wet",
"artist": "Bon Jovi",
"tracks": [
"Let It Rock",
"You Give Love a Bad Name"
]
},
"2468": {
"album": "1999",
"artist": "Prince",
"tracks": [
"1999",
"Little Red Corvette"
]
},
"1245": {
"artist": "Robert Palmer",
"tracks": [ ]
},
"5439": {
"album": "ABBA Gold"
}
};
// Keep a copy of the collection for tests
var collectionCopy = JSON.parse(JSON.stringify(collection));

// Only change code below this line
function updateRecords(id, prop, value) {
var a = [];
a.push(prop);
a.push(value);
collectionCopy.id[a[0]] = a1;

return collectionCopy;
}

// Alter values below to test your code
updateRecords(5439, "artist", "ABBA");

Stephen James
@sjames1958gm
Aug 05 2016 02:45 UTC
@YaroNew Nope, that is not close. Your code should not have reference any of the values in myObj, no gift, pet, house, pony kitten.
Use myObj and checkProp only
Santiago G贸mez
@Sperkajugglite
Aug 05 2016 02:45 UTC
@sjames1958gm --watch
Stephen James
@sjames1958gm
Aug 05 2016 02:46 UTC
@kemoemo You need to read the instructions. You are supposed to test the values of prop and value.
Then change the record collection based on those tests.
@Sperkajugglite ?
Anh Phan
@kemoemo
Aug 05 2016 02:47 UTC
but i dont understand instructions, can u have any examples?
Stephen James
@sjames1958gm
Aug 05 2016 02:48 UTC
@kemoemo
if (value !== "") will test if value is not equal to ""
Stephen James
@sjames1958gm
Aug 05 2016 02:49 UTC
@revisualize My hero :)
Joseph
@revisualize
Aug 05 2016 02:51 UTC
@kemoemo Those are the instructions broken down to make them more manageable. Note.. The indent is there for a reason.
Yaroslav Newman
@YaroNew
Aug 05 2016 02:52 UTC
@sjames1958gm

// Setup
var myObj = {
  gift: "pony",
  pet: "kitten",
  bed: "sleigh"
};

function checkObj(checkProp) {
  // Your Code Here

 myObj.hasOwnProperty("gift"); 
 myObj.hasOwnProperty("pet"); 
 myObj.hasOwnProperty("bed"); 
 myObj.hasOwnProperty("house");  

  if ( checkObj === myObj ) {
    return checkProp;
  } else if ( checkObj === myObj ) {
    return checkProp;
  } else if ( checkObj === myObj ) {
    return checkProp;
  }

}
// Test your code by modifying these values
checkObj("gift");
as far as I understand it.
where i'm wrong?
Santiago G贸mez
@Sperkajugglite
Aug 05 2016 02:53 UTC
@sjames1958gm you asked me yesterday, but i had to go :P
Joseph
@revisualize
Aug 05 2016 02:53 UTC
@YaroNew Why aren't you using the variable? checkProp
@YaroNew checkObj === myObj Will always be false. A function checkObj will never be an object myObj
Stephen James
@sjames1958gm
Aug 05 2016 02:54 UTC
@YaroNew You need an if that tests if checkProp contains a property that myObj has and if so return the value of the property in checkProp
everything you have is not correct
Anh Phan
@kemoemo
Aug 05 2016 02:56 UTC
i will try. Thank all
Yaroslav Newman
@YaroNew
Aug 05 2016 02:56 UTC
@sjames1958gm ok. what part of the code is not right?
 myObj.hasOwnProperty("gift"); 
 myObj.hasOwnProperty("pet"); 
 myObj.hasOwnProperty("bed"); 
 myObj.hasOwnProperty("house");
Stephen James
@sjames1958gm
Aug 05 2016 02:56 UTC
All of it.
Yaroslav Newman
@YaroNew
Aug 05 2016 02:56 UTC
that one is right?
nmaca
@nmaca
Aug 05 2016 02:56 UTC
Hello again... Im having a minor issue with the Factorialize a Number test
Stephen James
@sjames1958gm
Aug 05 2016 02:56 UTC
@YaroNew No, use checkProp
nmaca
@nmaca
Aug 05 2016 02:56 UTC

var myArray = [];
function factorialize(num) {
while (num>0) {
num--;
myArray.push(num);
}

}

factorialize(5);

thats my code atm
Joseph
@revisualize
Aug 05 2016 02:56 UTC
@YaroNew That you're not using a variable.
Stephen James
@sjames1958gm
Aug 05 2016 02:57 UTC
@nmaca YOu are just pushing the number, why not multiply at that point?
nmaca
@nmaca
Aug 05 2016 02:57 UTC
Yeah thats what im having trouble with
how do i multiply all the numbers in the array
Yaroslav Newman
@YaroNew
Aug 05 2016 02:57 UTC
@sjames1958gm
Example

var myObj = {
  top: "hat",
  bottom: "pants"
};
myObj.hasOwnProperty("top");    // true
myObj.hasOwnProperty("middle"); // false
here is an example from lesson.
Stephen James
@sjames1958gm
Aug 05 2016 02:58 UTC
@nmaca Initialize a variable to 1 and multiple by each value of num as it goes to 1
Yaroslav Newman
@YaroNew
Aug 05 2016 02:58 UTC
why they give an example which doesn't work?
Stephen James
@sjames1958gm
Aug 05 2016 02:58 UTC
@YaroNew You are supposed to write a function that does that in a generic fashion using a variable
nmaca
@nmaca
Aug 05 2016 02:58 UTC
@sjames1958gm How would i write that
Yaroslav Newman
@YaroNew
Aug 05 2016 02:59 UTC
@sjames1958gm
 myObj.hasOwnProperty("checkProp"); 
 myObj.hasOwnProperty("checkProp"); 
 myObj.hasOwnProperty("checkProp"); 
 myObj.hasOwnProperty("checkProp");
nmaca
@nmaca
Aug 05 2016 02:59 UTC
would i just add:
var a = 1;
Yaroslav Newman
@YaroNew
Aug 05 2016 02:59 UTC
do you mean like that?
nmaca
@nmaca
Aug 05 2016 02:59 UTC
a*num=a;
Stephen James
@sjames1958gm
Aug 05 2016 02:59 UTC
@YaroNew Not the string only the variable. and only once, and in an if statement
nmaca
@nmaca
Aug 05 2016 02:59 UTC
?
Stephen James
@sjames1958gm
Aug 05 2016 02:59 UTC
@nmaca a *= num
nmaca
@nmaca
Aug 05 2016 03:00 UTC
that would be in the loop, correct?
Stephen James
@sjames1958gm
Aug 05 2016 03:00 UTC
@nmaca correct
@YaroNew if (myObj.hasOwnProperty(checkProp))
Yaroslav Newman
@YaroNew
Aug 05 2016 03:02 UTC
@sjames1958gm

// Setup
var myObj = {
  gift: "pony",
  pet: "kitten",
  bed: "sleigh"
};

function checkObj(checkProp) {
  // Your Code Here


  if (myObj.hasOwnProperty(checkProp)) {
    return checkObj;
}
}
// Test your code by modifying these values
checkObj("gift");
Manny Munoz
@AnimalinAshell
Aug 05 2016 03:03 UTC
This message was deleted
Yaroslav Newman
@YaroNew
Aug 05 2016 03:03 UTC
I've lost completely.
nmaca
@nmaca
Aug 05 2016 03:04 UTC
@sjames1958gm sorry, that didnt work

var myArray = [];
var a = 1;
function factorialize(num) {
while (num>0) {
num--;
myArray.push(num);
a*=num;
}
return num;
}

factorialize(5);

Stephen James
@sjames1958gm
Aug 05 2016 03:04 UTC
@YaroNew return the value of the property in checkProp on myObj
https://www.freecodecamp.com/challenges/accessing-objects-properties-with-variables
nmaca
@nmaca
Aug 05 2016 03:04 UTC
i dont understand how adding var "a" would do anything
Stephen James
@sjames1958gm
Aug 05 2016 03:05 UTC
@nmaca ditch the array. move var a = 1 inside the function and return a;
llamatarianism
@llamatarianism
Aug 05 2016 03:05 UTC
@YaroNew you're returning checkObj, which is the function
that's wrong
from the instructions:
If the property is found, return that property's value. If not, return "Not Found".
Yaroslav Newman
@YaroNew
Aug 05 2016 03:05 UTC
Why it doesn't work like it was in HTML and CSS lessons - example\code\lesson. Here we have one example and totaly different output which i have to dig out on my own.
llamatarianism
@llamatarianism
Aug 05 2016 03:05 UTC
because HTML and CSS are very different to JS
it's like expecting a maths lesson and a biology lesson to be the same
Santiago G贸mez
@Sperkajugglite
Aug 05 2016 03:06 UTC
@YaroNew you'll never see that again :(
llamatarianism
@llamatarianism
Aug 05 2016 03:06 UTC
sure, they're somewhat related subjects
but they're also very different
Santiago G贸mez
@Sperkajugglite
Aug 05 2016 03:06 UTC
@llamatarianism you changed you profile pic?
llamatarianism
@llamatarianism
Aug 05 2016 03:06 UTC
@Sperkajugglite si
Santiago G贸mez
@Sperkajugglite
Aug 05 2016 03:07 UTC
@llamatarianism bien :P
Stephen James
@sjames1958gm
Aug 05 2016 03:07 UTC
@nmaca There is no reason to create an array of numbers, just to process the array of numbers, when in the loop you can process them right there.
llamatarianism
@llamatarianism
Aug 05 2016 03:07 UTC
donde esta la biblioteca
Santiago G贸mez
@Sperkajugglite
Aug 05 2016 03:07 UTC
@llamatarianism ?
Stephen James
@sjames1958gm
Aug 05 2016 03:07 UTC
@llamatarianism That is some spanish 101 there :)
Santiago G贸mez
@Sperkajugglite
Aug 05 2016 03:07 UTC
que biblioteca?
Yaroslav Newman
@YaroNew
Aug 05 2016 03:07 UTC
@llamatarianism

// Setup
var myObj = {
  gift: "pony",
  pet: "kitten",
  bed: "sleigh"
};

function checkObj(checkProp) {
  // Your Code Here


  if (myObj.hasOwnProperty(checkProp)) {
    return "pony";
}else if (myObj.hasOwnProperty(checkProp)) {
    return "kitten";
}else if (myObj.hasOwnProperty(checkProp)) {
    return "Not Found";
}
}
// Test your code by modifying these values
checkObj("gift");
Santiago G贸mez
@Sperkajugglite
Aug 05 2016 03:07 UTC
wtf
llamatarianism
@llamatarianism
Aug 05 2016 03:07 UTC
me gusta queso en el dia calaroso
Santiago G贸mez
@Sperkajugglite
Aug 05 2016 03:07 UTC
caluroso*
Yaroslav Newman
@YaroNew
Aug 05 2016 03:07 UTC
here is my last version
doesn't work
Santiago G贸mez
@Sperkajugglite
Aug 05 2016 03:08 UTC
los computadores me lastiman
:(
llamatarianism
@llamatarianism
Aug 05 2016 03:08 UTC
@YaroNew your function will return "pony" if it does have the property
and nothing if it doesn't
Stephen James
@sjames1958gm
Aug 05 2016 03:08 UTC
@YaroNew You need only one if, use checkProp to lookup the property
https://www.freecodecamp.com/challenges/accessing-objects-properties-with-variables
@llamatarianism Is that the three headed llama that protects the gates of llamatarianism's hell?
llamatarianism
@llamatarianism
Aug 05 2016 03:09 UTC
@sjames1958gm nah
we have a much bigger, scarier llama demon guarding the gates of hell
it has 20 heads
this is its nephew
Stephen James
@sjames1958gm
Aug 05 2016 03:10 UTC
lol
Ghost
@ghost~56a80c91e610378809be5d28
Aug 05 2016 03:10 UTC
@llamatarianism You like cheese on your something something?
Santiago G贸mez
@Sperkajugglite
Aug 05 2016 03:10 UTC
@llamatarianism por que ese nombre?
nmaca
@nmaca
Aug 05 2016 03:10 UTC

function factorialize(num) {
var a=1;
while (num>0) {
num--;
a*=num;
}
return num;
}

factorialize(5);

Santiago G贸mez
@Sperkajugglite
Aug 05 2016 03:10 UTC
te gustan las llamas?
llamatarianism
@llamatarianism
Aug 05 2016 03:10 UTC
@Sperkajugglite no hablo italiano
nmaca
@nmaca
Aug 05 2016 03:10 UTC
Ughhh its still not working
Santiago G贸mez
@Sperkajugglite
Aug 05 2016 03:10 UTC
wtf es espa帽ol :P
llamatarianism
@llamatarianism
Aug 05 2016 03:10 UTC
seriously, the first thing I said was spanish 101
and the second thing was from the credits of a ninja sex party video
Ravi Kandala
@Ravikandala
Aug 05 2016 03:10 UTC

var myObj = {
gift: "pony",
pet: "kitten",
bed: "sleigh"
};

function checkObj(checkProp) {
// Your Code Here
if(myObj.hasOwnProperty(checkProp))
return myObj[checkProp];
else
return "Not Found";

}

// Test your code by modifying these values
checkObj("gift");
@YaroNew Try This..

Stephen James
@sjames1958gm
Aug 05 2016 03:10 UTC
@nmaca put the multiply before the -- or you will end up with zero (return a not num)
llamatarianism
@llamatarianism
Aug 05 2016 03:10 UTC
I'm pretty sure it means "I like cheese on a hot day"
Ken Haduch
@khaduch
Aug 05 2016 03:10 UTC

@richao03 - not sure if anyone chimed in - I came up with this (only because I couldn't figure out how the id^="_" selector was supposed to work, I could not see any documentation that stated whether or not id was a valid attribute to use there? I'm still googling. But this does get a count:

var queryJ = $('.active');
var count = 0;
$.each(queryJ, function( index, value ){
  if ( /^_/.test($(this).attr("id") ) === true ) count++;
});
console.log("Final count of items = " + count);

Maybe there is a better answer, so this might be a little brute force?

Santiago G贸mez
@Sperkajugglite
Aug 05 2016 03:11 UTC
@llamatarianism man, thats my native tongue
Ghost
@ghost~56a80c91e610378809be5d28
Aug 05 2016 03:11 UTC
lol
Santiago G贸mez
@Sperkajugglite
Aug 05 2016 03:11 UTC
i like ninjas tho
llamatarianism
@llamatarianism
Aug 05 2016 03:11 UTC
ninja sex party is a great band
Matt Fay
@username1001
Aug 05 2016 03:11 UTC
Hey, is anyone here?
llamatarianism
@llamatarianism
Aug 05 2016 03:11 UTC
featuring such amazing songs as:
Santiago G贸mez
@Sperkajugglite
Aug 05 2016 03:11 UTC
alguien ha visto suicide squad?
Stephen James
@sjames1958gm
Aug 05 2016 03:11 UTC
@username1001 No, no-one is here.
llamatarianism
@llamatarianism
Aug 05 2016 03:12 UTC
  • peppermint creams
  • dinosaur laser fight
  • if we were gay
  • the manticore
  • objects of desire
Ghost
@ghost~56a80c91e610378809be5d28
Aug 05 2016 03:12 UTC
shhh don't move and it can't see you @sjames1958gm
Yaroslav Newman
@YaroNew
Aug 05 2016 03:12 UTC
@Ravikandala

// Setup
var myObj = {
  gift: "pony",
  pet: "kitten",
  bed: "sleigh"
};

function checkObj(checkProp) {
  // Your Code Here


  if (myObj.hasOwnProperty(checkProp)) {
    return myObj(checkProp);
}else 
    return "Not Found";

}
// Test your code by modifying these values
checkObj("gift");
nOPE!
nmaca
@nmaca
Aug 05 2016 03:12 UTC
@sjames1958gm If you dont mind me asking, what is your thought process when coding, because you seeem to know everything lol
llamatarianism
@llamatarianism
Aug 05 2016 03:12 UTC
you're meant to use square brackets
not parens
Stephen James
@sjames1958gm
Aug 05 2016 03:12 UTC
@YaroNew Close - use [] not () for the access.
Matt Fay
@username1001
Aug 05 2016 03:12 UTC
@sjames1958gm , I guess I'll just leave then... You JS program...
llamatarianism
@llamatarianism
Aug 05 2016 03:12 UTC
myObj is an object, not a function
@username1001 we're all figments of your imagination
you've been in a coma for 60 years
PLEASE WAKE UP SON
Stephen James
@sjames1958gm
Aug 05 2016 03:13 UTC
@nmaca Do you remember 1975?
Yaroslav Newman
@YaroNew
Aug 05 2016 03:13 UTC
for **
Matt Fay
@username1001
Aug 05 2016 03:13 UTC
@llamatarianism, Don't tell a crazy person that, they may just believe you.
Yaroslav Newman
@YaroNew
Aug 05 2016 03:13 UTC
OMG
!!!
Stephen James
@sjames1958gm
Aug 05 2016 03:13 UTC
@YaroNew :)
Ravi Kandala
@Ravikandala
Aug 05 2016 03:13 UTC
That will Work @YaroNew Check Once again.
llamatarianism
@llamatarianism
Aug 05 2016 03:13 UTC
@Ravikandala no it won't
myObj is not a function
Yaroslav Newman
@YaroNew
Aug 05 2016 03:14 UTC
squire brackets... my * YES IT WORKS
nmaca
@nmaca
Aug 05 2016 03:14 UTC
@sjames1958gm personally no... If thats a reference to something, im sorry haha
Stephen James
@sjames1958gm
Aug 05 2016 03:14 UTC
@nmaca I wrote my first program that year :)
Yaroslav Newman
@YaroNew
Aug 05 2016 03:14 UTC
thanks everybody! see you tomorrow !
Stephen James
@sjames1958gm
Aug 05 2016 03:15 UTC
@nmaca I kind of assumed you were likely not born yet?
Yaroslav Newman
@YaroNew
Aug 05 2016 03:15 UTC
@Ravikandala thx
CamperBot
@camperbot
Aug 05 2016 03:15 UTC
yaronew sends brownie points to @ravikandala :sparkles: :thumbsup: :sparkles:
:cookie: 270 | @ravikandala |http://www.freecodecamp.com/ravikandala
Santiago G贸mez
@Sperkajugglite
Aug 05 2016 03:15 UTC
bye
Yaroslav Newman
@YaroNew
Aug 05 2016 03:15 UTC
@sjames1958gm thx
CamperBot
@camperbot
Aug 05 2016 03:15 UTC
yaronew sends brownie points to @sjames1958gm :sparkles: :thumbsup: :sparkles:
:star2: 2360 | @sjames1958gm |http://www.freecodecamp.com/sjames1958gm
Stephen James
@sjames1958gm
Aug 05 2016 03:15 UTC
@Sperkajugglite Adios
@YaroNew :+1:
Yaroslav Newman
@YaroNew
Aug 05 2016 03:15 UTC
@llamatarianism thx
CamperBot
@camperbot
Aug 05 2016 03:15 UTC
yaronew sends brownie points to @llamatarianism :sparkles: :thumbsup: :sparkles:
:star2: 1132 | @llamatarianism |http://www.freecodecamp.com/llamatarianism
Matt Fay
@username1001
Aug 05 2016 03:15 UTC
So, I've been learning JS for like two years(on and off), I feel I've grasped enough info to understand(a fragment), but I still cannot connect the stuff together to create things. How can I change this?
Santiago G贸mez
@Sperkajugglite
Aug 05 2016 03:15 UTC
@sjames1958gm hasta ma帽ana :P
eeflores
@eeflores
Aug 05 2016 03:16 UTC
@username1001 ya gotta get in there and make mistakes
Santiago G贸mez
@Sperkajugglite
Aug 05 2016 03:16 UTC
@username1001 empieza a hacer cosas!!!
seriously tho
nmaca
@nmaca
Aug 05 2016 03:16 UTC
@sjames1958gm that is correct
Santiago G贸mez
@Sperkajugglite
Aug 05 2016 03:16 UTC
if you don't practice
it doesn't matter how much you have read
you just can't apply it
Ravi Kandala
@Ravikandala
Aug 05 2016 03:16 UTC
It will work dude @llamatarianism myObj is an object ...we can use dot operator to object wright?
nmaca
@nmaca
Aug 05 2016 03:16 UTC
@sjames1958gm so i guess practice is everything then
llamatarianism
@llamatarianism
Aug 05 2016 03:16 UTC
yeah
Stephen James
@sjames1958gm
Aug 05 2016 03:16 UTC
@nmaca To be serious, I have seen so many of these patterns, that for me they jump out.
With practice you will begin to see what patterns work and what don't when you see a specific error message what is the first thing to check.
Santiago G贸mez
@Sperkajugglite
Aug 05 2016 03:16 UTC
@username1001 so, my advice is start practicing :P
llamatarianism
@llamatarianism
Aug 05 2016 03:17 UTC
but not if you're trying to access something using a variable
and he wasn't using dot or bracket notation
he was using parens
nmaca
@nmaca
Aug 05 2016 03:17 UTC
@sjames1958gm do you think this is the best way to start for a beginner?
Santiago G贸mez
@Sperkajugglite
Aug 05 2016 03:18 UTC
@nmaca i think so
Sabrina Ferguson
@itsacoyote
Aug 05 2016 03:18 UTC
@nmaca it's a great way to do it
Santiago G贸mez
@Sperkajugglite
Aug 05 2016 03:18 UTC
just practice what you learn with other proyects
Stephen James
@sjames1958gm
Aug 05 2016 03:18 UTC
@nmaca This is a good way, esp. the chat is helpful to get over hurdles and the people here want to have you get the answer not give you the answer.
Try codewars as a practice tool
Matt Fay
@username1001
Aug 05 2016 03:18 UTC
@Sperkajugglite , yes, I know, but it's hard when I cannot know what to connect together. I feel like everything is right in front of me, but my mind is cloggeddddd
Santiago G贸mez
@Sperkajugglite
Aug 05 2016 03:18 UTC
i read in medium a guy who recreated all the front end projects again in order to learn React :O
Matt Fay
@username1001
Aug 05 2016 03:18 UTC
I've been practicing a little though, guess I need more
Stephen James
@sjames1958gm
Aug 05 2016 03:19 UTC
@Sperkajugglite That is my plan.
Santiago G贸mez
@Sperkajugglite
Aug 05 2016 03:19 UTC
@username1001 what challenge are you on?
@sjames1958gm do you want to recreate them all?
@sjames1958gm what are you learning rn?
Stephen James
@sjames1958gm
Aug 05 2016 03:19 UTC
@Sperkajugglite Maybe not the tribute or portfolio, but the more dynami ones.
Santiago G贸mez
@Sperkajugglite
Aug 05 2016 03:19 UTC
@sjames1958gm you are on React?
Sabrina Ferguson
@itsacoyote
Aug 05 2016 03:19 UTC
@username1001 Only three months ago I had the similar issue as well. I pushed forward and kept working on a project, reading more, reading an article on javascript every day, slogging my way through problems. You'll realize you'll get to a point where you're doing more problem solving and not solving the bug problem eventually.
Stephen James
@sjames1958gm
Aug 05 2016 03:20 UTC
@Sperkajugglite yeah, I just submitted the game of life challenge.
Santiago G贸mez
@Sperkajugglite
Aug 05 2016 03:20 UTC
i am too man!!! :) @sjames1958gm
Matt Fay
@username1001
Aug 05 2016 03:20 UTC
@Sperkajugglite I'm on "Basic Algorithm Scripting": Confirm the ending.
Santiago G贸mez
@Sperkajugglite
Aug 05 2016 03:20 UTC
i am trying to do the first one
Stephen James
@sjames1958gm
Aug 05 2016 03:20 UTC
@username1001 Don't be satisfied with your project, keep adding as you learn, add new stuff you learn to existing projects.
nmaca
@nmaca
Aug 05 2016 03:20 UTC
@sjames1958gm is coding a hobby or part of a job for you
Santiago G贸mez
@Sperkajugglite
Aug 05 2016 03:21 UTC
@Sperkajugglite it doesnt seem too hard, i found an API that did all the markup
just css decided to stop working
Ken Haduch
@khaduch
Aug 05 2016 03:21 UTC
@richao03 - this also seems to work - try this: console.log($('[id^="_"].active').length); - it outputs the length that you are looking for.
Matt Fay
@username1001
Aug 05 2016 03:21 UTC
@itsacoyote , Yeah, I've experienced the gratification like that, but I still continue getting stuck. I realize where I need practice, I believe.
Stephen James
@sjames1958gm
Aug 05 2016 03:21 UTC
@nmaca I program for a living and I program as a hobby trying to get into this web stuff to stay current. Don't want to be a Walmart greeter :)
Richard
@richao03
Aug 05 2016 03:21 UTC
@khaduch thank you so much
CamperBot
@camperbot
Aug 05 2016 03:21 UTC
richao03 sends brownie points to @khaduch :sparkles: :thumbsup: :sparkles:
:star2: 1512 | @khaduch |http://www.freecodecamp.com/khaduch
Matt Fay
@username1001
Aug 05 2016 03:21 UTC
@sjames1958gm, True, and I do such.
bitgrower
@bitgrower
Aug 05 2016 03:22 UTC
khaduch ... how you been!!!!
Richard
@richao03
Aug 05 2016 03:22 UTC
@khaduch you are a gentleman and a scholar!
Santiago G贸mez
@Sperkajugglite
Aug 05 2016 03:22 UTC
@sjames1958gm do you use codepen?
Matt Fay
@username1001
Aug 05 2016 03:22 UTC
Thank you all, for adding to my motivation, it makes me want to continue with programming :)
Stephen James
@sjames1958gm
Aug 05 2016 03:22 UTC
@username1001 I think that the challenge you are on is one that has an easy solution, but not an easy solution to see until you see it.
@Sperkajugglite yes
bitgrower
@bitgrower
Aug 05 2016 03:22 UTC
@sjames1958gm which one is he on ? Stand in Line ?
Santiago G贸mez
@Sperkajugglite
Aug 05 2016 03:22 UTC
@sjames1958gm i am trying with github, but i think ill just finish them all in codepen too
Stephen James
@sjames1958gm
Aug 05 2016 03:23 UTC
@Sperkajugglite It is giving me problems it keeps reordering the libraries putting reactDOM first and then my page stops working.
@bitgrower confirm the ending
Santiago G贸mez
@Sperkajugglite
Aug 05 2016 03:23 UTC
@sjames1958gm its a mess
Stephen James
@sjames1958gm
Aug 05 2016 03:23 UTC
@Sperkajugglite codepen let's you get to the React/Sass without the set up pain.
bitgrower
@bitgrower
Aug 05 2016 03:23 UTC
ah yes ... actually there are a few challenges like that ... it's like all the mental gears have to see how they connect ... then BOOM!
Santiago G贸mez
@Sperkajugglite
Aug 05 2016 03:24 UTC
@sjames1958gm i think i will start rn
Ken Haduch
@khaduch
Aug 05 2016 03:24 UTC
@richao03 - one more - trying it with the class first: console.log($('.active[id^="_"]').length); (not obvious!)
Santiago G贸mez
@Sperkajugglite
Aug 05 2016 03:24 UTC
look all the files i have :O
Richard
@richao03
Aug 05 2016 03:24 UTC
i want to send u real cookies
thanks again @khaduch
CamperBot
@camperbot
Aug 05 2016 03:24 UTC
:warning: richao03 already gave khaduch points
richao03 sends brownie points to @khaduch :sparkles: :thumbsup: :sparkles:
Stephen James
@sjames1958gm
Aug 05 2016 03:25 UTC
@username1001 Don't be afraid to just read the MDN pages. the examples there, some don't like the style but there are good nuggets
@Sperkajugglite How do you run those - you posted yesterday a link, but I wasn't sure that I didn't need to clone it on a local machine to run.
Matt Fay
@username1001
Aug 05 2016 03:26 UTC
@sjames1958gm, I find them hard to digest, but I know that's something to become proficient in
Santiago G贸mez
@Sperkajugglite
Aug 05 2016 03:26 UTC
@sjames1958gm i created a script in my package.json, so you just say npm run start
bitgrower
@bitgrower
Aug 05 2016 03:26 UTC
help js resources
Santiago G贸mez
@Sperkajugglite
Aug 05 2016 03:26 UTC
and it starts a local server
:)
Stephen James
@sjames1958gm
Aug 05 2016 03:26 UTC
@Sperkajugglite so you do have to git clone
Santiago G贸mez
@Sperkajugglite
Aug 05 2016 03:26 UTC
haven't been able to make it work on github tho
bitgrower
@bitgrower
Aug 05 2016 03:27 UTC
if you open up that page ... you'll find another resource instead of using MDN ... devdocs.io, I believe ...
some people prefer it over MDN
Santiago G贸mez
@Sperkajugglite
Aug 05 2016 03:27 UTC
@sjames1958gm yes, i have a folder in my computer and i update the github from my desktop github
Stephen James
@sjames1958gm
Aug 05 2016 03:27 UTC
@bitgrower yeah, I like the reference style, but I am probably unusual in that (and in other things :))
That's it for me today - night all
nmaca
@nmaca
Aug 05 2016 03:32 UTC
Any one here?
Matt Fay
@username1001
Aug 05 2016 03:32 UTC
@nmaca Yeah, lol I just asked the same question like 10 minutes ago
How are you ?
Santiago G贸mez
@Sperkajugglite
Aug 05 2016 03:33 UTC
@sjames1958gm screenshot
nmaca
@nmaca
Aug 05 2016 03:33 UTC
Im alright
Matt Fay
@username1001
Aug 05 2016 03:33 UTC
good good
bitgrower
@bitgrower
Aug 05 2016 03:33 UTC
@nmaca what's up ?
nmaca
@nmaca
Aug 05 2016 03:33 UTC
Not much
just slowing dying because coding makes me feels so dumb
bitgrower
@bitgrower
Aug 05 2016 03:34 UTC
@sjames1958gm night night
nmaca
@nmaca
Aug 05 2016 03:34 UTC
its only my 5th day though so i can get better :smile:
bitgrower
@bitgrower
Aug 05 2016 03:35 UTC
it's called the humility challenge ... don't worry, you'll get over it (to a degree)... it's kinda like learning another human language ... having the "vocabulary" so you can express yourself ..
nmaca
@nmaca
Aug 05 2016 03:35 UTC
yeah thats it
so i write what i want to do on paper
but i cant translate it on the screen
bitgrower
@bitgrower
Aug 05 2016 03:35 UTC
good plan ... :)
Michael Noronha
@mtn
Aug 05 2016 03:35 UTC
Anybody have experience connecting services with APIs that can help me?
bitgrower
@bitgrower
Aug 05 2016 03:36 UTC
it's still a great way to start, @nmaca --
@michaeltnoronha sorry, no ...
I kinda dropped out in terms of following the track before I got there ...
nmaca
@nmaca
Aug 05 2016 03:36 UTC
@bitgrower can you help me out with my Palindrome program by any chance?
bitgrower
@bitgrower
Aug 05 2016 03:36 UTC
I can try ... :)
nmaca
@nmaca
Aug 05 2016 03:36 UTC
i want to finish one last one before going to bed
sweet
bitgrower
@bitgrower
Aug 05 2016 03:37 UTC
can you post your code ... ?
nmaca
@nmaca
Aug 05 2016 03:37 UTC

var a = "";
function palindrome(str) {
// Good luck!
if (str.toLowerCase().split("").reverse().join("") == str.toLowerCase()) {
return true;
} else {
return false;
}
}

palindrome("eye");

So for the most part, it works.
bitgrower
@bitgrower
Aug 05 2016 03:37 UTC
gotta learn to post your code with markdown formatting ... @nmaca
DJ
@qualitymanifest
Aug 05 2016 03:37 UTC
@nmaca you need to remove all non-alphanumerics and spaces
bitgrower
@bitgrower
Aug 05 2016 03:37 UTC
help formatting
CamperBot
@camperbot
Aug 05 2016 03:37 UTC

:point_right: code formatting [wiki]

Multi line Code

```js 鈬 Type 3 backticks and then press [shift + enter 鈴嶿 (type js or html or css)

<paste your code here>,
then press [shift + enter ⏎]

``` 鈬 Type 3 backticks, then press [enter 鈴嶿

Single line Code

This an inline `<paste code here>` code formatting with a single backtick() at _start_ and _end_ around thecode`.

See also: 鈽 How to type Backticks | 鈽 Compose Mode | 鉂 Gitter Formatting Basics

:pencil: read more about code formatting on the FCC Wiki

nmaca
@nmaca
Aug 05 2016 03:37 UTC
however, whenever theres a space, hell breaks loose
abdishakur88
@abdishakur88
Aug 05 2016 03:38 UTC
Manipulate Arrays With pop.i need help with this
bitgrower
@bitgrower
Aug 05 2016 03:38 UTC
@nmaca -- yeah, that's kinda what @qualitymanifest was trying to tell you ... but it's more than just spaces ... :)
Santiago G贸mez
@Sperkajugglite
Aug 05 2016 03:38 UTC
@abdishakur88 yes sir, what do you need ?
:P
nmaca
@nmaca
Aug 05 2016 03:39 UTC
so do i put all the stuff i want to take out in an array, then put use the remove function?
bitgrower
@bitgrower
Aug 05 2016 03:39 UTC
you use regular expressions, use str.replace
abdishakur88
@abdishakur88
Aug 05 2016 03:39 UTC
myArray = ["cat"] & removedFromMyArray = 2
nmaca
@nmaca
Aug 05 2016 03:40 UTC
Str.replace(all the stuff i don't want)
abdishakur88
@abdishakur88
Aug 05 2016 03:40 UTC
this is the output it is giving me
nmaca
@nmaca
Aug 05 2016 03:40 UTC
right?
Santiago G贸mez
@Sperkajugglite
Aug 05 2016 03:40 UTC
bitter should remove this awful green stuff that all over the place when you open your computer
bitgrower
@bitgrower
Aug 05 2016 03:40 UTC
it can be done either way ... it's more of a design decision ... what is it that you want to keep (match) is usually the way you do it .
abdishakur88
@abdishakur88
Aug 05 2016 03:41 UTC
@Sperkajugglite you can open, Manipulate Arrays With pop
Santiago G贸mez
@Sperkajugglite
Aug 05 2016 03:41 UTC
@abdishakur88 what do you mean by open?
abdishakur88
@abdishakur88
Aug 05 2016 03:43 UTC
i need the solution to this title "Manipulate Arrays With pop"in javascript @Sperkajugglite
nmaca
@nmaca
Aug 05 2016 03:43 UTC
Ok its getting a bit too hard to concentrate haha @bitgrower i'll try again tomorrow. Thanks so much for the help.
CamperBot
@camperbot
Aug 05 2016 03:43 UTC
nmaca sends brownie points to @bitgrower :sparkles: :thumbsup: :sparkles:
:star2: 1167 | @bitgrower |http://www.freecodecamp.com/bitgrower
James S.
@Mrblue27
Aug 05 2016 03:43 UTC
'''
CamperBot
@camperbot
Aug 05 2016 03:43 UTC
:bulb: to format code use backticks! ``` more info
Santiago G贸mez
@Sperkajugglite
Aug 05 2016 03:43 UTC
help Manipulate Arrays With pop
CamperBot
@camperbot
Aug 05 2016 03:43 UTC

:point_right: challenge manipulate arrays with pop [wiki]

Challenge Manipulate Arrays With pop

Another way to change the data in an array is with the .pop() function.

.pop() is used to "pop" a value off of the end of an array. We can retrieve this value by performing pop() in a variable declaration.

Any type of variable can be "popped" off of an array.

:pencil: read more about challenge manipulate arrays with pop on the FCC Wiki

Santiago G贸mez
@Sperkajugglite
Aug 05 2016 03:43 UTC
@abdishakur88 what is you code?
James S.
@Mrblue27
Aug 05 2016 03:44 UTC

```function testElse(val) {
var result = "";
// Only change code below this line

if (val > 5) {
result = "Bigger than 5";
} else {result = "5 or Smaller";}

result = "5 or Smaller";

}

// Only change code above this line
return result;
}

// Change this value to test
testElse(4);

```
Whats wrong with my else statement

Subramanya Chakravarthy
@chakrihacker
Aug 05 2016 03:45 UTC
@Mrblue27 else {result = "5 or Smaller";}
see the semicolon
abdishakur88
@abdishakur88
Aug 05 2016 03:45 UTC

// Example
var ourArray = [1,2,3];
var removedFromOurArray = ourArray.pop();
// removedFromOurArray now equals 3, and ourArray now equals [1,2]

// Setup
var myArray = [["John", 23], ["cat", 2].pop()];

// Only change code below this line.
//myArray.pop();
var removedFromMyArray = myArray.pop();
@Sperkajugglite

Enoch Johnson
@Enocholas
Aug 05 2016 03:46 UTC
Check out my tribute page. Feedback more than welcomed.
Santiago G贸mez
@Sperkajugglite
Aug 05 2016 03:46 UTC
@abdishakur88 i didn't read it all, but .pop() should go outside the "]"
its a 2d array
so it should pop ["cat", 2]
idk if thats what you are trying to do
Subramanya Chakravarthy
@chakrihacker
Aug 05 2016 03:48 UTC
@Enocholas nice page try to give padding to text both sides
Puvendran Pillay
@puven12
Aug 05 2016 03:48 UTC
hello, how do i get around this
var array = ['powwow', 'pophu', 'drawdoll', 'lolpopdol', 'tre'];
array = array.map(function(a) {
return a.length;   // this works
}).sort(function(a, b) {
return a - b;   // got skipped  WHY?
});
return array;    // this works
Subramanya Chakravarthy
@chakrihacker
Aug 05 2016 03:48 UTC
The paragraphs are attached to the ends of browser
Santiago G贸mez
@Sperkajugglite
Aug 05 2016 03:48 UTC
@chakrihacker yeah, its nice tho
James S.
@Mrblue27
Aug 05 2016 03:49 UTC

function testElse(val) {
  var result = "";
  // Only change code below this line

  if (val > 5) {
    result = "Bigger than 5";
  } else {
    result = "5 or Smaller";}


  }

  // Only change code above this line
  return result;
}

// Change this value to test
testElse(6);
What does unrecoverable syntax means
stonefmagiecurata
@stonefmagiecurata
Aug 05 2016 03:49 UTC
@puven12 when you write return it doesn;t run the function further
abdishakur88
@abdishakur88
Aug 05 2016 03:49 UTC
@Sperkajugglite .i have tried that and it is not giving me the expected output
Subramanya Chakravarthy
@chakrihacker
Aug 05 2016 03:49 UTC
@puven12 when return statement is executed js comes out of loop
Santiago G贸mez
@Sperkajugglite
Aug 05 2016 03:49 UTC
@abdishakur88 what are you supposed to do?
remove the last arr
or the last item from the last arr
Subramanya Chakravarthy
@chakrihacker
Aug 05 2016 03:50 UTC
@Mrblue27 see semicolon in else statement
Santiago G贸mez
@Sperkajugglite
Aug 05 2016 03:50 UTC
@Sperkajugglite if the 2nd, try arr1.pop or something like that :P
James S.
@Mrblue27
Aug 05 2016 03:51 UTC
@chakrihacker I figured it out had an extra bracket Thanks
CamperBot
@camperbot
Aug 05 2016 03:51 UTC
mrblue27 sends brownie points to @chakrihacker :sparkles: :thumbsup: :sparkles:
:cookie: 285 | @chakrihacker |http://www.freecodecamp.com/chakrihacker
abdishakur88
@abdishakur88
Aug 05 2016 03:51 UTC
i am supposed to remove the last array
@Sperkajugglite
Puvendran Pillay
@puven12
Aug 05 2016 03:51 UTC
@chakrihacker @stonefmagiecurata thanks i found it.... i just need to change the arguments for the callback function in the .sort() method
CamperBot
@camperbot
Aug 05 2016 03:51 UTC
puven12 sends brownie points to @chakrihacker and @stonefmagiecurata :sparkles: :thumbsup: :sparkles:
:cookie: 287 | @stonefmagiecurata |http://www.freecodecamp.com/stonefmagiecurata
:cookie: 286 | @chakrihacker |http://www.freecodecamp.com/chakrihacker
Luke
@lukede
Aug 05 2016 03:52 UTC
can anyone else to me how the filter function works?
Subramanya Chakravarthy
@chakrihacker
Aug 05 2016 03:52 UTC
see the mozilla documentation
link is given in the problem page
@lukede
Luke
@lukede
Aug 05 2016 03:53 UTC
thanks
Santiago G贸mez
@Sperkajugglite
Aug 05 2016 03:53 UTC
@abdishakur88 then bigger.pop()
stonefmagiecurata
@stonefmagiecurata
Aug 05 2016 03:53 UTC
@lukede if statement is true inside the callback function, then it returns value at current index, else not
Santiago G贸mez
@Sperkajugglite
Aug 05 2016 03:53 UTC
thats it man :)
Enoch Johnson
@Enocholas
Aug 05 2016 03:55 UTC
@chakrihacker Will do. Appreciate the advice.
Luke
@lukede
Aug 05 2016 03:55 UTC
@stonefmagiecurata is a callback function just where you write a line of code outside the function brackets that has the name of the function?
I guess I'm struggling to understand callback
abdishakur88
@abdishakur88
Aug 05 2016 03:56 UTC
@Sperkajugglite what do you mean by "bigger.pop()"
stonefmagiecurata
@stonefmagiecurata
Aug 05 2016 03:56 UTC
@lukede filter takes one argument, a function...that's the callback function
Santiago G贸mez
@Sperkajugglite
Aug 05 2016 03:57 UTC
@abdishakur88 the array that contains the other arr
stonefmagiecurata
@stonefmagiecurata
Aug 05 2016 03:57 UTC
@lukede array.filter( function() {} <- this is the callback function )
Greg Duncan
@GregatGit
Aug 05 2016 03:58 UTC
@lukede fitler() is something that takes a bit to get your head around - I recomend going to https://repl.it/ and writing a small chunk of code that filters out all the even or odd numbers in an array
Santiago G贸mez
@Sperkajugglite
Aug 05 2016 03:58 UTC
@GregatGit what is that page man?
Luke
@lukede
Aug 05 2016 03:58 UTC
@GregatGit yes, thanks. That's exactly how I'm feeling
CamperBot
@camperbot
Aug 05 2016 03:58 UTC
lukede sends brownie points to @gregatgit :sparkles: :thumbsup: :sparkles:
:cookie: 722 | @gregatgit |http://www.freecodecamp.com/gregatgit
Santiago G贸mez
@Sperkajugglite
Aug 05 2016 03:58 UTC
@GregatGit @Sperkajugglite its like wizardry
this is a game changer :O
Greg Duncan
@GregatGit
Aug 05 2016 03:59 UTC
@Sperkajugglite its a place where you can practice you code and see what out puts you are getting
Santiago G贸mez
@Sperkajugglite
Aug 05 2016 03:59 UTC
@GregatGit thanks !!!
CamperBot
@camperbot
Aug 05 2016 03:59 UTC
sperkajugglite sends brownie points to @gregatgit :sparkles: :thumbsup: :sparkles:
:cookie: 723 | @gregatgit |http://www.freecodecamp.com/gregatgit
Puvendran Pillay
@puven12
Aug 05 2016 03:59 UTC
why doesn't the return statement in the callback of Array methods such as .sort() and .reduce() gets "skipped" ?
Greg Duncan
@GregatGit
Aug 05 2016 04:00 UTC
@lukede if you get stuck paste your code back here and we can see where your thinking is
llamatarianism
@llamatarianism
Aug 05 2016 04:00 UTC
@puven12 "skipped"?
what do you mean skipped
Puvendran Pillay
@puven12
Aug 05 2016 04:01 UTC
@llamatarianism sorry i meant why doesn't the program stop at that point?
llamatarianism
@llamatarianism
Aug 05 2016 04:02 UTC
because that's not how they work
Joseph
@revisualize
Aug 05 2016 04:02 UTC

https://www.youtube.com/watch?v=sBzRwzY7G-k

...
If you want the video to go away ... type: /collapse

Luke
@lukede
Aug 05 2016 04:03 UTC
@GregatGit Thanks. I've been trying to see if I can figure it out.
CamperBot
@camperbot
Aug 05 2016 04:03 UTC
lukede sends brownie points to @gregatgit :sparkles: :thumbsup: :sparkles:
:warning: lukede already gave gregatgit points
llamatarianism
@llamatarianism
Aug 05 2016 04:03 UTC
the callbacks to functions like sort and map and reduce and so on must return something for every value
there's no way to make them stop early on
Santiago G贸mez
@Sperkajugglite
Aug 05 2016 04:03 UTC
@llamatarianism has vuelto, mi querido amigo :)
llamatarianism
@llamatarianism
Aug 05 2016 04:04 UTC
no hablo ricerino
Santiago G贸mez
@Sperkajugglite
Aug 05 2016 04:04 UTC
wtf is ricerino?
Puvendran Pillay
@puven12
Aug 05 2016 04:05 UTC
@llamatarianism so those are the exception?
llamatarianism
@llamatarianism
Aug 05 2016 04:05 UTC
@Sperkajugglite a misspelling of rice-a-roni
the san francisco treat
Santiago G贸mez
@Sperkajugglite
Aug 05 2016 04:06 UTC
@llamatarianism no tengo ni idea :P
Chris Cullen
@123xylem
Aug 05 2016 04:06 UTC
 var mySet = new Set(arr0+arr1);




     return mySet;
WHy is myset returning {} ?? If i say return arr0 it shows a working array... ive tried seperate and together but theyre not turingni into sets
 var mySet = new Set(arr0+arr1);




     return mySet;
WHy is myset returning {} ?? If i say return arr0 it shows a working array... ive tried seperate and together but theyre not turingni into sets
Abis Mal
@abisthecodermal
Aug 05 2016 04:17 UTC
can anyone explain $.ajax to me please? I have questions
good night guys
@llamatarianism @llamatarianism hasta ma帽ana peque帽o :P
stonefmagiecurata
@stonefmagiecurata
Aug 05 2016 04:25 UTC
@manucpp hey man, still working on the api?
Abis Mal
@abisthecodermal
Aug 05 2016 04:25 UTC
@stonefmagiecurata , my man!!! Wassup!!
this time its twitch. I am trying to learn $.ajax for it...
stonefmagiecurata
@stonefmagiecurata
Aug 05 2016 04:26 UTC
@manucpp I'm trying to figure out the best moves for the tic-tac-toe game :D, never played the game before
Abis Mal
@abisthecodermal
Aug 05 2016 04:27 UTC
Damn
The game is fun!!!
stonefmagiecurata
@stonefmagiecurata
Aug 05 2016 04:27 UTC
@manucpp did you check the documentation on it?
Abis Mal
@abisthecodermal
Aug 05 2016 04:27 UTC
I don't understand half of it.
Yes
Brandon Bowers
@Bowers96
Aug 05 2016 04:31 UTC
function testLogicalOr(val) {
  // Only change code below this line

  if (val <= 10 || val >= 20) {
    return "Outside";
  }

  // Only change code above this line
  return "Inside";
}

// Change this value to test
testLogicalOr(5);
What am I missing guys?
Combine the two if statements into one statement which returns "Outside" if val is not between 10 and 20, inclusive. Otherwise, return "Inside".
Anybody?
Puvendran Pillay
@puven12
Aug 05 2016 04:35 UTC
is an assignment a = 'apple'; a expressiona=='apple';?
Seung Won Lee
@leesw98
Aug 05 2016 04:36 UTC
Hello all, I don't quite understand how to make a functions so that I can do stuff like "addTogether(2)(3);" Console gives me "TypeError: addTogether(...) is not a function"
function*
Puvendran Pillay
@puven12
Aug 05 2016 04:37 UTC
@Bowers96 add else ?
Seung Won Lee
@leesw98
Aug 05 2016 04:38 UTC
@puven12 @Bowers96 Yea. add else :P
Puvendran Pillay
@puven12
Aug 05 2016 04:39 UTC
@leesw98 addTogether(a, b);arguments are separated by commas , in ()
John Alcher
@alchermd
Aug 05 2016 04:40 UTC
Can you guys checkout my Pomodoro Clock? This is a special project for me since I developed it locally (instead of Codepen). Hit me up with some feedback!
https://htmlpreview.github.io/?https://github.com/alchermd/pomodoro_clock/blob/master/index.html
Seung Won Lee
@leesw98
Aug 05 2016 04:40 UTC
@Bowers96 Oh my bad. If you do "val <= 10" you are including 10 as outside. so do "val < 10 || val > 20"
@puven12 Nope. I already tried that before
Puvendran Pillay
@puven12
Aug 05 2016 04:41 UTC
@alchermd https://gitter.im/FreeCodeCamp/CodeReview
post it there. those guys would love to review your code.
Joshua Sullivan
@jaesulli95
Aug 05 2016 04:42 UTC
Does anyone know whats up with the Record Collections challenge?
Seung Won Lee
@leesw98
Aug 05 2016 04:42 UTC
@puven12 Requirement says "addTogether(2)(3) should return 5."
Puvendran Pillay
@puven12
Aug 05 2016 04:42 UTC
@leesw98 paste your whole code. lemme see.
John Alcher
@alchermd
Aug 05 2016 04:42 UTC
@puven12 I just did earlier! I want to share it to this channel since you guys helped me a lot on this one :D
Abis Mal
@abisthecodermal
Aug 05 2016 04:43 UTC
Thanks again @stonefmagiecurata.
CamperBot
@camperbot
Aug 05 2016 04:43 UTC
manucpp sends brownie points to @stonefmagiecurata :sparkles: :thumbsup: :sparkles:
:cookie: 288 | @stonefmagiecurata |http://www.freecodecamp.com/stonefmagiecurata
Puvendran Pillay
@puven12
Aug 05 2016 04:44 UTC
@alchermd looks great... just put the numbers in a box and it will look cleaner
Seung Won Lee
@leesw98
Aug 05 2016 04:45 UTC
@puven12 I don't have anything in it. I was modular testing.
function addTogether(a, b) {

  return arguments;
}

addTogether(2)(3);
btw the assignment name is "Arguments Optional"
Manjot Singh
@msingh18
Aug 05 2016 04:46 UTC
<ul id="on">
    <li>List item</li>
    <li>List item</li>
    <li>List item</li>
</ul>

<script>
$('#on').on('click', 'li', function() {
    $(this).parent().append($('<li>List item</li>'));
});
</script>
Can someone please explain the use of 'li' argument in the jQuery function?
Sabrina Ferguson
@itsacoyote
Aug 05 2016 04:48 UTC
@msingh18 as in the li in the click part , or the append?
Manjot Singh
@msingh18
Aug 05 2016 04:48 UTC
@itsacoyote click part
Puvendran Pillay
@puven12
Aug 05 2016 04:48 UTC
@leesw98 you are outta my league sorry
Sabrina Ferguson
@itsacoyote
Aug 05 2016 04:49 UTC
@msingh18 it's to specify what you want to trigger the click on. $("#on") specifies the parent, the ul, and the click we want to trigger on a child inside the ul, this being the li
NixonRichard
@NixonRichard
Aug 05 2016 04:49 UTC
Hi there
I got a one line code
for the challenge Confirm the ending
function confirmEnding(str, target) {
  // "Never give up and good luck will find you."
  // -- Falcor
 return   str.substring(str.length -target.length) == target;



}


confirmEnding("He has to give me a new name", "name");
Seung Won Lee
@leesw98
Aug 05 2016 04:50 UTC
@puven12 lol ok ty for trying at least
CamperBot
@camperbot
Aug 05 2016 04:50 UTC
leesw98 sends brownie points to @puven12 :sparkles: :thumbsup: :sparkles:
:cookie: 274 | @puven12 |http://www.freecodecamp.com/puven12
NixonRichard
@NixonRichard
Aug 05 2016 04:50 UTC
LOL
Sabrina Ferguson
@itsacoyote
Aug 05 2016 04:50 UTC
@leesw98 oh, still need help with that?
Joseph
@revisualize
Aug 05 2016 04:50 UTC
@NixonRichard You can remove a large section of that code.
Seung Won Lee
@leesw98
Aug 05 2016 04:50 UTC
@itsacoyote Yes plz :)
NixonRichard
@NixonRichard
Aug 05 2016 04:51 UTC
@revisualize Really ?
with another method ?
Darth Skywalker
@adityaparab
Aug 05 2016 04:51 UTC
@NixonRichard : Even shorter version
return   str.substring(-target.length) == target;
Joseph
@revisualize
Aug 05 2016 04:51 UTC
@NixonRichard
const confirmEnding = (s, t) => s.substring(-t.length) == t;
Manjot Singh
@msingh18
Aug 05 2016 04:52 UTC
@itsacoyote thank you Sabrina, explained perfectly
CamperBot
@camperbot
Aug 05 2016 04:52 UTC
msingh18 sends brownie points to @itsacoyote :sparkles: :thumbsup: :sparkles:
:cookie: 219 | @itsacoyote |http://www.freecodecamp.com/itsacoyote
NixonRichard
@NixonRichard
Aug 05 2016 04:52 UTC
it s arrow function
@revisualize
Joseph
@revisualize
Aug 05 2016 04:52 UTC
It is.
silver537
@silver537
Aug 05 2016 04:52 UTC
@revisualize well done.
Joseph
@revisualize
Aug 05 2016 04:52 UTC
@NixonRichard Also @adityaparab pointed out the same bit of code above. But, as a return statement.
Darth Skywalker
@adityaparab
Aug 05 2016 04:53 UTC
FCC code editor supports ES6
Joseph
@revisualize
Aug 05 2016 04:53 UTC
@adityaparab Yes.
Darth Skywalker
@adityaparab
Aug 05 2016 04:54 UTC
so one can use spread operator and arrow function and shit like that
silver537
@silver537
Aug 05 2016 04:54 UTC
But it will give you warnings
Joseph
@revisualize
Aug 05 2016 04:54 UTC
Yes.
@adityaparab I do it all the time.
Darth Skywalker
@adityaparab
Aug 05 2016 04:54 UTC
@silver537 : Life is too short to pay attention to warnings.
Michael Noronha
@mtn
Aug 05 2016 04:54 UTC
@silver537 Can you help me finish up Casears Cipher
@silver537 I'm really close: https://repl.it/Cjlt/3
@silver537 I need to figure out how to use regex to check if the substring (letter) i'm examining is in the alphabet
silver537
@silver537
Aug 05 2016 04:55 UTC
Lol im always on at the wrong times. -_-
Michael Noronha
@mtn
Aug 05 2016 04:55 UTC
lolol <3
@revisualize will definitely know as well :)
Darth Skywalker
@adityaparab
Aug 05 2016 04:56 UTC

@revisualize I love ES6 and typescript.

Although, ES6 doesn't go well with my JS Developer ego. Because with ES6 it's all too easy.
It does inflate my "intimidator ego" by writing short and intimidating code by using arrow functions etc :D

DJ
@qualitymanifest
Aug 05 2016 04:57 UTC
@michaeltnoronha if(/\b[A-Za-z]/) does nothing really, its the same as saying if(true)
Michael Noronha
@mtn
Aug 05 2016 04:57 UTC
@qualitymanifest yeah, i'm aware
labeebahmad414
@labeebahmad414
Aug 05 2016 04:57 UTC

In following example I have p.inner which has its children. I am using "<div style="clear:both;"></div>" to "clear" and make "Btn" appear on the right and under the "鈥 Isaac Newton" which is also on the right.

My original code is:

<p class="inner">
<span class="quote">Gravity explains the motions of the planets, but it cannot explain who sets the planets in motion.</span>

<span class="nameOfAuthor">鈥 Isaac Newton</span>
<div style="clear:both;"></div>
<span class="btn">Btn</span>
</p>

But what apprear in the inspect element of Chrome Dev Tools is this:

http://imgur.com/a/DlaQO

so here it has closed span.quote after span.nameOfAuthor even though span.btn was included as child of span.inner but it has moved it out of span.inner. Also it has added an empty <p> after span.btn Why is that?
This all happens when I add <div style="clear:both;"></div> to clear.

Michael Noronha
@mtn
Aug 05 2016 04:57 UTC
@qualitymanifest i need to finish tha statement
@qualitymanifest I know that will match what I want, but I need to figure out how to check if it's a match with the substring I'm evaluating
silver537
@silver537
Aug 05 2016 04:59 UTC
Im not sure regex is the better way of doing it.
Joseph
@revisualize
Aug 05 2016 04:59 UTC
okay. bed time for me.
Brandon Bowers
@Bowers96
Aug 05 2016 04:59 UTC
function testElseIf(val) {
  if (val > 10) {
    return "Greater than 10";
  } else if (val < 10) {

  if (val < 5) {
    return "Smaller than 5";
  } else {

  return "Between 5 and 10";
} 

// Change this value to test
testElseIf(7);
Michael Noronha
@mtn
Aug 05 2016 04:59 UTC
@silver537 How would you suggest doing it instead? And if there's a way of doing it with regex could you share it with me?
Brandon Bowers
@Bowers96
Aug 05 2016 05:00 UTC
Anybody now where my code goes wrong? Please help.
Convert the logic to use else if statements.
Michael Noronha
@mtn
Aug 05 2016 05:00 UTC
@Bowers96 You are checkin gin the wrong order
@Bowers96 If something is less than 10, it may or may not be less than 5
@Bowers96 but the first true statement it hits, you return and exit
@Bowers96 so you should change the order to make the checks more specific
@Bowers96 makes sense?
Brandon Bowers
@Bowers96
Aug 05 2016 05:01 UTC
flip else and else if around?
silver537
@silver537
Aug 05 2016 05:01 UTC
Best way, in my opinion, is to iterate an array of characters while checking if theyre in a certain range of the ascii alphabetical numbers. Subtract the number by 13 if possible, or add 13 if possible. Then revert them back into letters.
DJ
@qualitymanifest
Aug 05 2016 05:01 UTC
regex is unnecessary for rot13. you just need to convert each letter using charCodeAt, and then determine if it should stay the same, or be rotated forward 13 characters or backward 13 characters using fromCharCode
Brandon Bowers
@Bowers96
Aug 05 2016 05:01 UTC
@michaeltnoronha
Michael Noronha
@mtn
Aug 05 2016 05:01 UTC
@qualitymanifest what about spaces and stuff?
DJ
@qualitymanifest
Aug 05 2016 05:01 UTC
@silver537 phrased it a little better
Michael Noronha
@mtn
Aug 05 2016 05:01 UTC
@qualitymanifest of should i only check on values in the range of characters
@qualitymanifest I think that's the easiest
silver537
@silver537
Aug 05 2016 05:02 UTC
Spaces doesnt matter. Youll be splitting them into an array
Michael Noronha
@mtn
Aug 05 2016 05:02 UTC
@Bowers96 oh shoot I misread
DJ
@qualitymanifest
Aug 05 2016 05:02 UTC
@michaeltnoronha if charCodeAt gives you less than 65 leave it as it is
you don't need to add or subtract
Manish Giri
@Manish-Giri
Aug 05 2016 05:02 UTC
@Bowers96 why not do everything in the same if statement?
Michael Noronha
@mtn
Aug 05 2016 05:03 UTC
Stupid questoin, but can I add strings to concat them?
Or does it try to convert types
DJ
@qualitymanifest
Aug 05 2016 05:03 UTC
yes
silver537
@silver537
Aug 05 2016 05:03 UTC
Yea
DJ
@qualitymanifest
Aug 05 2016 05:03 UTC
why would it try to convert types if they're both strings?
Abis Mal
@abisthecodermal
Aug 05 2016 05:03 UTC
@stonefmagiecurata , thanks again
CamperBot
@camperbot
Aug 05 2016 05:03 UTC
manucpp sends brownie points to @stonefmagiecurata :sparkles: :thumbsup: :sparkles:
:warning: manucpp already gave stonefmagiecurata points
Brandon Bowers
@Bowers96
Aug 05 2016 05:03 UTC
I don't understand. @Manish-Giri
DJ
@qualitymanifest
Aug 05 2016 05:04 UTC
@michaeltnoronha oh were you just concerned that the + would try to convert them to a number?
Michael Noronha
@mtn
Aug 05 2016 05:04 UTC
@qualitymanifest yup
DJ
@qualitymanifest
Aug 05 2016 05:04 UTC
ah. yeah it just concatenates the strings
Brandon Bowers
@Bowers96
Aug 05 2016 05:05 UTC
function testElseIf(val) {
  if (val > 10) {
    return "Greater than 10";
  } else if (val < 10) {

  if (val < 5) {
    return "Smaller than 5";
  } else

  return "Between 5 and 10";
} 

// Change this value to test
testElseIf(7);
What am I doing wrong?
Convert the logic to use else if statements.
You should have at least two else statements
Sabrina Ferguson
@itsacoyote
Aug 05 2016 05:06 UTC
@Bowers96 you have an open else statement on teh second one. and the else if is also open on the first if statement
You'll want something like this:
Darth Skywalker
@adityaparab
Aug 05 2016 05:06 UTC
@Bowers96 : This would fail at testElseIf(5)
Sabrina Ferguson
@itsacoyote
Aug 05 2016 05:07 UTC
if ( ) {
} else if ( ) {
} else {
}
Michael Noronha
@mtn
Aug 05 2016 05:07 UTC
@silver537 @qualitymanifest thanks, even though i've not yet finished the problem. just in case you were about leave or something
CamperBot
@camperbot
Aug 05 2016 05:07 UTC
michaeltnoronha sends brownie points to @silver537 and @qualitymanifest :sparkles: :thumbsup: :sparkles:
:cookie: 466 | @silver537 |http://www.freecodecamp.com/silver537
:star2: 1321 | @qualitymanifest |http://www.freecodecamp.com/qualitymanifest
Michael Noronha
@mtn
Aug 05 2016 05:07 UTC
still working :)
DJ
@qualitymanifest
Aug 05 2016 05:07 UTC
:+1:
silver537
@silver537
Aug 05 2016 05:08 UTC
I was only on for a brief moment. I hope you solve the problem @michaeltnoronha now i gotta get back to learning. Cheers
Brandon Bowers
@Bowers96
Aug 05 2016 05:08 UTC
Ita ia not working........ @itsacoyote
It's* @itsacoyote
Michael Noronha
@mtn
Aug 05 2016 05:09 UTC
@Bowers96 sorry for abandoning
@Bowers96 Where's your code at currently?
Sabrina Ferguson
@itsacoyote
Aug 05 2016 05:09 UTC
@Bowers96 what's the problem name?
DJ
@qualitymanifest
Aug 05 2016 05:09 UTC
@Bowers96 you're missing a closing curly brace, but that's not the only problem
Brandon Bowers
@Bowers96
Aug 05 2016 05:09 UTC
Introducing Else If Statements
@michaeltnoronha No worries.
silver537
@silver537
Aug 05 2016 05:10 UTC
@Bowers96 change the last if into else if.
Brandon Bowers
@Bowers96
Aug 05 2016 05:10 UTC
@itsacoyote
Manish Giri
@Manish-Giri
Aug 05 2016 05:10 UTC
@Bowers96 you can match the return in one if statement itself. What challenge are you on?
Sabrina Ferguson
@itsacoyote
Aug 05 2016 05:10 UTC
@Bowers96 your logic is a little off.
You want to find if val is greater than 10, else if not, is it less than 5, if not, else we return "Between 5 and 10"
Brandon Bowers
@Bowers96
Aug 05 2016 05:10 UTC
This is my code:
Michael Noronha
@mtn
Aug 05 2016 05:11 UTC
@silver537 @qualitymanifest EYYYYYYYY https://repl.it/Cjlt/4
DJ
@qualitymanifest
Aug 05 2016 05:11 UTC
@Bowers96 your else if should be <=. but there's also just a better way of doing it
silver537
@silver537
Aug 05 2016 05:11 UTC
Woah nvm. You nested that one. Dont nest any of them.
DJ
@qualitymanifest
Aug 05 2016 05:11 UTC
:point_up: that
@michaeltnoronha :clap:
Michael Noronha
@mtn
Aug 05 2016 05:11 UTC
basic js algorithms completed!
Brandon Bowers
@Bowers96
Aug 05 2016 05:12 UTC
function testElseIf(val) {
  if (val > 10) {
    return "Greater than 10";
  } else if (val > 5) {

  if (val < 5) {
    return "Smaller than 5";
  } else {

  return "Between 5 and 10";
} 

// Change this value to test
testElseIf(7);
@itsacoyote
I feel like I have what you say.
@itsacoyote
Sabrina Ferguson
@itsacoyote
Aug 05 2016 05:12 UTC
@Bowers96 close, but remember the structure I put up earlier
silver537
@silver537
Aug 05 2016 05:13 UTC
@michaeltnoronha holy shit thats a mess lol
Michael Noronha
@mtn
Aug 05 2016 05:13 UTC
:)
Sabrina Ferguson
@itsacoyote
Aug 05 2016 05:13 UTC
if ( ---) {

} else if ( --- ) {

} else {

}
Michael Noronha
@mtn
Aug 05 2016 05:13 UTC
@silver537 I'm going to go back through all my solutions and rewrite them
@silver537 but i'll complete some more js first
Brandon Bowers
@Bowers96
Aug 05 2016 05:14 UTC
Lol that is the same structure I have. @itsacoyote
silver537
@silver537
Aug 05 2016 05:14 UTC
Try to keep them all in methods.
Sabrina Ferguson
@itsacoyote
Aug 05 2016 05:14 UTC
@Bowers96 you have one too many if statement
edgarmontes
@edgarmontes
Aug 05 2016 05:14 UTC
has anyone finished the
Word Blanks
?
silver537
@silver537
Aug 05 2016 05:14 UTC
@Bowers96 you have a nested if. Ah nvm. Figure it out.
Manish Giri
@Manish-Giri
Aug 05 2016 05:14 UTC
@Bowers96 okay, my bad, I was thinking of another challenge. Here鈥檚 the pattern that鈥檚 required
if (val > 10) {
    //greater than 10
}

  else if (val < 5) {
     //smaller than 5
  }
  else 
        //between 5 & 10
Michael Noronha
@mtn
Aug 05 2016 05:14 UTC
@quemando link?
Sabrina Ferguson
@itsacoyote
Aug 05 2016 05:15 UTC
@quemando yep
Manish Giri
@Manish-Giri
Aug 05 2016 05:15 UTC
@Bowers96 you鈥檝e already got the right conditions in place, it鈥檚 just using else if instead of if
Michael Noronha
@mtn
Aug 05 2016 05:15 UTC
@quemando What do you have so far?
edgarmontes
@edgarmontes
Aug 05 2016 05:16 UTC
I am confused, is not clear for me what i need to do
Manish Giri
@Manish-Giri
Aug 05 2016 05:17 UTC
@Bowers96 updated, :point_up: August 5, 2016 10:44 AM
Brandon Bowers
@Bowers96
Aug 05 2016 05:18 UTC
@Manish-Giri Thank you very much. That was way more difficult than it should have been ughhhhh.
CamperBot
@camperbot
Aug 05 2016 05:18 UTC
bowers96 sends brownie points to @manish-giri :sparkles: :thumbsup: :sparkles:
:star2: 1611 | @manish-giri |http://www.freecodecamp.com/manish-giri
edgarmontes
@edgarmontes
Aug 05 2016 05:18 UTC
My guess is that i need to build a sentense with the words dog, big ran, etc
right?
Sabrina Ferguson
@itsacoyote
Aug 05 2016 05:19 UTC
@quemando yes, and it doesn't matter in what order you put them
Manish Giri
@Manish-Giri
Aug 05 2016 05:19 UTC
@Bowers96 welcome! Happy coding :blush:
edgarmontes
@edgarmontes
Aug 05 2016 05:19 UTC
@itsacoyote ok, so lets say
@itsacoyote My big dog ran quickly ?
Sabrina Ferguson
@itsacoyote
Aug 05 2016 05:20 UTC
@quemando yep
edgarmontes
@edgarmontes
Aug 05 2016 05:20 UTC
@itsacoyote awesome, thank you so much
CamperBot
@camperbot
Aug 05 2016 05:20 UTC
quemando sends brownie points to @itsacoyote :sparkles: :thumbsup: :sparkles:
:cookie: 221 | @itsacoyote |http://www.freecodecamp.com/itsacoyote
Puvendran Pillay
@puven12
Aug 05 2016 05:23 UTC
i am gonna call it a day
bye guys
Ismael Sanchez
@sanchez1179
Aug 05 2016 05:29 UTC
js
//Setup
var contacts = [
    {
        "firstName": "Akira",
        "lastName": "Laine",
        "number": "0543236543",
        "likes": ["Pizza", "Coding", "Brownie Points"]
    },
    {
        "firstName": "Harry",
        "lastName": "Potter",
        "number": "0994372684",
        "likes": ["Hogwarts", "Magic", "Hagrid"]
    },
    {
        "firstName": "Sherlock",
        "lastName": "Holmes",
        "number": "0487345643",
        "likes": ["Intriguing Cases", "Violin"]
    },
    {
        "firstName":