10th
Mar 2016
alpox
@alpox
Mar 10 2016 00:00 UTC
@effinglame You can delete posts
@unlimiworks
Mar 10 2016 00:01 UTC
@TylerMoeller
var val = 0.30;
while (val >= 0) {
if (Math.round(val * 100) % (0.01 * 100) === 0 && val > 0) {
val -= 0.01;
console.log(val);
}
}
Also, you don't need (0.01 * 100)
Tyler Moeller
@TylerMoeller
Mar 10 2016 00:02 UTC
Thanks @UnlimiWorks - needed a Math.round on the multiplication.... Appreciate the help! And, yeah, the 0.01 is actually a variable in my real code - this was just trimmed down to isolate the problem. Thanks again!!
CamperBot
@camperbot
Mar 10 2016 00:03 UTC
tylermoeller sends brownie points to @unlimiworks :sparkles: :thumbsup: :sparkles:
:warning: tylermoeller already gave unlimiworks points
@unlimiworks
Mar 10 2016 00:03 UTC
@TylerMoeller Glad i could help :)
Welp, it's just past midnight. Time to work on that twitch API thingy
See you later folks !
Jon Grant
@jong649
Mar 10 2016 00:05 UTC
Has anyone completed Symmetric Difference? I'm confused on what it's asking for; thought I had it down
Jacob Hanawalt
@JacobHanawalt
Mar 10 2016 00:13 UTC
Hi all! Quick JS question: Is it possible to use and edit a local variable created outside of a function, (namely var count = 0 from the "Counting Cards" exercise) inside of a function?
Jon Grant
@jong649
Mar 10 2016 00:22 UTC
@effinglame I'm pretty sure you can, if I'm understanding you correctly
Pedro Abel Díaz Sánchez
@coderHook
Mar 10 2016 00:23 UTC
Guys, I really do not figure it out what I have to do in the "Make a person" algorithm, can someone give me a hand?
I dont even know what should I get as solution or return
Jon Grant
@jong649
Mar 10 2016 00:25 UTC
@Abel1987 I am in the same boat; I just started the advanced algorithms and find them to be much more challenging than previous ones
Mar 10 2016 00:26 UTC
Hi, can someone help me for the lesson "Profile Lookup" in Basic JS ?
Pedro Abel Díaz Sánchez
@coderHook
Mar 10 2016 00:27 UTC
@jong649 yeap, one week ago I started them as well and I had to read a lot about new stuff. Right now, I only need to complete "No repeats please" and "Make a person".
Jon Grant
@jong649
Mar 10 2016 00:27 UTC
@Abel1987 that's awesome! I've only completed the phone numbers one; I'm stuck on Symmetric Difference
Pedro Abel Díaz Sánchez
@coderHook
Mar 10 2016 00:27 UTC
No repeats please I think is hard, but at least I know what I have to do although I dont know how :D
Emma Clark
@sapphirestone
Mar 10 2016 00:28 UTC

can anyone help me with returning Boolean Values from Functions I can't understand whats wrong <function isLess(a, b) {

return a === b;

}

// Change these values to test
isLess(15, 10);>

Pedro Abel Díaz Sánchez
@coderHook
Mar 10 2016 00:28 UTC
But with "make a person" algorithm... I dont even know what I have to do so I cannot try to look for a solution...
Jon Grant
@jong649
Mar 10 2016 00:28 UTC
@Abel1987 I thought I had symmetric difference one figured out, but am confused at what numbers to return
@sapphirestone are you trying to see if a is less than b?
@Abel1987 That one does look confusing; I think you are supposed to make the methods for each thing listed, but I'm not totally sure either haha, sorry
Emma Clark
@sapphirestone
Mar 10 2016 00:32 UTC
yes it returns false for isLess(15,10) but it doesn't return true for isLess(10,15) which it should do. I cant make out what I've done wrong, it won't let me pass the exercise
Pedro Abel Díaz Sánchez
@coderHook
Mar 10 2016 00:32 UTC
@jong649 can you be more specific on what confuse you at symmetic difference?
Jon Grant
@jong649
Mar 10 2016 00:33 UTC
@sapphirestone from the code you shared, I think it will only return true if a & b are equal
@sapphirestone so you would need to change to a < b i believe
@Abel1987 I thought it was just returning the unique values in the given arrays, so like for [1,2,3], [2,3,5] it would return 1,5
@Abel1987 but i'm confused at why it wants numbers that repeat in all arrays returned also...sorry, that isn't a great explanation
Pedro Abel Díaz Sánchez
@coderHook
Mar 10 2016 00:35 UTC
Yes, I get the sense of what you mean, I think.
Jon Grant
@jong649
Mar 10 2016 00:35 UTC
@Abel1987 Here's what I have so far
function sym(args) {
var arr = [];
var arr2 = [];
var index;
var str;
for(var i = 0;i<arguments.length;i++){
arr.push(arguments[i]);
}
arr = arr.reduce(function(a, b) {
return a.concat(b);
}, []);
for(var j = 0;j<arr.length;j++){
if(arr.lastIndexOf(arr[j])==arr.indexOf(arr[j])){
arr2.push(arr[j]);
}
}

return arr2;
}

sym([1, 2, 5], [2, 3, 5], [3, 4, 5]);
In this example it should return 1,4,5 which doesn't make sense...why return the 5?
Pedro Abel Díaz Sánchez
@coderHook
Mar 10 2016 00:37 UTC
@jong649 this is important, first you check first two arrays, and then the result has to be checked with the third
scharla
@scharla
Mar 10 2016 00:37 UTC
@jong649 diff between first two is [1,3]
diff between the result [1,3] and the last arr is [1,4,5]
Pedro Abel Díaz Sánchez
@coderHook
Mar 10 2016 00:37 UTC
@jong649 thats why you should ahve 5, because first and second eliminate 5 but with the third one you have to add it to the result
scharla
@scharla
Mar 10 2016 00:38 UTC
Abel1987 got there 1st
Pedro Abel Díaz Sánchez
@coderHook
Mar 10 2016 00:38 UTC
@jong649 is exactly how @scharla points.
Jon Grant
@jong649
Mar 10 2016 00:38 UTC
@Abel1987 @scharla I feel like that should make sense, but I'm still confused....so because the first two are 1,3, why is 5 included in 3rd?
Pedro Abel Díaz Sánchez
@coderHook
Mar 10 2016 00:39 UTC
because 5 is not in both
Emma Clark
@sapphirestone
Mar 10 2016 00:39 UTC
Thanks @jong649 I solved the problem
CamperBot
@camperbot
Mar 10 2016 00:39 UTC
sapphirestone sends brownie points to @jong649 :sparkles: :thumbsup: :sparkles:
Pedro Abel Díaz Sánchez
@coderHook
Mar 10 2016 00:39 UTC
result and third array i mean by both
CamperBot
@camperbot
Mar 10 2016 00:39 UTC
:star: 323 | @jong649 | http://www.freecodecamp.com/jong649
scharla
@scharla
Mar 10 2016 00:39 UTC
@jong649 because [1,3] and [3,4,5] have unique elements [1,4,5] (3 is there twice)
@jong649 once ypu have the first difference, you comepletely ignore the original arrays 1 and 2
Jon Grant
@jong649
Mar 10 2016 00:40 UTC
@Abel1987 @scharla ok thanks, it kinda makes sense haha
CamperBot
@camperbot
Mar 10 2016 00:40 UTC
jong649 sends brownie points to @abel1987 and @scharla :sparkles: :thumbsup: :sparkles:
:star: 336 | @abel1987 | http://www.freecodecamp.com/abel1987
:star: 290 | @scharla | http://www.freecodecamp.com/scharla
Jon Grant
@jong649
Mar 10 2016 00:40 UTC
@sapphirestone awesome, glad you got it!
Pedro Abel Díaz Sánchez
@coderHook
Mar 10 2016 00:41 UTC
hey @scharla you see things pretty clear, do you have any advice for the "make a person" algorithm? :D
Jon Grant
@jong649
Mar 10 2016 00:42 UTC
I think I'll need to rewrite my code, but I appreciate you guys explaining it
Mar 10 2016 00:42 UTC
anyone can help on "Profile Lookup" ?
scharla
@scharla
Mar 10 2016 00:42 UTC
@Abel1987 haha I'm not sure about that! I haven't got that far yet, let me have a look
Pedro Abel Díaz Sánchez
@coderHook
Mar 10 2016 00:42 UTC
:+1:
FelipeBHZ
@felipebhz
Mar 10 2016 00:43 UTC
Hi guys!
Can someone help me and explain me how toUpperCase all first letters of a string?
Title Case a Sentence
scharla
@scharla
Mar 10 2016 00:44 UTC
@Abel1987 bad example, I suck at objects!
Pedro Abel Díaz Sánchez
@coderHook
Mar 10 2016 00:45 UTC
@scharla hehe, never mind, I think I better go to bed now, tomorrow probably I'll see thing diferently
just 2 algorithm and 2 projects to get the certificate :D
bitgrower
@bitgrower
Mar 10 2016 00:46 UTC
congrats, @Abel1987 !!!
scharla
@scharla
Mar 10 2016 00:46 UTC
@Abel1987 I think you just set up the methods for Person and then alter the input into 'Bob' to create a new object
but I could be way off
bitgrower
@bitgrower
Mar 10 2016 00:47 UTC
@felipebhz -- ahhhh ... the point of the challenges is for you to try and do them yourself first ... then, if you have trouble ... READ ... SEARCH ... then ASK, POST ... :)
Pedro Abel Díaz Sánchez
@coderHook
Mar 10 2016 00:47 UTC
uff I'll see it tomorrow thanks to all!
GoodNight!
FelipeBHZ
@felipebhz
Mar 10 2016 00:48 UTC
@bitgrower I know... I've been on freecodecamp for a looooong time hehe But I tried to do all the steps.
bitgrower
@bitgrower
Mar 10 2016 00:48 UTC
@jadeeshah -- Profile Lookup is probably one of the challenges the most people have trouble with ...
FelipeBHZ
@felipebhz
Mar 10 2016 00:48 UTC
All solutions I've found is using regex
I prefer not to use regex
bitgrower
@bitgrower
Mar 10 2016 00:48 UTC
why is that @felipebhz ?
Mar 10 2016 00:48 UTC
@bitgrower I can not disagree =D
bitgrower
@bitgrower
Mar 10 2016 00:49 UTC
you have some code we can look at ?
FelipeBHZ
@felipebhz
Mar 10 2016 00:49 UTC
@bitgrower I just don't like regex. It confuses me a lot. :/
bitgrower
@bitgrower
Mar 10 2016 00:50 UTC
@felipebhz -- I don't recall Title Case needing regexes ... but I'd have to look at the challenge again ... however, you're gonna have to strap in and learn regex at some point ... it's an extremely POWERFUL tool ...
Norman Dela Cruz
@dcnr
Mar 10 2016 00:50 UTC
@felipebhz regex is powerful, and the sooner you learn it, the more you can get out of it! but if you really don't want to use it, there are many ways you can solve Title Case a Sentence. For example, you can work on it word by word rather than the whole string at once.
bitgrower
@bitgrower
Mar 10 2016 00:50 UTC
:wave: @dcnr !!!!!
Norman Dela Cruz
@dcnr
Mar 10 2016 00:50 UTC
heya @bitgrower :cake:
bitgrower
@bitgrower
Mar 10 2016 00:51 UTC
yeah, I think my first solution for title case was to create a mini-state machine ... LOL ...
where ya been, @dcnr ...
Norman Dela Cruz
@dcnr
Mar 10 2016 00:51 UTC
ooh my streak broke :( @bitgrower
FelipeBHZ
@felipebhz
Mar 10 2016 00:51 UTC
@dcnr Is there a website where I can get some "easy-to-read" info about regex? I used it on other 2 challenges but it took me so long I gave it up on this one hehe
bitgrower
@bitgrower
Mar 10 2016 00:51 UTC
my day has just been made brighter ... :)
scharla
@scharla
Mar 10 2016 00:52 UTC
@felipebhz are you using str.charAt[0]?
bitgrower
@bitgrower
Mar 10 2016 00:52 UTC
regexone.com
FelipeBHZ
@felipebhz
Mar 10 2016 00:52 UTC
let me see
Norman Dela Cruz
@dcnr
Mar 10 2016 00:52 UTC
@bitgrower ahah thank you!
CamperBot
@camperbot
Mar 10 2016 00:52 UTC
dcnr sends brownie points to @bitgrower :sparkles: :thumbsup: :sparkles:
:star: 783 | @bitgrower | http://www.freecodecamp.com/bitgrower
Norman Dela Cruz
@dcnr
Mar 10 2016 00:52 UTC
yeah I agree try regexone first
bitgrower
@bitgrower
Mar 10 2016 00:53 UTC
@dcnr pointed that site out to me ... great tutorial ... thanks, @dcnr
CamperBot
@camperbot
Mar 10 2016 00:53 UTC
bitgrower sends brownie points to @dcnr :sparkles: :thumbsup: :sparkles:
:star: 759 | @dcnr | http://www.freecodecamp.com/dcnr
Norman Dela Cruz
@dcnr
Mar 10 2016 00:53 UTC
I forgot who gave it to me though :/
FelipeBHZ
@felipebhz
Mar 10 2016 00:54 UTC
@scharla Yes. I've been trying to use it, but I'm not getting the desired results.
bitgrower
@bitgrower
Mar 10 2016 00:56 UTC
@felipebhz -- you can't change a string ... they are immutable ... you can do something like newStr = str.charAt(0); -- but then you would only assign 1 character to newStr ... so you have to compose a new string (for each of the words) -- consisting of 2 parts ... the part which is upper case and the part which is lower-case
FelipeBHZ
@felipebhz
Mar 10 2016 00:57 UTC
@bitgrower I will try this way. Seems to be step-by-step and I like it, because I can understand each part of the proccess :D
process*
Jared Abel
@jaredabel
Mar 10 2016 01:02 UTC
is it possible to do something like this
 for (var i in userArray){
var name=userArray[i];
var url='https://api.twitch.tv/kraken/streams/'+ name + '?callback=?';
$.getJSON(url, function(data) { var name = { } so if name was Jack i would create a new object named jack Suprith Aireddy @sup-rith Mar 10 2016 01:12 UTC anyone finish the Truncate a string challenge? Jawad Haider @jadeeshah Mar 10 2016 01:13 UTC This message was deleted bitgrower @bitgrower Mar 10 2016 01:13 UTC yes @sup-rith Suprith Aireddy @sup-rith Mar 10 2016 01:13 UTC @bitgrower can you help me understand the logic? bitgrower @bitgrower Mar 10 2016 01:14 UTC if you're having trouble, I would recommend looking CAREFULLY at the instructions ... they might not say what you think they say ... Norman Dela Cruz @dcnr Mar 10 2016 01:16 UTC @sup-rith run the code too, and look at the test cases and see what the answers should be. That'll give you the idea on how to solve it. bitgrower @bitgrower Mar 10 2016 01:19 UTC sorry @jaredabel -- can't help you ... scharla @scharla Mar 10 2016 01:20 UTC @felipebhz you can also treat them as arrays bitgrower @bitgrower Mar 10 2016 01:21 UTC @felipebhz -- you know the str.split() function ? scharla @scharla Mar 10 2016 01:24 UTC @felipebhz splitString[i][0] = 1st letter of each word. FelipeBHZ @felipebhz Mar 10 2016 01:26 UTC @bitgrower @scharla I'm almost getting the results done haha :D Just need to merge all the words now into one new sentence (string). I've been reading your tips and it's getting easier. I'm doing it with console.log() to check every step bitgrower @bitgrower Mar 10 2016 01:26 UTC cool @felipebhz ... check out .join() FelipeBHZ @felipebhz Mar 10 2016 01:27 UTC I'm trying to use it, but inside of the for loop is not getting properly output I already got each word with 1st letter in UpperCase and the rest in LowerCase. Now I need to join it. Norman Dela Cruz @dcnr Mar 10 2016 01:28 UTC @felipebhz how are you storing the words? are they in an array? @felipebhz if so, a simple wordsArray.join(' '); would be sufficient :D Lucas Pentinsaari @Dreameh Mar 10 2016 01:28 UTC Well hello peoples! bitgrower @bitgrower Mar 10 2016 01:28 UTC hello @kyusaki1 scharla @scharla Mar 10 2016 01:31 UTC @felipebhz use it outside the loop. Join by a space FelipeBHZ @felipebhz Mar 10 2016 01:31 UTC @dcnr I'm trying to figure out how to join them. I split it, but now I cannot join it LOL scharla @scharla Mar 10 2016 01:32 UTC @felipebhz splitArray.join( " ") Norman Dela Cruz @dcnr Mar 10 2016 01:33 UTC @felipebhz if you use a split on an array you can join that array too! var sentence = 'hello world'; var words = sentence.split(' '); // words is now an array ['hello', 'world'] var joined = words.join(' '); // joined is now 'hello world' again FelipeBHZ @felipebhz Mar 10 2016 01:34 UTC I'm joining it, but the as the string is no mutable, I cannot join the new words. I'm still trying to lol scharla @scharla Mar 10 2016 01:34 UTC @where are your new words? Norman Dela Cruz @dcnr Mar 10 2016 01:34 UTC @felipebhz you can only use join on an array, it will join the values of your array separated by whatever separator you give it scharla @scharla Mar 10 2016 01:35 UTC @felipebhz can you post your code? FelipeBHZ @felipebhz Mar 10 2016 01:35 UTC Yes, sure. I was just copying and pasting it Just cleaning it up. To remove my comments Here we go :) Norman Dela Cruz @dcnr Mar 10 2016 01:39 UTC @felipebhz oh you want to join your newWords! FelipeBHZ @felipebhz Mar 10 2016 01:40 UTC I tried. But it won't work. Let me try again Norman Dela Cruz @dcnr Mar 10 2016 01:40 UTC @felipebhz hmm you can use an empty string and append to that, something like var answer = ''; answer += newWords + ' '; But you'll have an extra space at the end. You might also push your newWords in an array, and use join on it too FelipeBHZ @felipebhz Mar 10 2016 01:42 UTC the output of console.log(newWord); shows me all the words alright, but I can't manage to join them :/ Coy Sanders @coymeetsworld Mar 10 2016 01:42 UTC in your for loop you can account for the last word, and not put a space at the end scharla @scharla Mar 10 2016 01:43 UTC @felipebhz as dcnr says, push your newWords into an array and then join them Norman Dela Cruz @dcnr Mar 10 2016 01:43 UTC or you can trim it with something like trim but pushing to an array sounds easier bitgrower @bitgrower Mar 10 2016 01:44 UTC ^^^^ what @scharla just said ... Coy Sanders @coymeetsworld Mar 10 2016 01:44 UTC for (var i = 0; i < arr.length; i++) { str += arr[i]; if (i != arr.length -1) { str += ' '; } } FelipeBHZ @felipebhz Mar 10 2016 01:44 UTC @coymeetsworld but it is already working with the last word. Jawad Haider @jadeeshah Mar 10 2016 01:44 UTC I'm badly stuck at "Profile Lookup" :worried: FelipeBHZ @felipebhz Mar 10 2016 01:44 UTC @coymeetsworld Oh, I see. bitgrower @bitgrower Mar 10 2016 01:44 UTC right now you are over-writing your newWord with the next word in the array ... so you aren't keeping them around ... @jadeeshah -- I wondered where you went ... post your code ? FelipeBHZ @felipebhz Mar 10 2016 01:45 UTC @bitgrower @scharla @dcnr I will check on the docs how to push them into a new array and then join it scharla @scharla Mar 10 2016 01:45 UTC @felipebhz you can even sidestep that part by directly pushign the two parts into newWord bitgrower @bitgrower Mar 10 2016 01:45 UTC bingo !!! you are doing very well, @felipebhz -- I'm impressed Norman Dela Cruz @dcnr Mar 10 2016 01:46 UTC @felipebhz there's a Basic JS exercise for that too! http://www.freecodecamp.com/challenges/manipulate-arrays-with-push bitgrower @bitgrower Mar 10 2016 01:46 UTC ...or concatenating them, @scharla ... so .. newWord += previous expression just put a + sign in there ... :) then return newWord scharla @scharla Mar 10 2016 01:47 UTC Good luck! You're very close heh. I'm off to bed bitgrower @bitgrower Mar 10 2016 01:47 UTC ...oh, except for the blanks ... need to add the blanks back in ... I like your code @felipebhz -- it's easy to see what you are trying to do ... :) if you do what I suggest, you won't need to push them onto an array ... FelipeBHZ @felipebhz Mar 10 2016 01:50 UTC @scharla Thanks! :D Good night CamperBot @camperbot Mar 10 2016 01:50 UTC felipebhz sends brownie points to @scharla :sparkles: :thumbsup: :sparkles: :star: 291 | @scharla | http://www.freecodecamp.com/scharla FelipeBHZ @felipebhz Mar 10 2016 01:51 UTC @dcnr I'll try it again. Almost 2 months "out of coding" Jawad Haider @jadeeshah Mar 10 2016 01:51 UTC //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": "Kristian", "lastName": "Vos", "number": "unknown", "likes": ["Javascript", "Gaming", "Foxes"] } ]; function lookUp(firstName, prop){ // Only change code below this line for (var i=0; i < contacts.length; i++){ if (contacts[i].firstName===firstName && contacts[i].hasOwnProperty(prop)){ return contacts[i][prop]; } } // Only change code above this line } // Change these values to test your function lookUp("Akira", "likes"); bitgrower @bitgrower Mar 10 2016 01:51 UTC change it to this ... -> newWord += " " + upperCasePart + lowerCasePart; Norman Dela Cruz @dcnr Mar 10 2016 01:51 UTC @felipebhz eheh good luck! You're almost done! Andrew Charlebois @andrewchar Mar 10 2016 01:51 UTC So im just starting out with my Calculator project and ive decided to do it in pure javascript and i now realize. i really dont know how to do much... ive been doing jQuery all along bitgrower @bitgrower Mar 10 2016 01:51 UTC why use pure js ???? Andrew Charlebois @andrewchar Mar 10 2016 01:51 UTC why not FelipeBHZ @felipebhz Mar 10 2016 01:51 UTC @bitgrower thanks! I will try it. This will maybe be easier to append it on the "creation" of the new word CamperBot @camperbot Mar 10 2016 01:51 UTC felipebhz sends brownie points to @bitgrower :sparkles: :thumbsup: :sparkles: :star: 784 | @bitgrower | http://www.freecodecamp.com/bitgrower bitgrower @bitgrower Mar 10 2016 01:52 UTC jquery takes so much of the pain out of browser compatability ... and addressing elements on the page is cumbersome, wordy, and painful ... :) Andrew Charlebois @andrewchar Mar 10 2016 01:53 UTC dont people who want to get a job coding need to now this stuff? Norman Dela Cruz @dcnr Mar 10 2016 01:53 UTC @bitgrower @andrewchar http://vanilla-js.com/ use this framework instead :wink2: Andrew Charlebois @andrewchar Mar 10 2016 01:53 UTC i see this all the time, some say just use jquery, others say learn javascript then use jquery Norman Dela Cruz @dcnr Mar 10 2016 01:54 UTC @andrewchar (unfortunetaly?) not that necessarily I guess, usually people just learn the frameworks themselves now more than the base language it came in Andrew Charlebois @andrewchar Mar 10 2016 01:55 UTC hmm FelipeBHZ @felipebhz Mar 10 2016 01:55 UTC @bitgrower It didn't work with the newWord += " " + upperCasePart + lowerCasePart; bitgrower @bitgrower Mar 10 2016 01:55 UTC really ? I put it into your jsbin and it worked for me ... ...er, your repl.it FelipeBHZ @felipebhz Mar 10 2016 01:56 UTC @bitgrower unless Im doing it wrong, it didnt work. bitgrower @bitgrower Mar 10 2016 01:57 UTC weird -- yeah, I just pasted it into the FCC and it didn't work ... FelipeBHZ @felipebhz Mar 10 2016 01:57 UTC OMG, I cannot push some values into one array. lol - Maybe I will learn to code in 2039 LOL bitgrower @bitgrower Mar 10 2016 01:57 UTC of course, it would help if I returned newWord ... FelipeBHZ @felipebhz Mar 10 2016 01:59 UTC I will check some of the docs on MDN and see if I can get some out of it haha bitgrower @bitgrower Mar 10 2016 02:01 UTC yeah .. I just output the results to console.log ... and the results look correct ... hmmm... FelipeBHZ @felipebhz Mar 10 2016 02:03 UTC Yuhull!! Eureka! :D :D :D Brian @sludge256 Mar 10 2016 02:03 UTC I think the Vanilla JS framework is over used. Norman Dela Cruz @dcnr Mar 10 2016 02:04 UTC @sludge256 only because it's the best! :D @felipebhz congrats!! :D Brian @sludge256 Mar 10 2016 02:04 UTC Pfft, I don't see it being able to compete with all the other ones. FelipeBHZ @felipebhz Mar 10 2016 02:04 UTC Got it my friends, got it. With some of console.log() and starting an new array[] in the beginning before the for loop... LOL I think 5 hours of coding is not good for my brain LOL Norman Dela Cruz @dcnr Mar 10 2016 02:05 UTC @felipebhz you should take a break, then when you come back review your code again to set it in FelipeBHZ @felipebhz Mar 10 2016 02:05 UTC Thank you all! :D You are the best :) See if you like it > https://repl.it/Buhi/2 @dcnr I will take a brake now. For sure. It's 11pm here. Need to eat and sleep to work tomorrow :P Norman Dela Cruz @dcnr Mar 10 2016 02:06 UTC eheh good night! @felipebhz FelipeBHZ @felipebhz Mar 10 2016 02:06 UTC @dcnr I like to do it step by step, to understand the "basic" way to do it, then I can check regex and other ways to do it. I like to learn coding step by step :D Thanks! :D bitgrower @bitgrower Mar 10 2016 02:11 UTC congrats, @felipebhz ... Joshua Jerrick @JoshuaJerrick Mar 10 2016 02:12 UTC I am not getting the Stand in Line challenge bitgrower @bitgrower Mar 10 2016 02:13 UTC @JoshuaJerrick -- it actually takes only 2 lines of code -- you just need to find the array functions which do what you need ... :) (2 EASY lines of code ... nothing complex...just one function call each...) Joshua Jerrick @JoshuaJerrick Mar 10 2016 02:14 UTC let me try it out bitgrower @bitgrower Mar 10 2016 02:14 UTC love that kind of spirit !!! demipixel @demipixel Mar 10 2016 02:16 UTC same !!! Joshua Jerrick @JoshuaJerrick Mar 10 2016 02:18 UTC would the first line of code happen to be queue(testArr); That didn't work may I have a hint not the full answer I want to find it myself just need a little push demipixel @demipixel Mar 10 2016 02:20 UTC haha "push" Joshua Jerrick @JoshuaJerrick Mar 10 2016 02:21 UTC queue.push(testArr)? demipixel @demipixel Mar 10 2016 02:22 UTC bf stand CamperBot @camperbot Mar 10 2016 02:22 UTC Sorry, can't find a bonfire called stand. [ Check the map? ] demipixel @demipixel Mar 10 2016 02:22 UTC bf Stand CamperBot @camperbot Mar 10 2016 02:22 UTC Sorry, can't find a bonfire called stand. [ Check the map? ] demipixel @demipixel Mar 10 2016 02:22 UTC ugh @JoshuaJerrick Look at the original You start with three lines in queue()... what are they? I mean what do they do Joshua Jerrick @JoshuaJerrick Mar 10 2016 02:23 UTC ok resetting now They take the parameters arr and item. It returns item. That is what they do. demipixel @demipixel Mar 10 2016 02:29 UTC No, what happens inside the function What does each line do Stephen Antony @Stephen-antony Mar 10 2016 02:36 UTC @JoshuaJerrick function queue(arr, item) { // Your code here - arr.push(item); var removed = arr.shift(); return removed; return item; // Change this line } // Test Setup var testArr = [1,2,3,4,5]; // Display Code console.log("Before: " + JSON.stringify(testArr)); console.log(queue(testArr, 6)); // Modify this line to test console.log("After: " + JSON.stringify(testArr)); Hope it helps Amir Eskandari @AmirEskandari87 Mar 10 2016 02:38 UTC ~_~ Joshua Jerrick @JoshuaJerrick Mar 10 2016 02:38 UTC thanks bitgrower @bitgrower Mar 10 2016 02:38 UTC the agony too much for ya, @Stephen-antony ... ? Stephen Antony @Stephen-antony Mar 10 2016 02:41 UTC @bitgrower well he was stuck for too long sorry wont happen again Sujil Anto @sujilnt Mar 10 2016 02:41 UTC @Stephen-antony :) bitgrower @bitgrower Mar 10 2016 02:45 UTC maybe ask them if they want the solution outright ... :) ...at least give campers a choice ... :) B. Garber @TheBGar Mar 10 2016 02:45 UTC Hello fellow JS-ers anyone able to help me with an exercise? bitgrower @bitgrower Mar 10 2016 02:45 UTC hey @TheBGar -- I think you've been hanging out in the front-end room, no ? B. Garber @TheBGar Mar 10 2016 02:46 UTC @bitgrower indeed. helping those peeps just getting started helps me polish my html, css, and intro level javascript knowledge :thumbsup: bitgrower @bitgrower Mar 10 2016 02:47 UTC hahahahaha ... yeah bitgrower @bitgrower needs to polish up her understanding of bootstrap B. Garber @TheBGar Mar 10 2016 02:47 UTC @bitgrower just another way to learn, ya know? To teach is to learn again @bitgrower bootstrap rocks...big fan so far...especially just starting out. Makes things SOOO much easier bitgrower @bitgrower Mar 10 2016 02:48 UTC it is indeed -- I get campers who just solved a challenge to help the next person who comes in who has that challenge when it happens right away ... or sic 'em on each other if 2 are working on the same one ... B. Garber @TheBGar Mar 10 2016 02:48 UTC @bitgrower lol. Oh boy bitgrower @bitgrower Mar 10 2016 02:48 UTC so whatcha puzzlin' over today ? B. Garber @TheBGar Mar 10 2016 02:48 UTC @bitgrower my very last javascript exercise bitgrower @bitgrower Mar 10 2016 02:49 UTC is that pairwise -- or one you've been putting off ... (like me) B. Garber @TheBGar Mar 10 2016 02:49 UTC well sort of putting off. They changed the curriculum and added it, so now I have it left to do....profile lookup bitgrower @bitgrower Mar 10 2016 02:50 UTC ahhh okay ... the famous Profile Lookup -- if you've done all the other js algos, this should be easy let's see whatcha got ... B. Garber @TheBGar Mar 10 2016 02:50 UTC literally onto JSON APIs and Ajax after this thanks for taking a look. Just a sec bitgrower @bitgrower Mar 10 2016 02:51 UTC I like Profile Lookup -- gets lots of customers ... :) B. Garber @TheBGar Mar 10 2016 02:51 UTC haha yes bitgrower @bitgrower hates to disappoint @TheBGar -- but there ARE some more js challenges after that ... B. Garber @TheBGar Mar 10 2016 02:52 UTC wait, you mean knowing how to code that gets lots of customers? Or that it's great to know when you have lots of customers Here's what I have so far... I know it's incomplete //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": "Kristian", "lastName": "Vos", "number": "unknown", "likes": ["Javascript", "Gaming", "Foxes"] } ]; function lookUp(firstName, prop){ // Only change code below this line var x = ""; for (i = 0; i < contacts.length; i++) { if (contacts[i].firstName !== "" && contacts[i].prop !== "") { x = contacts[i][prop]; } else if (contacts[i].firstName !== contacts[i].firstName) { x = "No such contact"; } } return x; // Only change code above this line } // Change these values to test your function lookUp("Akira", "likes"); bitgrower @bitgrower Mar 10 2016 02:52 UTC it's a challenge for which help is frequently requested ... :) B. Garber @TheBGar Mar 10 2016 02:53 UTC @bitgrower I recognize that I don't know how to code for something that the program cannot find (i.e., firstName isn't in the contacts list) @bitgrower well that's a relief! bitgrower @bitgrower Mar 10 2016 02:54 UTC okay ... hmm ... which part of the instructions is the contacts[i].prop !== "" satisfying ? in fact, let's see ... "The function should check if firstName is an actual contact's firstName " ... ...so you are being passed a parameter, firstname, which contains a value you are supposed to see if any object in your array happens to have ... B. Garber @TheBGar Mar 10 2016 02:57 UTC @bitgrower yep. So I wrote !== "" meaning if there's a value for it, then I can return it bitgrower @bitgrower Mar 10 2016 02:58 UTC but where are you comparing the firstname property value to that of the passed in parameter ? B. Garber @TheBGar Mar 10 2016 02:58 UTC huh? bitgrower @bitgrower Mar 10 2016 02:59 UTC so ... firstname -- the parameter, is equal to "Akira" ... let's back up a bit ... B. Garber @TheBGar Mar 10 2016 03:00 UTC @bitgrower ok... bitgrower @bitgrower Mar 10 2016 03:00 UTC objects .. of which you have an array of, consist of key value pairs ... ...now those keys (just to make the nomenclature confusing) are ALSO known as "properties" Amir Eskandari @AmirEskandari87 Mar 10 2016 03:00 UTC Profile lookup, my favorite.. bitgrower @bitgrower Mar 10 2016 03:01 UTC in order to find the VALUE of a property, you "index" into the object with the property name ... @AmirEskandari87 -- LOL Amir Eskandari @AmirEskandari87 Mar 10 2016 03:01 UTC :) bitgrower @bitgrower Mar 10 2016 03:01 UTC so ... remember the lookup table challenge ? B. Garber @TheBGar Mar 10 2016 03:01 UTC @AmirEskandari87 :thumbsup: @bitgrower regrettably no. haha I'd have to refresh my memory. Just a sec bitgrower @bitgrower Mar 10 2016 03:02 UTC review it -- and make sure you understand it, because what it's teaching you there is esssential for solving Profile Lookup B. Garber @TheBGar Mar 10 2016 03:03 UTC @bitgrower got it....objects that have multiple properties (or value pairs) can be accessed with object[prop] bitgrower @bitgrower Mar 10 2016 03:03 UTC yes ... B. Garber @TheBGar Mar 10 2016 03:04 UTC @bitgrower I'm following :thumbsup: bitgrower @bitgrower Mar 10 2016 03:04 UTC so ... now things get a little more interesting, because they want to challenge you to use the 2 different ways of referencing a property of an object ... with brackets, and with dot notation... with dot notation you have to know the name of the property explicitly ... B. Garber @TheBGar Mar 10 2016 03:05 UTC @bitgrower yeah I believe this is where I get a little confused...why sometimes I can access things with brackets and other times I have to use dot notation or vice-versa bitgrower @bitgrower Mar 10 2016 03:05 UTC so, you can use contacts[i].firstname, because you are handed a data structure where all the objects have a firstname property ... B. Garber @TheBGar Mar 10 2016 03:06 UTC @bitgrower yep. I follow bitgrower @bitgrower Mar 10 2016 03:06 UTC MOST of the time you'll probably be using bracket notation ... for a variety of reasons ... but primarily among them is the fact that you can use a variable to contain the property name you are looking for (which is part of this challenge as well) B. Garber @TheBGar Mar 10 2016 03:06 UTC so when you don't know the property, it's gotta be something like contacts[i][prop] rather than dot notation? bitgrower @bitgrower Mar 10 2016 03:07 UTC yep! B. Garber @TheBGar Mar 10 2016 03:07 UTC @bitgrower ok. Yeah that's why I set that first look to return x set to that @TheBGar *loop bitgrower @bitgrower Mar 10 2016 03:07 UTC and if the property is named in such a way that it's not a valid js variable name ... like "glove box contents" B. Garber @TheBGar Mar 10 2016 03:08 UTC @bitgrower you have to use bracket notation for that right? @bitgrower because it has spaces bitgrower @bitgrower Mar 10 2016 03:08 UTC yes B. Garber @TheBGar Mar 10 2016 03:08 UTC @bitgrower all good. following bitgrower @bitgrower Mar 10 2016 03:08 UTC exactly so ... so to solve the first part of the instructions, you need to iterate thru all the objects looking for the VALUE of the firstname property to be === to the value of the firstname parameter ... B. Garber @TheBGar Mar 10 2016 03:09 UTC @bitgrower so second loop should be something like contacts[i][firstName] !== something? bitgrower @bitgrower Mar 10 2016 03:10 UTC well ... let's skip the iteration for the moment ... let's just take the first object in the array ... B. Garber @TheBGar Mar 10 2016 03:10 UTC @bitgrower yeah sorry I was skipping to the second part Sidharth Kriplani @sidkrip Mar 10 2016 03:11 UTC wiki Pig Latin CamperBot @camperbot Mar 10 2016 03:11 UTC :point_right: algorithm pig latin [wiki] Problem Explanation: • You need to create a program that will translate from English to Pig Latin. Check the instructions for converting to Pig Latin from the initial description or the wiki page. It might not be obvious but you need to remove all the consonants up to the first vowel in the case there letter does not start with a vowel. :pencil: read more about algorithm pig latin on the FCC Wiki bitgrower @bitgrower Mar 10 2016 03:11 UTC how are you going to see if the value of the firstname property in the first object is equal to value value of the firstname parameter ... first ... what IS the value of the firstname parameter ? @sidkrip -- weren't you just doing friendly dates ? B. Garber @TheBGar Mar 10 2016 03:12 UTC @bitgrower so my initial loop of :point_down: for ( i = 0; i < contacts.length; i++) {... is good no? since I'm able to use "i" to loop through contacts[i], right? bitgrower @bitgrower Mar 10 2016 03:12 UTC your for loop is definitely needed ... LOL ... I'm just skipping over that, because I figure you know how to iterate over an array ... :) B. Garber @TheBGar Mar 10 2016 03:13 UTC @bitgrower ok, good. I thought you were referencing that one. Good, so on to the first if loop then... @bitgrower indeed bitgrower @bitgrower Mar 10 2016 03:13 UTC we are just taking ONE object, contacts[0], and seeing how to follow the rest of the instructions ... ...now ... what is the value of the firstname parameter ? B. Garber @TheBGar Mar 10 2016 03:14 UTC @bitgrower firstName, yeah? @bitgrower or is it "firstName" with quotes bitgrower @bitgrower Mar 10 2016 03:14 UTC nope ... firstname is a parameter, an argument to the function, and it has a value ... B. Garber @TheBGar Mar 10 2016 03:15 UTC @TheBGar oh, I was thrown off because you weren't using camelCase...the value is Akira bitgrower @bitgrower Mar 10 2016 03:16 UTC sorry about that ... awesome ... okay ... so how am I going to reference the value of the firstName property of the object at contacts[0] ? B. Garber @TheBGar Mar 10 2016 03:17 UTC @bitgrower contacts[0].firstName @bitgrower or rather contacts[0][firstName] bitgrower @bitgrower Mar 10 2016 03:18 UTC actually, they want you to use dot notation in this exercise, I believe ... so you can do it either way, but for this one, I think they want you to use the first ... Maddah Anass @unlimiworks Mar 10 2016 03:18 UTC Back. Hello folks ! B. Garber @TheBGar Mar 10 2016 03:18 UTC @UnlimiWorks hello! bitgrower @bitgrower Mar 10 2016 03:18 UTC hello @UnlimiWorks Robert Richey @0x0936 Mar 10 2016 03:18 UTC hey unlim B. Garber @TheBGar Mar 10 2016 03:18 UTC @bitgrower ok, so contacts[0].firstName bitgrower @bitgrower Mar 10 2016 03:19 UTC hahaha @0x0936 -- hiding out there ... Robert Richey @0x0936 Mar 10 2016 03:19 UTC :see_no_evil: Maddah Anass @unlimiworks Mar 10 2016 03:19 UTC @0x0936 Always lurking B. Garber @TheBGar Mar 10 2016 03:19 UTC @UnlimiWorks lol nice bitgrower @bitgrower Mar 10 2016 03:19 UTC okay ... so how do you determine if that's equal to the value of the parameter firstName ? B. Garber @TheBGar Mar 10 2016 03:20 UTC @bitgrower ... contacts[0].firstName === firstName yeah? bitgrower @bitgrower Mar 10 2016 03:20 UTC yeah!!!! Richard Corbett @reacorbett Mar 10 2016 03:20 UTC hello everyone!!! :) bitgrower @bitgrower Mar 10 2016 03:20 UTC so ... for contacts[0] that would be ??? hi @reacorbett Snowysun @Snowysun Mar 10 2016 03:21 UTC function multiplyAll(arr) { var product = 1; // Only change code below this line for (var i = 0; i < arr.length; i++) { for (var a = 0; a < arr[i].length; a++){ product *= arr[i]; } } // Only change code above this line return product; } // Modify values below to test your code multiplyAll([[1,2],[3,4],[5,6,7]]); I'm stuck on Nesting For Loops, I can get the first checkmark with my code, but for the 2 other ones it returns null when I run it. B. Garber @TheBGar Mar 10 2016 03:21 UTC I'm confused as to what question you're asking there? for contacts[0] --> Akira === Akira, which is true? Richard Corbett @reacorbett Mar 10 2016 03:21 UTC @bitgrower hi. nice to see you this evening(or morning depending on your geographic location). B. Garber @TheBGar Mar 10 2016 03:22 UTC @reacorbett hello! bitgrower @bitgrower Mar 10 2016 03:22 UTC @TheBGar -- yes, true ... since it would be in an "if" statement .. :) Richard Corbett @reacorbett Mar 10 2016 03:22 UTC @TheBGar Hi bitgrower @bitgrower Mar 10 2016 03:22 UTC @snowysun ... you may want to review the challenges on indexing into arrays ... Steve Carroll @SteveCarroll Mar 10 2016 03:22 UTC @reacorbett Hi! And thanks again for your private response on rot13 CamperBot @camperbot Mar 10 2016 03:22 UTC stevecarroll sends brownie points to @reacorbett :sparkles: :thumbsup: :sparkles: :star: 305 | @reacorbett | http://www.freecodecamp.com/reacorbett Maddah Anass @unlimiworks Mar 10 2016 03:22 UTC I have a serious question. I'm constantly finding myself unable to make my projects pretty, or at least not ugly. I'm realllllly having trouble on that part. Never considered myself good at designing the look of things, and never had proper training either. Do you guys think being a good web developer automatically means one should be good in design ? :worried: Richard Corbett @reacorbett Mar 10 2016 03:23 UTC @SteveCarroll not a problem. Did it help you out at all? B. Garber @TheBGar Mar 10 2016 03:23 UTC @bitgrower yeah I can update that part of my code and do the same for the prop part too...want me to post updated code here? Steve Carroll @SteveCarroll Mar 10 2016 03:23 UTC @reacorbett It's funny, I only read it today, after I finished the thing... but I think you were driving at what I did :) I left you a msg and the code bitgrower @bitgrower Mar 10 2016 03:24 UTC @UnlimiWorks -- um ... eye candy counts for something ... esp if you're doing front end ... there are resources on the web which can guide you in design principles ... (the golden mean, i think it's called, is one of them) sure @TheBGar Steve Carroll @SteveCarroll Mar 10 2016 03:24 UTC @UnlimiWorks My take: You need some design experience Vanessa Jimenez @vjimenez327 Mar 10 2016 03:25 UTC Hi, can i get help on javascript with the word blanks portion? i think i'm slightly confused on the directions, and not sure what to code. B. Garber @TheBGar Mar 10 2016 03:25 UTC @UnlimiWorks no way...you can always work with a designer, but what's your ultimate goal? Many companies will often have designers on staff as well bitgrower @bitgrower Mar 10 2016 03:26 UTC sure -- please post your code ... Maddah Anass @unlimiworks Mar 10 2016 03:26 UTC I should get on the front end train and learn some. I'm relying too much on bootstrap alone Thanks for your input guys. I will certainly add that to my weekly learnings Vanessa Jimenez @vjimenez327 Mar 10 2016 03:26 UTC function wordBlanks(myNoun, myAdjective, myVerb, myAdverb) { var result = ""; // Your code below this line result = "cat, little, hit, slowly"; // Your code above this line return result; } // Change the words here to test your function wordBlanks("dog", "big", "ran", "quickly"); B. Garber @TheBGar Mar 10 2016 03:26 UTC @UnlimiWorks great coders that are great designers are an extremely rare breed Maddah Anass @unlimiworks Mar 10 2016 03:26 UTC @TheBGar Well my initial goal was to be a backend developer, but this fullstack wave is making me dizzy Richard Corbett @reacorbett Mar 10 2016 03:26 UTC @SteveCarroll yeah, I just looked at it. Nice. bitgrower @bitgrower Mar 10 2016 03:26 UTC yeah, but if you want to be completely devoid of design work ... be a backend person ... :) Guzman Monne @guzmonne Mar 10 2016 03:27 UTC @vjimenez327 You should write a function that takes those four words and returns a string with them, plus whitespaces in the middle. Steve Carroll @SteveCarroll Mar 10 2016 03:27 UTC @reacorbett I was trying to get it to work for all characters but gave up on that B. Garber @TheBGar Mar 10 2016 03:27 UTC @UnlimiWorks so why not just concentrate on back end? @bitgrower exactly Maddah Anass @unlimiworks Mar 10 2016 03:27 UTC I kinda feel like fullstack is more interesting now that i opened up a little bit to the industry trends, that's why i began questioning my way Vanessa Jimenez @vjimenez327 Mar 10 2016 03:27 UTC oh i see Thank you! bitgrower @bitgrower Mar 10 2016 03:28 UTC well, if you're the full stack person, you'd probably be "too valuable" to do design work ... LOL really depends, like @TheBGar said ...what your goal is ... Guzman Monne @guzmonne Mar 10 2016 03:28 UTC No problem B. Garber @TheBGar Mar 10 2016 03:29 UTC @bitgrower //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": "Kristian", "lastName": "Vos", "number": "unknown", "likes": ["Javascript", "Gaming", "Foxes"] } ]; function lookUp(firstName, prop){ // Only change code below this line var x = ""; for (i = 0; i < contacts.length; i++) { if (contacts[i].firstName === firstName && contacts[i].prop === prop) { x = contacts[i][prop]; } else if (contacts[i].firstName !== contacts[i].firstName) { x = "No such contact"; } } return x; // Only change code above this line } // Change these values to test your function lookUp("Akira", "likes"); Richard Corbett @reacorbett Mar 10 2016 03:29 UTC @SteveCarroll Is it working? Steve Carroll @SteveCarroll Mar 10 2016 03:30 UTC @reacorbett not with the animation, no Maddah Anass @unlimiworks Mar 10 2016 03:30 UTC I see. one of my short-middle term goals is to debute in freelance work, I guess that's one of the reasons behind my confusion. I see a lot of 'frontend design requirements' bitgrower @bitgrower Mar 10 2016 03:30 UTC okay ... so ... next part, @TheBGar -- the next requirement is ... if you DO find that the firstName parameter and & firstName property are the same, you want to see if that object has the property contained in the prop parameter ... Steve Carroll @SteveCarroll Mar 10 2016 03:31 UTC @UnlimiWorks You'll see people ask for everything B. Garber @TheBGar Mar 10 2016 03:31 UTC @bitgrower so I chained them together in the if loop with && yeah? Richard Corbett @reacorbett Mar 10 2016 03:31 UTC oh im sorry. I was talking about the code for ceasars cipher. I am just now looking at the link. @SteveCarroll Steve Carroll @SteveCarroll Mar 10 2016 03:31 UTC @reacorbett Oh, yeah... it passed Maddah Anass @unlimiworks Mar 10 2016 03:31 UTC @SteveCarroll Yeah, now that I think about it.. Alright. I'll make it a low priority goal and see how it goes in a few weeks bitgrower @bitgrower Mar 10 2016 03:32 UTC well, except you are using prop as a literal key -- and it isn't ... it's just a variable containing the name of a key you have the data structure .. there's not one object which has a property with the name "prop" Maddah Anass @unlimiworks Mar 10 2016 03:33 UTC Thank you for your honest opinion guys... Here's a brownie :) @bitgrower , @SteveCarroll @TheBGar CamperBot @camperbot Mar 10 2016 03:33 UTC unlimiworks sends brownie points to @bitgrower and @stevecarroll and @thebgar :sparkles: :thumbsup: :sparkles: :star: 279 | @stevecarroll | http://www.freecodecamp.com/stevecarroll :star: 346 | @thebgar | http://www.freecodecamp.com/thebgar :star: 785 | @bitgrower | http://www.freecodecamp.com/bitgrower B. Garber @TheBGar Mar 10 2016 03:33 UTC @bitgrower should it be... contacts[i].prop === (prop) with parenthesis? @UnlimiWorks Thanks :smile: CamperBot @camperbot Mar 10 2016 03:33 UTC thebgar sends brownie points to @unlimiworks :sparkles: :thumbsup: :sparkles: :star: 326 | @unlimiworks | http://www.freecodecamp.com/unlimiworks bitgrower @bitgrower Mar 10 2016 03:34 UTC LOL ... I feel like we're backliding here, @TheBGar ... when do you use dot notation ? Maddah Anass @unlimiworks Mar 10 2016 03:34 UTC Do you think i'm allowed to peep at the example project's css after i finish each one ? bitgrower @bitgrower Mar 10 2016 03:34 UTC why the heck not ? B. Garber @TheBGar Mar 10 2016 03:35 UTC @bitgrower sorry. I'm trying to follow here. the "literal key" jargon threw me through a loop...no pun intended haha. Steve Carroll @SteveCarroll Mar 10 2016 03:35 UTC @TheBGar If ever there was a time for a pun... Maddah Anass @unlimiworks Mar 10 2016 03:35 UTC Right :) B. Garber @TheBGar Mar 10 2016 03:35 UTC @bitgrower I know, right? bitgrower @bitgrower Mar 10 2016 03:36 UTC that's how you grow -- you go look at other peep's code -- you see something on a website and you go ... "how did they do that" ? B. Garber @TheBGar Mar 10 2016 03:36 UTC @bitgrower I understood your comment about not one object having a property with the name "prop" just not sure how to code for that when comparing with === Steve Carroll @SteveCarroll Mar 10 2016 03:36 UTC @TheBGar This may be the wrong way to think bout it but I liken them to associative arrays bitgrower @bitgrower Mar 10 2016 03:36 UTC one way -- which I think would actually work, was what you had in the very beginning ... @SteveCarroll -- yeah, they are very much like associative arrays -- but I didn't want to complicate things with more jargon ... :) Steve Carroll @SteveCarroll Mar 10 2016 03:37 UTC I know, wish I hadn't said it:) bitgrower @bitgrower Mar 10 2016 03:37 UTC I don't even know if @TheBGar even knows what associative arrays are ... B. Garber @TheBGar Mar 10 2016 03:38 UTC @bitgrower oh no! haha now that I've learned and coded it differently :smile: and no, I do not know associative arrays yet. Still a noob regrettably bitgrower @bitgrower Mar 10 2016 03:38 UTC @TheBGar -- they are kinda what happens in the "using objects for lookup" challenge ... basically, it's where, instead of using a number like you do to index into an array, you index with a string value ... kinda weird ... but it works very well "under the hood" of the interpreter ...and is a VERY powerful construct B. Garber @TheBGar Mar 10 2016 03:39 UTC @bitgrower so something like contacts["0"].property ? Sidharth Kriplani @sidkrip Mar 10 2016 03:39 UTC wiki Spinal Tap Case CamperBot @camperbot Mar 10 2016 03:39 UTC :point_right: algorithm spinal tap case [wiki] Problem Explanation: • Convert the given string to an all lowercase sentence joined by dashes. :pencil: read more about algorithm spinal tap case on the FCC Wiki Steve Carroll @SteveCarroll Mar 10 2016 03:40 UTC @bitgrower Yeah, only way to do dynamic stuff Rex Schrader @SaintPeter Mar 10 2016 03:40 UTC They're called 'Hashes' in Perl, which is most decriptive because they use a "Hashing Function" to convert the input string into an index. In PHP they're associative arrays. bitgrower @bitgrower Mar 10 2016 03:40 UTC well ... the EASIEST way to determine if an object has a particular property is to use the .hasOwnProperty() method Maddah Anass @unlimiworks Mar 10 2016 03:40 UTC I was surprised i didn't find associative arrays in javascript too. Coming from a php background, i got too comfy using that Greg @madcoyote Mar 10 2016 03:41 UTC Hey folks! Anyone familiar with the 'Stand in Line' part of the javascript exercises? its all about messing with queues and I am lost... Steve Carroll @SteveCarroll Mar 10 2016 03:41 UTC @UnlimiWorks same here bitgrower @bitgrower Mar 10 2016 03:41 UTC LOL @TheBGar ... why are you putting quotes around your array index above ? B. Garber @TheBGar Mar 10 2016 03:42 UTC @SaintPeter I was just praying for your intercession! glad you showed up...This profile lookup challenge has me scratching my head! And all after I already got through all the last curriculum collection of javascript projects :wink2: Rex Schrader @SaintPeter Mar 10 2016 03:42 UTC @TheBGar LOL B. Garber @TheBGar Mar 10 2016 03:42 UTC @bitgrower just trying to understand the string talk you were mentioning bitgrower @bitgrower Mar 10 2016 03:42 UTC just concentrate on things like the "using objects for lookups" challenge .. understand that and don't worry about jargon ... Sidharth Kriplani @sidkrip Mar 10 2016 03:42 UTC anyone here good at regexps? @bitgrower you da man! SaintPeter @SaintPeter is pretty good at regexps Rex Schrader @SaintPeter Mar 10 2016 03:43 UTC 'sup? B. Garber @TheBGar Mar 10 2016 03:43 UTC @bitgrower got it... Sidharth Kriplani @sidkrip Mar 10 2016 03:43 UTC okay so I cant wrap my head around these two statements @SaintPeter var regex = /\s+|_+/g; ( str = str.replace(/([a-z])([A-Z])/g, '$1 $2'); B. Garber @TheBGar Mar 10 2016 03:43 UTC well, I suppose I'll take a closer look at that challenge then and put it to work for me in this profile lookup challenge bitgrower @bitgrower Mar 10 2016 03:44 UTC so ... you understand .hasOwnProperty() method, @TheBGar ... Rex Schrader @SaintPeter Mar 10 2016 03:44 UTC @sidkrip Ok, so the first one says "match at least one or more spaces OR at least one or more underscores" Sidharth Kriplani @sidkrip Mar 10 2016 03:44 UTC in the second statement, I dont know what "$" is used for
B. Garber
@TheBGar
Mar 10 2016 03:45 UTC
@bitgrower I'll brush up on that too :grin:
Sidharth Kriplani
@sidkrip
Mar 10 2016 03:45 UTC
@SaintPeter got the first one. I had learnt a lot about regexps from regexone but not anything about the "$" Rex Schrader @SaintPeter Mar 10 2016 03:45 UTC @sidkrip The second one says "match and capture a lowercase letter followed by an uppercase letter, which you should also capture" - the $1 and $2 are the first and second capture grousp respectively. @sidkrip You can have up to $9
@sidkrip A capture group is inside the parentheses
bitgrower
@bitgrower
Mar 10 2016 03:46 UTC
@TheBGar -- you are getting close ... review "using objects for lookup", .hasOwnProperty() -- and what we've discussed and you're 90% of the way home ... the only other gotcha in that challenge is determining when to return "no such contact" :)
Sidharth Kriplani
@sidkrip
Mar 10 2016 03:46 UTC
@SaintPeter any good site to learn about regexps extensively?
@SaintPeter
Mar 10 2016 03:46 UTC
@sidkrip IE: /([0-9])dog/ would capture a single digit from one to nine, followed by the word dog. The first capture group would just be the number.
bitgrower
@bitgrower
Mar 10 2016 03:47 UTC
regexone.com is a good one, @sidkrip
@SaintPeter
Mar 10 2016 03:47 UTC
@sidkrip I like http://regexr.com and http://regex101.com - the first has a decent reference.
Anas R. Firdousi
@afirdousi
Mar 10 2016 03:47 UTC
Understanding pattern behind #Observable in JS -Part#1 of series leading to Observables in #Angular2 #RxJS #Reactive
http://bit.ly/1RMLxlo
Sidharth Kriplani
@sidkrip
Mar 10 2016 03:47 UTC
@SaintPeter yup got that. Thanks @bitgrower @SaintPeter
CamperBot
@camperbot
Mar 10 2016 03:47 UTC
sidkrip sends brownie points to @saintpeter and @bitgrower :sparkles: :thumbsup: :sparkles:
@SaintPeter
Mar 10 2016 03:47 UTC
CamperBot
@camperbot
Mar 10 2016 03:47 UTC
:star: 2630 | @saintpeter | http://www.freecodecamp.com/saintpeter
:star: 786 | @bitgrower | http://www.freecodecamp.com/bitgrower
@SaintPeter
Mar 10 2016 03:48 UTC
@sidkrip FCC used to use the RegexOne tutorials - they're a good first pass.
@sidkrip This video is really really good:
B. Garber
@TheBGar
Mar 10 2016 03:48 UTC
@bitgrower cool. Thanks for your patience and help
CamperBot
@camperbot
Mar 10 2016 03:48 UTC
thebgar sends brownie points to @bitgrower :sparkles: :thumbsup: :sparkles:
:star: 787 | @bitgrower | http://www.freecodecamp.com/bitgrower
Anas R. Firdousi
@afirdousi
Mar 10 2016 03:48 UTC
Please free to comment, question or any feedbacks are appreciated.
bitgrower
@bitgrower
Mar 10 2016 03:49 UTC
yw @TheBGar -- happy coding !
Sidharth Kriplani
@sidkrip
Mar 10 2016 03:49 UTC
@SaintPeter I have completed everything on regexone and sure, I will check out the video as well. Thank you :)
CamperBot
@camperbot
Mar 10 2016 03:49 UTC
sidkrip sends brownie points to @saintpeter :sparkles: :thumbsup: :sparkles:
:warning: sidkrip already gave saintpeter points
@unlimiworks
Mar 10 2016 03:50 UTC
@afirdousi Talking about the observer pattern ?
bitgrower
@bitgrower
Mar 10 2016 03:50 UTC
actually, I like the tutorials/challenges which come after the first set of exercises ...
Robert Richey
@0x0936
Mar 10 2016 03:50 UTC
@SaintPeter that's still the best video on regex. Lea is great :+1:
José
@Ledjez
Mar 10 2016 03:50 UTC
// Setup
var testString = "There are 3 cats but 4 dogs.";

// Only change code below this line.

var expression = /.+/g;  // Change this line

// Only change code above this line

// This code counts the matches of expression in testString
var digitCount = testString.match(expression).length;
hello, can someone explain to me this part "var expression = /.+/g;" ?
@unlimiworks
Mar 10 2016 03:50 UTC
Anas R. Firdousi
@afirdousi
Mar 10 2016 03:50 UTC
@UnlimiWorks : Observer , Iterator and the mix in JS
José
@Ledjez
Mar 10 2016 03:50 UTC
specifically what does .+ do?
Robert Richey
@0x0936
Mar 10 2016 03:51 UTC
. is any character. + is one or more of the previous characters.
@unlimiworks
Mar 10 2016 03:51 UTC
@Ledjez + is a special character meaning ''any repetition of that expression''
Sidharth Kriplani
@sidkrip
Mar 10 2016 03:51 UTC
@SaintPeter while we are at it, how can I use RegExp in the bonfire Convert HTML entities?
@SaintPeter
Mar 10 2016 03:51 UTC
@Ledjez . matches "any character" and the + means "one or more of the previous character"
@sidkrip Well, the most obvious way would be to create a regex for each of the elements you're replacing. IE: /&/g and then use Replace
Sidharth Kriplani
@sidkrip
Mar 10 2016 03:52 UTC
alright. I will try that
José
@Ledjez
Mar 10 2016 03:53 UTC
@SaintPeter @0x0936 @UnlimiWorks so is it like random? meaning the first thing that it sees, whether it's a string, number, etc...?
@SaintPeter
Mar 10 2016 03:54 UTC
@Ledjez It matches, literally, any single character. It's a wildcard.
José
@Ledjez
Mar 10 2016 03:55 UTC
@SaintPeter thanks
CamperBot
@camperbot
Mar 10 2016 03:55 UTC
ledjez sends brownie points to @saintpeter :sparkles: :thumbsup: :sparkles:
:star: 2631 | @saintpeter | http://www.freecodecamp.com/saintpeter
B. Garber
@TheBGar
Mar 10 2016 04:14 UTC
@bitgrower I'm back. haha
Fernando Ramirez
@Gords
Mar 10 2016 04:26 UTC
is anyone here?
V Arun Kumar
@arunvkumr
Mar 10 2016 04:28 UTC
@Gords we are here. :smiley:
Richard Corbett
@reacorbett
Mar 10 2016 04:33 UTC
@SteveCarroll thanks
CamperBot
@camperbot
Mar 10 2016 04:33 UTC
reacorbett sends brownie points to @stevecarroll :sparkles: :thumbsup: :sparkles:
:star: 280 | @stevecarroll | http://www.freecodecamp.com/stevecarroll
Fernando Ramirez
@Gords
Mar 10 2016 04:34 UTC
function drop(arr, func) {
// Drop them elements.
for(i=0;i<arr.length;i++){
if (func(arr[i])===true){
arr = arr.slice(i,(arr.length));
break;
}

}
return arr;
}

drop([1, 2, 3, 4], function(n) {return n > 5;});
i want to know why this code works for every case, except this one {return n>5}
nvm just solved it
B. Garber
@TheBGar
Mar 10 2016 04:37 UTC
@SaintPeter you still in the chat?
Simeon
@Boasbabs
Mar 10 2016 04:42 UTC
please guys, i am a beginner in js, how do i reverse a string
Hugo Nuñez Romante
@hospiciano0
Mar 10 2016 04:44 UTC
I'm stuck
V Arun Kumar
@arunvkumr
Mar 10 2016 04:45 UTC
help reverse string
CamperBot
@camperbot
Mar 10 2016 04:45 UTC
no wiki entry for: reverse string
V Arun Kumar
@arunvkumr
Mar 10 2016 04:45 UTC
help string reverse
CamperBot
@camperbot
Mar 10 2016 04:45 UTC
no wiki entry for: string reverse
DJ
@qualitymanifest
Mar 10 2016 04:45 UTC
V Arun Kumar
@arunvkumr
Mar 10 2016 04:45 UTC
bot reverse
CamperBot
@camperbot
Mar 10 2016 04:45 UTC

Problem Explanation:

We need to take the string and reverse it, so if it originally reads 'hello', it will now read 'olleh'. We will need to split the string, and therefore we will be working with Arrays as well.

Anas R. Firdousi
@afirdousi
Mar 10 2016 04:46 UTC
@Boasbabs : Most naive way:
V Arun Kumar
@arunvkumr
Mar 10 2016 04:46 UTC
there you go @Boasbabs read that up :point_up:
Anas R. Firdousi
@afirdousi
Mar 10 2016 04:47 UTC
"I am a String".split ("").reverse ().join ("");
Hugo Nuñez Romante
@hospiciano0
Mar 10 2016 04:48 UTC
guys, how do I "quote" a box of code, I need help with a basic JS task
Dylan
@dhcodes
Mar 10 2016 04:48 UTC
@hospiciano0 what do you mean?
@hospiciano0 is there a fcc challenge assoc with your question?
Markus Kiili
@Masd925
Mar 10 2016 04:48 UTC
wiki format
CamperBot
@camperbot
Mar 10 2016 04:48 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 the code.

See also: ☛ How to type Backticks | ☯ Compose Mode | ❄ Gitter Formatting Basics

Hugo Nuñez Romante
@hospiciano0
Mar 10 2016 04:49 UTC

function queue(arr, item) {
arr.push(item);

return arr; // Change this line
}

// Test Setup
var testArr = [1,2,3,4,5];

// Display Code
console.log("Before: " + JSON.stringify(testArr));
console.log(queue(testArr, 6)); // Modify this line to test
console.log("After: " + JSON.stringify(testArr));

Ok.. I did it wrong
@SaintPeter
Mar 10 2016 04:49 UTC
@TheBGar Nope ;)
Dylan
@dhcodes
Mar 10 2016 04:50 UTC
@hospiciano0 what do you need to do?
@hospiciano0 is this the stand in line challenge?
Hugo Nuñez Romante
@hospiciano0
Mar 10 2016 04:51 UTC
exactly that
I think I am missunderstanding something
Simeon
@Boasbabs
Mar 10 2016 04:52 UTC
@afirdousi @arunkumrv @afirdousi thanks!
CamperBot
@camperbot
Mar 10 2016 04:52 UTC
boasbabs sends brownie points to @afirdousi and @arunkumrv :sparkles: :thumbsup: :sparkles:
:warning: could not find receiver for afirdousi
:star: 336 | @arunkumrv | http://www.freecodecamp.com/arunkumrv
Hugo Nuñez Romante
@hospiciano0
Mar 10 2016 04:52 UTC
My steps are.. "add the number to the end of the array".. so I use .push(item)
Dylan
@dhcodes
Mar 10 2016 04:52 UTC
@hospiciano0 you just need to return the first item in the array after you push the item in the argument
yeah so you need to return arr. shift()
i think
or do var firstItem = arr.shift()
return firstItem;
@hospiciano0 I think you just put your code above the "change this line" designation so maybe it's not working right because you're returning the whole array when you just need to return the first item
since your code has return arr; as the last command
V Arun Kumar
@arunvkumr
Mar 10 2016 04:55 UTC
@hospiciano0 use another variable to store the returned values from shift and return that element.
andre-vandam
@andre-vandam
Mar 10 2016 04:55 UTC
This message was deleted
Hugo Nuñez Romante
@hospiciano0
Mar 10 2016 04:56 UTC
Ok guys, give me a few moments to figure this out, I am kinda slow. Thanks for the info
Amir Eskandari
@AmirEskandari87
Mar 10 2016 04:58 UTC
@hospiciano0 or just return right when you run the shift method on arr
Hugo Nuñez Romante
@hospiciano0
Mar 10 2016 04:59 UTC
ok that worked
@unlimiworks
Mar 10 2016 05:00 UTC
It works, but... I'm I overthinking this ?
There's no way this algorithm challenge could be that complicated
function diff(arr1, arr2) {

return arr1.concat(arr2).filter(function(element, index, array) {
return array.slice(0, index).concat(array.slice(index + 1, array.length)).indexOf(element) == -1;
});
}

diff([1, 2, 3, 5], [1, 2, 3, 4, 5]);
help diff two arrays
CamperBot
@camperbot
Mar 10 2016 05:01 UTC

Explanation:

Check two arrays and return a new array that contains only the items that are not in either of the original arrays.

Amir Eskandari
@AmirEskandari87
Mar 10 2016 05:01 UTC
@hospiciano0 cool!
bitgrower
@bitgrower
Mar 10 2016 05:01 UTC
why not just use Array.filter and indexOf, @UnlimiWorks ?
oh ... wait -- you do use indexOf ...
V Arun Kumar
@arunvkumr
Mar 10 2016 05:02 UTC
Hugo Nuñez Romante
@hospiciano0
Mar 10 2016 05:02 UTC
so arr.shift() inside the function AND in the return is kinda redundant and doesnt work, but when I do it only in "return arr.shift()" it works
sorry if my english is confusing you all, I aprreciate the help
@unlimiworks
Mar 10 2016 05:04 UTC
@arunkumrv THe thing is, i'm doing exactly that.
But maybe I overcomplicated it. I'm looking for different approaches.
bitgrower
@bitgrower
Mar 10 2016 05:04 UTC
right ... arr.shift is going to affect the array
Markus Kiili
@Masd925
Mar 10 2016 05:04 UTC
@UnlimiWorks You can simplify it a bit by using indexOf and lastIndexOf inside the callback function.
Amir Eskandari
@AmirEskandari87
Mar 10 2016 05:04 UTC
@hospiciano0 you can do return arr.shift() like i said, or you can make a new var for the shift and return that var like:
@unlimiworks
Mar 10 2016 05:04 UTC
I think i tried too hard to use the functions proposed
bitgrower
@bitgrower
Mar 10 2016 05:04 UTC

if you do

item = array.shift();
return item;

then it would work

Amir Eskandari
@AmirEskandari87
Mar 10 2016 05:04 UTC
@UnlimiWorks yeah like @bitgrower said
bitgrower
@bitgrower
Mar 10 2016 05:04 UTC
all those slices hurt my head ...
V Arun Kumar
@arunvkumr
Mar 10 2016 05:05 UTC
@bitgrower i dont think we would need indexOf. filter with arg as second array would do, what you say or maybe some function or even reduce function.
bitgrower
@bitgrower
Mar 10 2016 05:05 UTC
yeah, I don't remember what I did ...
LOL .. I used loops ... guess it was before I really understood filter ... :)
@unlimiworks
Mar 10 2016 05:07 UTC
Basically what i did was create a new array without the current element and check if there is another remaining copy of it inside that one.
Hm, I'm trying to understand what you guys just proposed
andre-vandam
@andre-vandam
Mar 10 2016 05:07 UTC
for (var i =0 ; i< arr.lenght ; i++) { for (var j=0; j<arr[i].lenght;j++) { product = product * arr[i][j]; } }
nesting for loops, for the life of me cant figure out whats wrong
Coy Sanders
@coymeetsworld
Mar 10 2016 05:08 UTC
length spelled wrong? @andre-vandam
andre-vandam
@andre-vandam
Mar 10 2016 05:08 UTC
thanks!
Amir Eskandari
@AmirEskandari87
Mar 10 2016 05:08 UTC
@coymeetsworld @andre-vandam HATE when that happens
andre-vandam
@andre-vandam
Mar 10 2016 05:09 UTC
its a horrible, plus since you dont have a proper debugger, it gets to be a pain
@unlimiworks
Mar 10 2016 05:11 UTC
Eh, this is actually easy if i use the argument arrays inside the callback...
Can't believe that I didn't think about it earlier
Oh well, :grin:
bitgrower
@bitgrower
Mar 10 2016 05:12 UTC
but you would have to copy the arguments object then @UnlimiWorks -- because you'd have a different one in the callback function ...
@unlimiworks
Mar 10 2016 05:13 UTC
@bitgrower Sorry, i'm having a hard time understanding what you mean
bitgrower
@bitgrower
Mar 10 2016 05:14 UTC
well you said it's easy if you use the argument arrays inside the callback -- maybe I'm not understanding what you meant by that ...
xentricqt
@xentricqt
Mar 10 2016 05:15 UTC
having issues with 149, it's make c= c 10; so c=46
c times= c times 10
@unlimiworks
Mar 10 2016 05:16 UTC
This is what I meant :
function diff(arr1, arr2) {

return arr1.concat(arr2).filter(function(element) {
//return array.slice(0, index).concat(array.slice(index + 1, array.length)).indexOf(element) == -1;
return arr1.indexOf(element) === -1 || arr2.indexOf(element) ===-1;
});
}

diff([1, 2, 3, 5], [1, 2, 3, 4, 5]);
xentricqt
@xentricqt
Mar 10 2016 05:17 UTC
c *= c * 10;
bitgrower
@bitgrower
Mar 10 2016 05:17 UTC
yep ... that would seem to work !
Coy Sanders
@coymeetsworld
Mar 10 2016 05:17 UTC
nope
@unlimiworks
Mar 10 2016 05:17 UTC
Yeah :) Much more elegant imo too. I went berserk on the first one XD
Coy Sanders
@coymeetsworld
Mar 10 2016 05:18 UTC
c *= c * 10 translates to c * c * 10
@unlimiworks
Mar 10 2016 05:19 UTC
It's so much fun to talk about code
xentricqt
@xentricqt
Mar 10 2016 05:19 UTC
o the var for c is var c = 4.6;
so it's 4.6 4.6 = 21.16 number to = 46
Coy Sanders
@coymeetsworld
Mar 10 2016 05:24 UTC
huh?
Daniel Bashir
@db7894
Mar 10 2016 05:29 UTC
I've got a question on the Reverse a String challenge, I've put a few functions in order to split the string and do everything else into a function, but I keep getting an error saying "oldString.split is not a function" and I don't understand what's wrong with it. Could anyone help?
Here's the code I have:
function reverseString(str) {
var oldString = [];
var newString = oldString.split('');
newString.reverse();
str = newString.join();
return str;
}

reverseString("hello");
bitgrower
@bitgrower
Mar 10 2016 05:35 UTC
don't you want to be using the str argument ?
Meghana
@meghanasarikonda
Mar 10 2016 05:36 UTC
@db7894 your old string is []
[ ]
Daniel Bashir
@db7894
Mar 10 2016 05:37 UTC
Ah right, I need to put it into the oldString... Silly me!
It still give me the same error though... I'm not exactly sure why it's doing that
*gives
Meghana
@meghanasarikonda
Mar 10 2016 05:37 UTC
Daniel Bashir
@db7894
Mar 10 2016 05:38 UTC
function reverseString(str) {
var oldString = [str];
var newString = oldString.split('');
newString.reverse();
str = newString.join();
return str;
}

reverseString("hello");
Same as before but I added the str argument
Wait hold on
I did silly things there lemme fix that
bitgrower
@bitgrower
Mar 10 2016 05:38 UTC
LOL ...
Meghana
@meghanasarikonda
Mar 10 2016 05:38 UTC
@db7894 [str]
correct it
bitgrower
@bitgrower
Mar 10 2016 05:39 UTC
how many hours you been working on your code @db7894 ?
yeah I think that's what he meant by "I did silly things"
Daniel Bashir
@db7894
Mar 10 2016 05:39 UTC
@bitgrower Not many...
bitgrower
@bitgrower
Mar 10 2016 05:39 UTC
long day ?
Daniel Bashir
@db7894
Mar 10 2016 05:39 UTC
Yeah sort of
Wait is that what was wrong with it I thought it was other things in there
Well I guess that too
bitgrower
@bitgrower
Mar 10 2016 05:40 UTC
i'm guessing js doesn't like to perform functions on an empty array ... although I find that a little disturbing ...
Daniel Bashir
@db7894
Mar 10 2016 05:41 UTC
Right... Maybe I should reset this and try again
Meghana
@meghanasarikonda
Mar 10 2016 05:41 UTC
just split the string
@db7894
bitgrower
@bitgrower
Mar 10 2016 05:41 UTC
yeah, i think he's got that figured out, @meghanasarikonda ...
but if he feels more comfortable in resetting the code, I can appreciate that ...
Meghana
@meghanasarikonda
Mar 10 2016 05:43 UTC
yeah
that's okay
Daniel Bashir
@db7894
Mar 10 2016 05:43 UTC
Ok this is what I have now
function reverseString(str) {
var oldString = [str];
var newString = oldString.split('');
newString.reverse();
str = newString.join();
return str;
}

reverseString("hello");
Wait
function reverseString(str) {
str.split('');
str.reverse();
str.join();
return str;
}

reverseString("hello");
That
bitgrower
@bitgrower
Mar 10 2016 05:44 UTC
does it pass ?
Daniel Bashir
@db7894
Mar 10 2016 05:44 UTC
but this time str.reverse is evidently not a function
So no :worried:
Meghana
@meghanasarikonda
Mar 10 2016 05:45 UTC
i think you should assign those to a variable
try doing that
bitgrower
@bitgrower
Mar 10 2016 05:45 UTC
you probably need to look up str.split in MDN @db7894 -- I think, since strings are immutable, that you have to set the result of str.split to a new variable
cannelflow
@cannelflow
Mar 10 2016 05:45 UTC
@db7894 assign the variable to it and then return
bitgrower
@bitgrower
Mar 10 2016 05:45 UTC
^^^ what @meghanasarikonda beat me to in saying ...
DJ
@qualitymanifest
Mar 10 2016 05:45 UTC
yeah, doesn't necessarily have to be a new variable. you could assign each part back to str
str = doing stuff with str
bitgrower
@bitgrower
Mar 10 2016 05:46 UTC
ahhh the nuances of js ...
Daniel Bashir
@db7894
Mar 10 2016 05:47 UTC
Oh sweet
Yay it worked
Thanks @bitgrower @meghanasarikonda @cannelflow @qualitymanifest
CamperBot
@camperbot
Mar 10 2016 05:47 UTC
db7894 sends brownie points to @bitgrower and @meghanasarikonda and @cannelflow and @qualitymanifest :sparkles: :thumbsup: :sparkles:
:star: 1066 | @qualitymanifest | http://www.freecodecamp.com/qualitymanifest
:star: 883 | @cannelflow | http://www.freecodecamp.com/cannelflow
:star: 295 | @meghanasarikonda | http://www.freecodecamp.com/meghanasarikonda
:star: 788 | @bitgrower | http://www.freecodecamp.com/bitgrower
@roshankd
Mar 10 2016 05:47 UTC
hey, how to run this query
You should use two double quotes (") and four escaped double quotes (\")
bigbeno37
@bigbeno37
Mar 10 2016 05:49 UTC
oh I remember that @roshankd
Can you paste what you've got so far?
@roshankd
Mar 10 2016 05:51 UTC
var myStr;
myStr="I am a \"double quoted\" string inside \"double quotes\"";
bitgrower
@bitgrower
Mar 10 2016 05:52 UTC
look for typos ...
bigbeno37
@bigbeno37
Mar 10 2016 05:52 UTC
@roshankd
that should do it
bitgrower
@bitgrower
Mar 10 2016 05:52 UTC
do you need a period at the end of that sentence ?
bigbeno37
@bigbeno37
Mar 10 2016 05:53 UTC
true @bitgrower
Marek Slabicki
@thaniri
Mar 10 2016 05:53 UTC

hello, can anyone explain this bit on an MDN page for me?
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/typeof

typeof Boolean(true) === 'boolean'; // but never use this form!
Why should we never use this example?

@roshankd
Mar 10 2016 05:53 UTC
no,
DJ
@qualitymanifest
Mar 10 2016 05:54 UTC
@roshankd your code there should pass. try refreshing the page and pasting it again
@roshankd
Mar 10 2016 05:55 UTC
after refreshing page it run.........
bitgrower
@bitgrower
Mar 10 2016 05:55 UTC
YAY!!!!
What is wrong with this code?
bigbeno37
@bigbeno37
Mar 10 2016 05:56 UTC
@thaniri I'm not an expert myself, but maybe it's because Boolean(true) is an object, rather than a primitive
function reverseString(str) {
str.split('').reverse();
return str;
}

reverseString("hello");
DJ
@qualitymanifest
Mar 10 2016 05:56 UTC
@1ety it's an array, not a string
bigbeno37
@bigbeno37
Mar 10 2016 05:56 UTC
@1ety it's returning an array for starters
DJ
@qualitymanifest
Mar 10 2016 05:57 UTC
oh yeah. need to assign. but also, you need to join back into a string
bigbeno37
@bigbeno37
Mar 10 2016 05:57 UTC
@1ety remember .join(" ")?
is .join(" ")always needed for reverse string?
DJ
@qualitymanifest
Mar 10 2016 05:59 UTC
@thaniri i don't know why you would ever want to use typeof on Boolean() since it's always going to be a boolean
Siddharth
@Sid225
Mar 10 2016 05:59 UTC
fs
help me in "profile lookup"
CamperBot
@camperbot
Mar 10 2016 05:59 UTC
no wiki entry for: me in profile lookup
DJ
@qualitymanifest
Mar 10 2016 06:00 UTC
@1ety well... split converts it to an array, so it's no longer a string. join converts it back to an string
bigbeno37
@bigbeno37
Mar 10 2016 06:00 UTC
@1ety it's always needed to join an array back into a string
@1ety but the parameter inside is up to you
the reason im asking is there are multiple ways to do it
and MDN page says i shouldnt do it in the way that is not commented
dunno why
bigbeno37
@bigbeno37
Mar 10 2016 06:01 UTC
@thaniri you could also do it like this
function boo(bool) {
if (bool){
return true;
}

return false;
}
nevermind @thaniri
Marek Slabicki
@thaniri
Mar 10 2016 06:02 UTC
yeah :P so its hard to know the "right" way
bigbeno37
@bigbeno37
Mar 10 2016 06:03 UTC
@thaniri actually this works
function boo(bool) {
if (typeof bool === "boolean"){
return true;
}

return false;
}
Siddharth
@Sid225
Mar 10 2016 06:04 UTC
function lookUp(firstName, prop){
// Only change code below this line
if((contacts.firstName)===true&& (contacts.prop)===true)
{
return contacts.prop;
}
else if((contacts.prop)!==true)
{
return "No such property";
}
else if((contacts.firstName)!==true)
{
return "No such contact";
}
// Only change code above this line
}
Ryan Stolliker
@rstolliker
Mar 10 2016 06:04 UTC
@thaniri as a challenge, try to do it in one line
Marek Slabicki
@thaniri
Mar 10 2016 06:05 UTC
i did find a solution in 1 line
Siddharth
@Sid225
Mar 10 2016 06:05 UTC
help me in this
CamperBot
@camperbot
Mar 10 2016 06:05 UTC
no wiki entry for: me in this
DJ
@qualitymanifest
Mar 10 2016 06:05 UTC
yeah mine was if bool is true or false, return true (since true and false are boolean primitives). otherwise return false
Marek Slabicki
@thaniri
Mar 10 2016 06:05 UTC
then i read the mdn page
and it told me that the 1 line solution is bad
and i dont know why
there is like 20 ways to do this solution
bigbeno37
@bigbeno37
Mar 10 2016 06:06 UTC
@thaniri found another one liner
function boo(bool) {
return typeof bool === "boolean" ? true : false;
}
essentially if typeof bool is boolean, return true, otherwise return false
Marek Slabicki
@thaniri
Mar 10 2016 06:07 UTC
perhaps i wasn't being clear in my question
still doesn't work:
Siddharth
@Sid225
Mar 10 2016 06:07 UTC
hey someone help
function reverseString(str) {
str.split('').reverse().join();
return str;
}

reverseString("hello");
Marek Slabicki
@thaniri
Mar 10 2016 06:07 UTC
i dont need help finding an answer to the freecodecamp problem, if someone knows why
typeof Boolean(true) === 'boolean'; // but never use this form!
is not good to use, i'd like to know because the mdn page doesn't say
DJ
@qualitymanifest
Mar 10 2016 06:08 UTC
just made a one liner for fun, it's longer than the others but:
function boo(bool) {

return bool === true || bool === false ? true : false;
}

boo(null);
Ryan Stolliker
@rstolliker
Mar 10 2016 06:08 UTC
@thaniri I don’t think the mdn page is saying that, it’s talking about a different form
Marek Slabicki
@thaniri
Mar 10 2016 06:08 UTC
bigbeno37
@bigbeno37
Mar 10 2016 06:08 UTC
@1ety you need to use str.split('').reverse().join('')
DJ
@qualitymanifest
Mar 10 2016 06:08 UTC
@thaniri a. stop worring about that so much. b. why would you check the type of a Boolean()? it's ALWAYS going to be a boolean
Siddharth
@Sid225
Mar 10 2016 06:08 UTC
function lookUp(firstName, prop){
// Only change code below this line
if((contacts.firstName)===true&& (contacts.prop)===true)
{
return contacts.prop;
}
else if((contacts.prop)!==true)
{
return "No such property";
}
else if((contacts.firstName)!==true)
{
return "No such contact";
}
// Only change code above this line
}
help
CamperBot
@camperbot
Mar 10 2016 06:09 UTC

Basic Commands:

• find TOPIC find all entries about topic. ex: find js
• wiki TOPIC show contents of topic page
• thanks @username send brownie points to another user
• about @username shows info on that user
• Algorithm BONFIRENAME info on a Algorithm

:speech_balloon: meet CamperBot in this room!

Ryan Stolliker
@rstolliker
Mar 10 2016 06:09 UTC
function boo(bool) { return typeof bool === “boolean”; }
Marek Slabicki
@thaniri
Mar 10 2016 06:09 UTC
thanks @qualitymanifest @bigbeno37 @rstolliker
CamperBot
@camperbot
Mar 10 2016 06:09 UTC
thaniri sends brownie points to @qualitymanifest and @bigbeno37 and @rstolliker :sparkles: :thumbsup: :sparkles:
:star: 328 | @bigbeno37 | http://www.freecodecamp.com/bigbeno37
:star: 1067 | @qualitymanifest | http://www.freecodecamp.com/qualitymanifest
:star: 248 | @rstolliker | http://www.freecodecamp.com/rstolliker
@bigbeno37 I did it, however it doesn't work
str.split('').reverse().join('')
Zach
@Moose1551
Mar 10 2016 06:11 UTC
Hello, all. Am I the only one who doesn't understand a single thing in Basic JavaScript even though I'm almost finished with the entire section?
Venutom
@Venutom
Mar 10 2016 06:11 UTC
@Moose1551 Nope. I'm right there with you
I'm stuck on the Word Blanks project
exercise thing
bigbeno37
@bigbeno37
Mar 10 2016 06:12 UTC
well, all you have to do is structure the words in a certain order
Venutom
@Venutom
Mar 10 2016 06:13 UTC
I thought I was doing that. I guess I don't know how to begin writing the code
bigbeno37
@bigbeno37
Mar 10 2016 06:14 UTC
@Venutom Here's an example
function wordBlanks(myNoun, myAdjective, myVerb, myAdverb) {
var result = "";
// Your code below this line

result+= myAdjective + " " + myNoun + " " + myVerb + " " + myAdverb;

// Your code above this line
return result;
}
Zach
@Moose1551
Mar 10 2016 06:14 UTC
@Venutom , that drove me crazy. I'm on "Accessing Nested Objects in JSON." No clue what I'm doing or how I got to this point. I really don't even know what a "string" or an "object" is. The examples provided in the instructions are nothing like what ends up coming out. Insanely frustrated.
bigbeno37
@bigbeno37
Mar 10 2016 06:14 UTC
you'll see that all I do it concatenate the parameters with the result string
someone can help me to understand what is wrong with the code?
function reverseString(str) {
str.split('').reverse().join('');
return str;
}

reverseString("hello");
Venutom
@Venutom
Mar 10 2016 06:15 UTC
@bigbeno37 I never would have figured that out. Do you have any suggestions of where else I should study to understand?
@bigbeno37 thank you so much for your help. @Moose1551 Don't fret. You're not alone.
CamperBot
@camperbot
Mar 10 2016 06:15 UTC
venutom sends brownie points to @bigbeno37 and @moose1551 :sparkles: :thumbsup: :sparkles:
:star: 329 | @bigbeno37 | http://www.freecodecamp.com/bigbeno37
:star: 219 | @moose1551 | http://www.freecodecamp.com/moose1551
bigbeno37
@bigbeno37
Mar 10 2016 06:16 UTC
@Venutom unfortunately, no. I came to FCC already having experienced some programming before, so my solution was obvious to me
cannelflow
@cannelflow
Mar 10 2016 06:16 UTC
@1ety which exercise?
Reverse a String
bigbeno37
@bigbeno37
Mar 10 2016 06:17 UTC
you're gonna be so mad @1ety
function reverseString(str) {
return str.split('').reverse().join('');
}
That's literally it
DJ
@qualitymanifest
Mar 10 2016 06:17 UTC
or
str = str.split('').reverse().join('');
bigbeno37
@bigbeno37
Mar 10 2016 06:18 UTC
See, what you did was return the 'str' parameter that was passed in
exactly as it was passed in
DJ
@qualitymanifest
Mar 10 2016 06:18 UTC
str.split('').reverse().join(''); does nothing to str, by itself. it wants to return a value. you can either return that value from your function, or assign it back to str.
bigbeno37
@bigbeno37
Mar 10 2016 06:19 UTC
@1ety exactly as @qualitymanifest said
which is why it works being put after the return
Zach
@Moose1551
Mar 10 2016 06:25 UTC
Is this not dot and bracket notation accessing myStorage?
myStorage.car.inside["glove box"];
Than you @bigbeno37 and @qualitymanifest
Venutom
@Venutom
Mar 10 2016 06:27 UTC
@Moose1551 here is a free javascript book series for beginners on github. The ebooks are free at least. Scroll down to under "read me" and you'll see the series. Wish I could help you more. https://github.com/getify/You-Dont-Know-JS
Zach
@Moose1551
Mar 10 2016 06:27 UTC
@Venutom , thanks.
CamperBot
@camperbot
Mar 10 2016 06:27 UTC
moose1551 sends brownie points to @venutom :sparkles: :thumbsup: :sparkles:
:star: 168 | @venutom | http://www.freecodecamp.com/venutom
Stefan Gisi
@stgisi
Mar 10 2016 06:28 UTC
Hello all, I have a quick question about the Sum All Primes challenge.
In the instructions, it states that the provided number may not be a prime.
However, one of the requirements to pass the challenge is to pass a prime number in the subPrimes function
Markus Kiili
@Masd925
Mar 10 2016 06:29 UTC
@Moose1551 The dot notation only works if the property key string is a valid JS identifier (for example "12" and "lives left" are not) and you write the key after the dot: var cat={clothes:"pants", "lives left":3}; cat.clothes; //returns "pants". Bracket notation works with keys that can be arbitrary strings cat["lives left"]; //returns 3, variables var key="clothes"; cat[key]; //returns "pants", or expressions cat["lives"+" "+"left"]; //returns 3.
Stefan Gisi
@stgisi
Mar 10 2016 06:29 UTC
sumPrimes(977) should return 73156.
977 is a prime number
Markus Kiili
@Masd925
Mar 10 2016 06:31 UTC
@stgisi The argument is a limit. It can be a prime.
Stefan Gisi
@stgisi
Mar 10 2016 06:32 UTC
@MAsd925 I'm not following... Sorry.
@Masd925 I understand that I can physically type in a prime number and make it the argument of the function... but,
Zach
@Moose1551
Mar 10 2016 06:33 UTC

@Masd925 , why is FCC providing this example? I followed the same setup, but it doesn't work.

ourStorage.cabinet["top drawer"].folder2;

Markus Kiili
@Masd925
Mar 10 2016 06:34 UTC
@stgisi You are supposed to find all prime numbers up to the given limit num, and calculate the sum of them. The limit itself can be a prime or not.
Stefan Gisi
@stgisi
Mar 10 2016 06:34 UTC
@Masd925 I understand... maybe it was a typo, but in the instructions it clearly states "The provided number may not be a prime."
@Masd925 Thanks for the info though.
CamperBot
@camperbot
Mar 10 2016 06:34 UTC
stgisi sends brownie points to @masd925 :sparkles: :thumbsup: :sparkles:
:star: 1149 | @masd925 | http://www.freecodecamp.com/masd925
Stefan Gisi
@stgisi
Mar 10 2016 06:35 UTC
@Masd925 I'll keep trying~
Shailesh Kumar
@sksundram
Mar 10 2016 06:36 UTC
what is carriage return?
Markus Kiili
@Masd925
Mar 10 2016 06:38 UTC
@stgisi The number you pass into the function can be any number, prime or not. If you pass 10 (not a prime), your function should find the primes up to 10: 2,3,5,7 and sum them and return 17. If you pass 11 (prime) the primes up to 11 are: 2,3,5,7,11 and return should be 28.
@stgisi "May not" here means that it can be a prime or not.
Stefan Gisi
@stgisi
Mar 10 2016 06:40 UTC
@Masd925 Hahaha, maybe I should give up programming and start studying English again x.x
@Masd925 But after re-reading it now I see what you mean. Thanks!
CamperBot
@camperbot
Mar 10 2016 06:41 UTC
stgisi sends brownie points to @masd925 :sparkles: :thumbsup: :sparkles:
:warning: stgisi already gave masd925 points
Markus Kiili
@Masd925
Mar 10 2016 06:41 UTC
@stgisi Stoopid language.
Lucas Pentinsaari
@Dreameh
Mar 10 2016 06:41 UTC
:|
Stefan Gisi
@stgisi
Mar 10 2016 06:42 UTC
Arggghhhh... this one is so freaking difficult. afk...
Lucas Pentinsaari
@Dreameh
Mar 10 2016 06:44 UTC
in Accessing nested arrays in JSON, should the answer be something like this var secondTree = myPlants.trees[1].list;
or am I totally wrong?
Zach
@Moose1551
Mar 10 2016 06:51 UTC
Am I not using dot and bracket notation to access my storage? The idea of head butting my desk sounds really appealing right now.
// Setup
var myStorage = {
"car": {
"inside": {
"glove box": "maps",
"passenger seat": "crumbs"
},
"outside": {
"trunk": "jack"
}
}
};

// Only change code below this line

myStorage.car.inside["glove box"];
Shailesh Kumar
@sksundram
Mar 10 2016 06:52 UTC
var testString = "How many non-space characters are there in this sentence?";
var expression = /\S/g;  // returns 49
var expression = /\S+/g; // returns 9
Zach
@Moose1551
Mar 10 2016 06:52 UTC
There are both dots and brackets. And "gloveBoxContents = maps" on the test
Shailesh Kumar
@sksundram
Mar 10 2016 06:52 UTC
what does the + sign do?
anybody?
Mar 10 2016 06:55 UTC
hey everyone, I'm just about finished with the Weather App Zipline. There has been one thing that I've put off dealing with because I'm frankly at a loss of what to do about it. So, I'm querying the openweathermap.org API using the latitude and longitude from the DOM. I'm then getting the city name from the JSON response. Now, I'm in a Chicago zip code, but the city name being returned is Birchwood...? If I drop a pen on google maps on my current location, the lat and lon coords match those I'm getting from the DOM. But, there is no Birchwood nearby of any significance. Does anyone have some light for me???
Marina
@chandra90
Mar 10 2016 06:55 UTC
Hello! What am I doing wrong?
This message was deleted
Suprith Aireddy
@sup-rith
Mar 10 2016 06:55 UTC
@chs
@chandra90 what is the challenge called?
@chandra90 also post your code here
Marina
@chandra90
Mar 10 2016 06:56 UTC
  var lookap = {
"bravo": "Boston",
"charlie": "Chicago",
"delta": "Denver",
"echo": "Easy",
"foxtrot": "Frank"
};

return lookap[val];
}
@sup-rith Using Objects for Lookups
Suprith Aireddy
@sup-rith
Mar 10 2016 06:57 UTC
@chandra90 what did the challenge ask you to do?
Marina
@chandra90
Mar 10 2016 06:57 UTC
@sup-rith "Convert the switch statement into a lookup table called lookup. Use it to lookup val and assign the associated string to the result variable."
Suprith Aireddy
@sup-rith
Mar 10 2016 06:58 UTC
oh okay! you have to set lookap[val] = to result
Marina
@chandra90
Mar 10 2016 06:59 UTC
@sup-rith but the problem is
// Only change code above this line
return result;
Abhishek Kumar
@abhishekKumar1
Mar 10 2016 06:59 UTC
@chandra90 you can't change the lines which ar nor supposed to be changed
Marina
@chandra90
Mar 10 2016 07:00 UTC
@abhishekKumar1 I am telling the same
Abhishek Kumar
@abhishekKumar1
Mar 10 2016 07:00 UTC
you have to get a value to result and return it
Suprith Aireddy
@sup-rith
Mar 10 2016 07:00 UTC
@chandra90 type this in result = lookap[val]
Richard
@rick104
Mar 10 2016 07:00 UTC
can someone help me with the answer to Local Scope and Functions
Abhishek Kumar
@abhishekKumar1
Mar 10 2016 07:00 UTC
so ude result= something
Suprith Aireddy
@sup-rith
Mar 10 2016 07:01 UTC
then return result @chandra90
Abhishek Kumar
@abhishekKumar1
Mar 10 2016 07:01 UTC
help scope
CamperBot
@camperbot
Mar 10 2016 07:01 UTC

Challenge: Global Scope and Functions

In JavaScript, scope refers to the visibility of variables. Variables which are defined outside of a function block have Global scope. This means, they can be seen everywhere in your JavaScript code.

Variables which are used without the var keyword are automatically created in the global scope. This can create unintended consequences elsewhere in your code or when running a function again. You should always declare your variables with var.
:pencil: read more about challenge global scope and functions on the FCC Wiki

Abhishek Kumar
@abhishekKumar1
Mar 10 2016 07:01 UTC
@rick104 fou u ^^^
Suprith Aireddy
@sup-rith
Mar 10 2016 07:01 UTC
help chunky monkey
CamperBot
@camperbot
Mar 10 2016 07:01 UTC
no wiki entry for: chunky monkey
Shailesh Kumar
@sksundram
Mar 10 2016 07:01 UTC
lol
Suprith Aireddy
@sup-rith
Mar 10 2016 07:02 UTC
has anyone finished the chunky monkey challenge?
Marina
@chandra90
Mar 10 2016 07:02 UTC
@sup-rith 
 var lookap = {
"bravo": "Boston",
"charlie": "Chicago",
"delta": "Denver",
"echo": "Easy",
"foxtrot": "Frank"
};
result = lookap[val];
}
Abhishek Kumar
@abhishekKumar1
Mar 10 2016 07:02 UTC
loose the last "}"
Suprith Aireddy
@sup-rith
Mar 10 2016 07:02 UTC
@chandra90 there you go, now return result;
Marina
@chandra90
Mar 10 2016 07:02 UTC
@abhishekKumar1 where????
Abhishek Kumar
@abhishekKumar1
Mar 10 2016 07:03 UTC
last one "}" it will end the function before returning
Vantrav
@vantrav
Mar 10 2016 07:03 UTC

@sksundram

what does the + sign do?

http://regexone.com/lesson/kleene_operators

Suprith Aireddy
@sup-rith
Mar 10 2016 07:03 UTC
  var lookap = {
"bravo": "Boston",
"charlie": "Chicago",
"delta": "Denver",
"echo": "Easy",
"foxtrot": "Frank"
};

result = lookap[val];
@chandra90 ^^
Marina
@chandra90
Mar 10 2016 07:05 UTC
@sup-rith meow?
still the same
Abhishek Kumar
@abhishekKumar1
Mar 10 2016 07:05 UTC
@chandra90
// Setup
function phoneticLookup(val) {
var result = "";

// Only change code below this line
var lookup = {
"bravo":"Boston",
"charlie":"Chicago",
"delta":"Denver",
"echo":"Easy",
"foxtrot":"Frank"
};

result=lookup[val];

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

// Change this value to test
var result = "alpha";
phoneticLookup(result);
Suprith Aireddy
@sup-rith
Mar 10 2016 07:05 UTC
PM me ill look at it closly @chandra90
Marina
@chandra90
Mar 10 2016 07:06 UTC
@sup-rith now works thanks, friend.
CamperBot
@camperbot
Mar 10 2016 07:06 UTC
chandra90 sends brownie points to @sup-rith :sparkles: :thumbsup: :sparkles:
:star: 268 | @sup-rith | http://www.freecodecamp.com/sup-rith
Marina
@chandra90
Mar 10 2016 07:06 UTC
@abhishekKumar1 thank you
@abhishekKumar1 thanks
CamperBot
@camperbot
Mar 10 2016 07:06 UTC
chandra90 sends brownie points to @abhishekkumar1 :sparkles: :thumbsup: :sparkles:
:star: 375 | @abhishekkumar1 | http://www.freecodecamp.com/abhishekkumar1
Ahtesham Ul Haq
@Ahtesham1234
Mar 10 2016 07:21 UTC

// Initialize these three variables
var a = 5;
var b= 10;
var c = "i am a ";
// Do not change code below this line

a = a + 1;
b = b + 5;
c = c +" String!";

How to solve c;
Marina
@chandra90
Mar 10 2016 07:22 UTC
@Ahtesham1234 what challenge is it?
Ahtesham Ul Haq
@Ahtesham1234
Mar 10 2016 07:22 UTC
Java Script 4th or 5th.
@chandra90 Java Script 4th or 5th
Marina
@chandra90
Mar 10 2016 07:23 UTC
@Ahtesham1234 can you copy the title from left?
Suprith Aireddy
@sup-rith
Mar 10 2016 07:23 UTC
@Ahtesham1234 what do you need help on?
rphares
@rphares
Mar 10 2016 07:24 UTC
@chandra90 lookup
not lookap
Ahtesham Ul Haq
@Ahtesham1234
Mar 10 2016 07:25 UTC
@sup-rith @chandra90 var c,need to print "i am a string ". but its saying only "i am a"
@sup-rith @chandra90 Understanding Uninitialized Variables (challenge name)
Marina
@chandra90
Mar 10 2016 07:26 UTC
@sup-rith please check my syntax here
Suprith Aireddy
@sup-rith
Mar 10 2016 07:26 UTC
@Ahtesham1234 remove the space after am
rphares
@rphares
Mar 10 2016 07:26 UTC
did you change above the line? @Ahtesham1234
Suprith Aireddy
@sup-rith
Mar 10 2016 07:26 UTC
it should be var c = "i am a"; not var c = "i am a ";
Marina
@chandra90
Mar 10 2016 07:27 UTC
var myObj = {
pet: "kitten",
bed: "sleigh"
};

function checkObj(checkProp) {
if(myObj.hasOwnProperty(checkProp))
return myObj[checkProp];
}else return"Not found"
And I will help to Ahtesham
rphares
@rphares
Mar 10 2016 07:27 UTC
the space and the lowercase dont match what was given to me at the start... "I am a" , not "i am a "
@chandra90 , you have a spelling mistake-- should be lookup not lookap
Marina
@chandra90
Mar 10 2016 07:28 UTC
@rphares Now I am doing another challenge
Suprith Aireddy
@sup-rith
Mar 10 2016 07:28 UTC
@chandra90 do you need help?
Marina
@chandra90
Mar 10 2016 07:28 UTC
@sup-rith yes
rphares
@rphares
Mar 10 2016 07:28 UTC
ahh-- else {}
Ahtesham Ul Haq
@Ahtesham1234
Mar 10 2016 07:29 UTC
@sup-rith @chandra90 @rphares c should not contain undefined and should have a value of "I am a String!"
rphares
@rphares
Mar 10 2016 07:29 UTC
yes-- look at what you have for c, up top--
Ahtesham Ul Haq
@Ahtesham1234
Mar 10 2016 07:29 UTC
@sup-rith space not working
rphares
@rphares
Mar 10 2016 07:29 UTC
you have "i am a "
it was originally "I am a"
Suprith Aireddy
@sup-rith
Mar 10 2016 07:29 UTC
@chandra90 its a simple formatting error.
var myObj = {
pet: "kitten",
bed: "sleigh"
};

function checkObj(checkProp) {
if(myObj.hasOwnProperty(checkProp))
return myObj[checkProp];
}else return"Not found"
put the else behind the loop and put a semicolon after the return
rphares
@rphares
Mar 10 2016 07:30 UTC
with the lower case in the first part, you can never make that sentence with a simple +... @Ahtesham1234
(also capitalise Found...) @chandra90
Ahtesham Ul Haq
@Ahtesham1234
Mar 10 2016 07:32 UTC
@rphares @sup-rith @chandra90 Thanks guys ,solve it .I am stupid typing lower case "i".
CamperBot
@camperbot
Mar 10 2016 07:32 UTC
ahtesham1234 sends brownie points to @rphares and @sup-rith and @chandra90 :sparkles: :thumbsup: :sparkles:
:star: 269 | @sup-rith | http://www.freecodecamp.com/sup-rith
:star: 3166 | @rphares | http://www.freecodecamp.com/rphares
:star: 230 | @chandra90 | http://www.freecodecamp.com/chandra90
rphares
@rphares
Mar 10 2016 07:32 UTC
Anytime~ And you aren't stupid, happens all the time :blush: Happy coding!
Ahtesham Ul Haq
@Ahtesham1234
Mar 10 2016 07:33 UTC
@rphares :)
Suprith Aireddy
@sup-rith
Mar 10 2016 07:33 UTC
@rphares have you done the chunky monkey algorithm challenge?
rphares
@rphares
Mar 10 2016 07:33 UTC
i have, but ages ago and I'm terrible at helping on BFs...
i dont see many active ppl in here atm, the main room might be more helpful if you dont get a response here :pensive:
Suprith Aireddy
@sup-rith
Mar 10 2016 07:34 UTC
oh and quick question, what do bonfire challenges mean?
Where does it come from lol?
Marina
@chandra90
Mar 10 2016 07:34 UTC
@sup-rith Halloween lol?
rphares
@rphares
Mar 10 2016 07:34 UTC
oooh, lol, its very old--
the algorithm challenges used to be called bonfires,
so those of us who were on FCC before they changed the names,
Suprith Aireddy
@sup-rith
Mar 10 2016 07:34 UTC
Oh okay makes sense now
rphares
@rphares
Mar 10 2016 07:34 UTC
often still say that, so sorry for the confusion!
Suprith Aireddy
@sup-rith
Mar 10 2016 07:35 UTC
lol its okay
@rphares how far are you?
@chandra90 halloween? haha
rphares
@rphares
Mar 10 2016 07:35 UTC
not too far :) still wrapping up front end projects, but honestly more focused on books atm
Marina
@chandra90
Mar 10 2016 07:36 UTC
@sup-rith poor my brain
Suprith Aireddy
@sup-rith
Mar 10 2016 07:36 UTC
@rphares interesting, what books?
rphares
@rphares
Mar 10 2016 07:36 UTC
(I've been moving countries for the last two months and have slowed quite a bit :blush: )
a huge stack of JS ones,
the ebooks recommended i also do-- especially YDKJS, but eloquent is also good,
Marina
@chandra90
Mar 10 2016 07:37 UTC
  if(myObj.hasOwnProperty(checkProp))
return myObj[checkProp];
}else return"Not found";
rphares
@rphares
Mar 10 2016 07:37 UTC
me personally, i got a stack of old school text books,
to start, please capitalise Found
in the directions, you are meant to return "Not Found" , i think...
Marina
@chandra90
Mar 10 2016 07:37 UTC
@rphares did it
kirbyedy
@kirbyedy
Mar 10 2016 07:38 UTC
rphares
@rphares
Mar 10 2016 07:38 UTC
Yay!
its on lithium, @kirbyedy ~
Michael Botes
@MichaelFF
Mar 10 2016 07:39 UTC
Hey Guys, I'm Stuck on "Record Collection", the javascript section, function update(id, prop, value) {
if (value !== " " && prop !== "tracks") {
collection[id][prop] = value;
} else if (prop == "tracks") {
collection[id].tracks.push(value);
}
return collection;
}
rphares
@rphares
Mar 10 2016 07:39 UTC
(and WB! and nice pic!!)
Michael Botes
@MichaelFF
Mar 10 2016 07:39 UTC
can anyone tell me if i'm on the right path
kirbyedy
@kirbyedy
Mar 10 2016 07:39 UTC
:thumbsup:
Marina
@chandra90
Mar 10 2016 07:39 UTC
@rphares where do you see other errors( not including Found)?
Michael Botes
@MichaelFF
Mar 10 2016 07:39 UTC
function update(id, prop, value) {
if (value !== " " && prop !== "tracks") {
collection[id][prop] = value;
} else if (prop == "tracks") {
collection[id].tracks.push(value);
}
return collection;
}
kirbyedy
@kirbyedy
Mar 10 2016 07:40 UTC
lithium ? Im just getting some drug results :D
Suprith Aireddy
@sup-rith
Mar 10 2016 07:40 UTC
@MichaelFF use bracket notatio
Michael Botes
@MichaelFF
Mar 10 2016 07:40 UTC
collection[id][tracks].push(value); ?
Suprith Aireddy
@sup-rith
Mar 10 2016 07:41 UTC
yes try that.
rphares
@rphares
Mar 10 2016 07:41 UTC
Michael Botes
@MichaelFF
Mar 10 2016 07:42 UTC
think i dc'd
Marina
@chandra90
Mar 10 2016 07:42 UTC
if(myObj.hasOwnProperty(checkProp))
return myObj[checkProp];
} {else
}
rphares
@rphares
Mar 10 2016 07:42 UTC
your if (condition) {do } else {do}is not quite right...
This message was deleted
Nickolas Gettel
Mar 10 2016 07:43 UTC
Hey guys, i'm trying to do the "exact change' advanced algorithm. I pass every test except one, where the expected answer is 96.74 and i'm 1 penny short. Can I get any help?
DJ
@qualitymanifest
Mar 10 2016 07:43 UTC
no promises but i'll take a look :wink2:
Nickolas Gettel
Mar 10 2016 07:44 UTC
function drawer(price, cash, cid) {
var change = cash - price;
var account = [];
var money = [
{ name: 'ONE HUNDRED', val: 100.00},
{ name: 'TWENTY', val: 20.00},
{ name: 'TEN', val: 10.00},
{ name: 'FIVE', val: 5.00},
{ name: 'ONE', val: 1.00},
{ name: 'QUARTER', val: 0.25},
{ name: 'DIME', val: 0.10},
{ name: 'NICKEL', val: 0.05},
{ name: 'PENNY', val: 0.01}
];

function totalout(acct, money){
acct.float += money[1] * 100;     //convert money amount to coins * 100
acct[money[0]] = money[1];        //assign value to account[denomination]
acct.total = acct.float / 100;    //convert money from coins back to 100th decimal
return acct;
}

var til = cid.reduce(totalout,{float: 0}); //reduce CID array into total into an object of bills, including the total amount in drawer.

if(change > til.total){    //check money in the til against change due
return "Insufficient Funds";
} else if(change == til.total){
return "Closed";
}

//if funds in til are more than change due- count back change due
var countback = money.reduce(function(bill,amnt){
var purse = 0;
while(til[amnt.name] >= amnt.val  && change >= amnt.val){
til[amnt.name] -= amnt.val; //subtract denomination value from til
purse += amnt.val;          //add denomination value to purse
change -= amnt.val;         //subtract denomination value from 'change' due

}
if(purse > 0){
purse = purse * 100;   //convert money amount to coins * 100
account.push([amnt.name, purse / 100]);//add denomination and value into account array
}
return account;
}, []);

var accttotal = account.reduce(totalout, {float: 0});

if(account.length < 1 || accttotal.total != change && change > 0){ //if no money in account, or change due isnt equal to account total
return "Insufficient Funds";
}

return countback;

// Here is your change, ma'am.

}

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

drawer(3.26, 100.00, [["PENNY", 1.01], ["NICKEL", 2.05], ["DIME", 3.10], ["QUARTER", 4.25], ["ONE", 90.00], ["FIVE", 55.00], ["TEN", 20.00], ["TWENTY", 60.00], ["ONE HUNDRED", 100.00]]);
rphares
@rphares
Mar 10 2016 07:44 UTC
( @qualitymanifest !! :blush: So happy to see ya!!)
Nickolas Gettel
Mar 10 2016 07:45 UTC
Its supposed to return an array of denominations and their value, totaling 96.74 but I come up with 96.73 :/
DJ
@qualitymanifest
Mar 10 2016 07:45 UTC
@rphares hi hi
kirbyedy
@kirbyedy
Mar 10 2016 07:46 UTC
Michael Botes
@MichaelFF
Mar 10 2016 07:46 UTC
dumb question, how do you paste your code as markup ? like the above example?
Nickolas Gettel
Mar 10 2016 07:46 UTC
wiki code
CamperBot
@camperbot
Mar 10 2016 07:46 UTC

Learn how to plan your future project!

Blog post written by BiancaMihai - GitHub / Twitter

An ounce of preparation is worth a pound of cure. That's true in medicine, and that's definitely true in software development.

Here's a structured 10-step workflow that will guide you through the app planning process, with the goal of saving you from writing a lot of unnecessary code.

Together, we'll plan out a simple "To-do" single-page web app. We'll also plan for an API backend for a future mobile app.

Nickolas Gettel
Mar 10 2016 07:46 UTC
encapsulate your code with 
kirbyedy
@kirbyedy
Mar 10 2016 07:46 UTC
3x + your code + 3x
shit
Nickolas Gettel
Mar 10 2016 07:46 UTC
so code here
Markus Kiili
@Masd925
Mar 10 2016 07:46 UTC
@nickolaskg Rounding error most likely. You can use integers (pennies) on all calculations or introduce some accuracy like lambda=0.0000001 that you use on some comparisons.
kirbyedy
@kirbyedy
Mar 10 2016 07:46 UTC
lol
Nickolas Gettel
Mar 10 2016 07:46 UTC
lol oops
kirbyedy
@kirbyedy
Mar 10 2016 07:46 UTC

3x 
Nickolas Gettel
Mar 10 2016 07:47 UTC
wiki
CamperBot
@camperbot
Mar 10 2016 07:47 UTC
usage:
wiki \$topic info on that topic
rphares
@rphares
Mar 10 2016 07:47 UTC
Nickolas Gettel
Mar 10 2016 07:47 UTC
@Masd925 Yeah, I was figuring as much, but couldnt nail it down.
Michael Botes
@MichaelFF
Mar 10 2016 07:47 UTC
ill check wiki :)
kirbyedy
@kirbyedy
Mar 10 2016 07:47 UTC
@rphares tax you
CamperBot
@camperbot
Mar 10 2016 07:47 UTC
kirbyedy sends brownie points to @rphares :sparkles: :thumbsup: :sparkles:
:star: 3167 | @rphares | http://www.freecodecamp.com/rphares
Marina
@chandra90
Mar 10 2016 07:48 UTC
@rphares I still did not get it((
rphares
@rphares
Mar 10 2016 07:48 UTC
awww, tank you for the unnecessary brownies, @kirbyedy ~
CamperBot
@camperbot
Mar 10 2016 07:48 UTC
rphares sends brownie points to @kirbyedy :sparkles: :thumbsup: :sparkles:
:star: 636 | @kirbyedy | http://www.freecodecamp.com/kirbyedy
Michael Botes
@MichaelFF
Mar 10 2016 07:49 UTC
function update(id, prop, value) { if (value !== " " && prop !== "tracks") { collection[id][prop] = value; } else if (prop == "tracks") { collection[id][prop].push(value); } return collection; }
rphares
@rphares
Mar 10 2016 07:50 UTC
@chandra90 , example:
if (this condition) {return something;}
else {return anotherThing;}
Michael Botes
@MichaelFF
Mar 10 2016 07:50 UTC
that didnt go as planned :D
Nickolas Gettel
Mar 10 2016 07:50 UTC
wiki format
CamperBot
@camperbot
Mar 10 2016 07:50 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 the code.

See also: ☛ How to type Backticks | ☯ Compose Mode | ❄ Gitter Formatting Basics

Nickolas Gettel
Mar 10 2016 07:50 UTC
The funny thing with the Exact Change challenge is, the solution on github does not work.
DJ
@qualitymanifest
Mar 10 2016 07:51 UTC
@nickolaskg yeah, i'm still checking this out but i didn't use .reduce so it's a different approach to me. i used a while loop nested in a for loop. no idea as to how efficient it was, probably not very, but the code was short ¯\(ツ)
Nickolas Gettel
Mar 10 2016 07:52 UTC
Actullay now the solution works, my bad. But I still can't figure it out lol
Mas hary
@mas212
Mar 10 2016 07:52 UTC
You should use the += operator for each variable ??
DJ
@qualitymanifest
Mar 10 2016 07:52 UTC
Nickolas Gettel
Mar 10 2016 07:53 UTC
@qualitymanifest Yeah, I am only using reduce because i'm not good with it. Wanted to learn more about it.
@qualitymanifest The solution on the wiki works I should have said
Mine doesnt yet.
Mas hary
@mas212
Mar 10 2016 07:53 UTC
@nickolaskg You should use the += operator for each variable
Michael Botes
@MichaelFF
Mar 10 2016 07:53 UTC
function update(id, prop, value) {
if (value !== " " && prop !== "tracks") {
collection[id][prop] = value;
} else if (prop == "tracks") {
collection[id][prop].push(value);
}
return collection;
}
DJ
@qualitymanifest
Mar 10 2016 07:53 UTC
@nickolaskg same. .filter i am very comfortable with. .reduce makes sense to me for math, for other reasons though, i don't get it
Nickolas Gettel
Mar 10 2016 07:54 UTC
@mas212 I thought I was using it where it needed to be.
Michael Botes
@MichaelFF
Mar 10 2016 07:54 UTC
finally :D, So yeha i am doing the record collection http://www.freecodecamp.com/challenges/record-collection, and I'm struggling here :D
The code snippet above is what I have so far, getting two checks.
rphares
@rphares
Mar 10 2016 07:55 UTC
@MichaelFF , you are really close...
wheres the delete part?
( "If value is blank, delete that prop." )
Nickolas Gettel
Mar 10 2016 07:55 UTC
Well, I appreciate any feedback, thanks for checking it out @qualitymanifest . I do have to get ready for work now, gotta be in at 330am :( But if you come accross a solution to my problem, just tag me an i'll check it later.
CamperBot
@camperbot
Mar 10 2016 07:55 UTC
nickolaskg sends brownie points to @qualitymanifest :sparkles: :thumbsup: :sparkles:
:star: 1068 | @qualitymanifest | http://www.freecodecamp.com/qualitymanifest
Nickolas Gettel
Mar 10 2016 07:55 UTC
See ya later!
Michael Botes
@MichaelFF
Mar 10 2016 07:55 UTC
. . . never read that :D
rphares
@rphares
Mar 10 2016 07:56 UTC
:)
Michael Botes
@MichaelFF
Mar 10 2016 07:56 UTC
watch this space . . .
Mas hary
@mas212
Mar 10 2016 08:00 UTC

var a = 3;
var b = 17;
var c = 12;
var x = 5;
// Only modify code below this line

a = a + 12;
b = 9 + b;
c = c + 7;
x += 5;

You should use the += operator for each variable ???

Emil Aasa
@emilaasa
Mar 10 2016 08:01 UTC
This message was deleted
This message was deleted
its x += 5 == x = x + 5
so x += y is just a shorter way of writing x = x + y
Stefan Gisi
@stgisi
Mar 10 2016 08:02 UTC
wiki smallest common
CamperBot
@camperbot
Mar 10 2016 08:02 UTC

Explanation:

The smallest common multiple between two numbers is the smallest number that
both numbers can divide into. This concept can be extended to more than two
numbers as well.

We can first start with just finding the smallest common multiple between two
numbers. Naively, you can start writing out multiple of each number until you
write a multiple that exists from both numbers.

An example would be the numbers 3 and 4. The multiples of 3 are 3, 6, 9, 12, 15, 18, ... and the multiples of 4 are 4, 8, 12, 16, 20, .... The
first smallest number we run into in both lists is 12 so this is the smallest
common multiple between 3 and 4.

This problem can be confusing because most people look for the smallest common
multiple of just the two numbers but forget the keyword range. However, this
means that if you are given [1,5], then you have to check for the smallest
common multiple for all the numbers [1,2,3,4,5] that is evenly divisible by
all of them.

Mas hary
@mas212
Mar 10 2016 08:03 UTC
@emilaasa this intro : to add 5 to myVar. Since this is such a common pattern, there are operators which do both a mathematical operation and assignment in one step
and problem code --> You should use the += operator for each variable
??
Emil Aasa
@emilaasa
Mar 10 2016 08:04 UTC
Mas hary
@mas212
Mar 10 2016 08:05 UTC
yach basic js ??
Emil Aasa
@emilaasa
Mar 10 2016 08:06 UTC
Sorry I don’t really understand your questions?
Mas hary
@mas212
Mar 10 2016 08:09 UTC
@emilaasa what is at this point of the question ---> You should use the += operator for each variable ??
Emil Aasa
@emilaasa
Mar 10 2016 08:09 UTC
Ah
Mas hary
@mas212
Mar 10 2016 08:09 UTC
Assignment with Plus Equals
Emil Aasa
@emilaasa
Mar 10 2016 08:09 UTC
It looks like the exercise is just to replace the instances of a = a + 12;
b = 9 + b;
c = c + 7;
with the a += 12 operator
so replacing a = a + 12 with a += 12 and so on
Coy Sanders
@coymeetsworld
Mar 10 2016 08:11 UTC
its just a shorter way of doing the same computation, and thus its better :)
Emil Aasa
@emilaasa
Mar 10 2016 08:11 UTC
Would have to say that it is sometimes better to write out the whole thing
can be more readable and so on
Coy Sanders
@coymeetsworld
Mar 10 2016 08:15 UTC
I think having something shorter is more readable
if you can code something in 10 lines why do it in 15?
makes it harder for you and others to review
Emil Aasa
@emilaasa
Mar 10 2016 08:17 UTC
up to a point yeah
Markus Kiili
@Masd925
Mar 10 2016 08:18 UTC
@coymeetsworld Shorter is easier to read but not necessarily easier to understand. Depends on the code.
Emil Aasa
@emilaasa
Mar 10 2016 08:18 UTC
Im working on some code now that is a simulator for a factory and there is a bunch of time calculactions there
some expressions read pretty strange when ppl try to shorten things too much
Coy Sanders
@coymeetsworld
Mar 10 2016 08:19 UTC
right @Masd925, like Einstein's quote, make something simple as possible but not any simpler
Emil Aasa
@emilaasa
Mar 10 2016 08:19 UTC
time += (state.carWashQueue.get(0)[0] - t);
gg
:D
Coy Sanders
@coymeetsworld
Mar 10 2016 08:19 UTC
don't make it so obscure to the point you're trying to use less characters, people still need to read it
Emil Aasa
@emilaasa
Mar 10 2016 08:19 UTC
these are the things that make me want to murder my classmates
Markus Kiili
@Masd925
Mar 10 2016 08:19 UTC
Ternary operator is a good example. Makes code shorter but usually less understandable.
Coy Sanders
@coymeetsworld
Mar 10 2016 08:20 UTC
yeah completely agree
Emil Aasa
@emilaasa
Mar 10 2016 08:20 UTC
I think we are all in jolly agreement!
Coy Sanders
@coymeetsworld
Mar 10 2016 08:20 UTC
but as long as you understand it thats probably good
and if people are going to review your code you would like them to be at least on that level too i would think, unless of course you're trying to teach them :)
yes we are all jolly lol
Emil Aasa
@emilaasa
Mar 10 2016 08:21 UTC
I read some code from the place I’m going to be working on this summer, and it was actually pretty well written
I like when you can read it in like one level of abstraction at a time
Nguyen Quoc Dai Le
@dailepro
Mar 10 2016 08:21 UTC
i need help in challenge "Counting Card" :(
Emil Aasa
@emilaasa
Mar 10 2016 08:21 UTC
@princele shoot!
cannelflow
@cannelflow
Mar 10 2016 08:21 UTC
@princele tried something?
Casey Heath
@ExhibitArts
Mar 10 2016 08:23 UTC
What do you think of this? - https://www.youtube.com/watch?v=k3THvhg9jBo
cannelflow
@cannelflow
Mar 10 2016 08:25 UTC
@princele you can use switch/if-else
Emil Aasa
@emilaasa
Mar 10 2016 08:25 UTC
@ExhibitArts that it does not belong in an HelpJavaScript channel
Casey Heath
@ExhibitArts
Mar 10 2016 08:26 UTC
@emilaasa ;)
Nguyen Quoc Dai Le
@dailepro
Mar 10 2016 08:26 UTC
i am trying :)
@cannelflow i don't think swith / if-else can do this :(
cannelflow
@cannelflow
Mar 10 2016 08:32 UTC
@princele you can use either switch or if else not both
like
@princele
switch(val){
case 2:
case 3:
count ++
}
Nguyen Quoc Dai Le
@dailepro
Mar 10 2016 08:34 UTC
It's does't work :

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

}

cannelflow
@cannelflow
Mar 10 2016 08:36 UTC
@princele now you need if else
for count
like if count>0 return "5 Bet"
if count<0 "-3 Hold"
Nguyen Quoc Dai Le
@dailepro
Mar 10 2016 08:40 UTC
ok. I got it. Thank you so much.! :)
@harryac07
Mar 10 2016 08:52 UTC
could anyone can help me iterating through multidemnsional array to return array with maximum number. I have been trying since few days but couldn't succeed.
the problem:Return Largest Numbers in Arrays
need hints or something like that. Thanks alot
DJ
@qualitymanifest
Mar 10 2016 08:53 UTC
@harryac07 paste the code you've tried
Robert Uivarosi
@URobert
Mar 10 2016 08:56 UTC
@harryac07 show us what you have so far
@harryac07
Mar 10 2016 09:01 UTC
function largestOfFour(arr) {
// You can do this!
var i;
var array=[];
var array2=[];
for(i=0;i<arr.length;i++){
array=arr[i];
for(j=0;j<array.length;j++){
array2=array[j];

}
}
return Math.max.apply(array2,array);
//return array2;
}

largestOfFour([[4, 5, 1, 3], [13, 27, 18, 26], [32, 35, 37, 39], [1000, 1001, 857, 1]]);
it returns maximum number
Mas hary
@mas212
Mar 10 2016 09:01 UTC
myStr should have a value of This is the start. This is the end.
var myStr = "This is the start." + "This is the end.";
@harryac07
Mar 10 2016 09:01 UTC
But I need the array containing maximum number
Robert Uivarosi
@URobert
Mar 10 2016 09:08 UTC
@harryac07 ok, so first of all you are not not flooping trough the array as you should
Mar 10 2016 09:08 UTC
Can anyone help me in "Profile Lookup" ? Badly stuck in it. No idea how to go about it
Robert Uivarosi
@URobert
Mar 10 2016 09:08 UTC
@harryac07 for looping trough multidimensional array you should have something like
for (var i = 0 ; i < arr.length ; i++){
for (var j = 0; j < arr[i].length ; j++){
}
}
@harryac07 now with such a setup, how would you access an element from ?
@jadeeshah let me see what you have.
Alkatell
@Alkatell
Mar 10 2016 09:18 UTC
Hi everyone, how can i write code in the chat so it displays correctly please?
Robert Uivarosi
@URobert
Mar 10 2016 09:18 UTC
@Alkatell see below
explain format
CamperBot
@camperbot
Mar 10 2016 09:18 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 the code`.

See also: ☛ How to type Backticks | ☯ Compose Mode | ❄ Gitter Formatting Basics

Alkatell
@Alkatell
Mar 10 2016 09:19 UTC
Thank you!