These are chat archives for FreeCodeCamp/HelpJavaScript

3rd
Jul 2016
Jimmy Huynh
@jkchuynh829
Jul 03 2016 00:06
Hello, can someone help me with setting up sublime text 3 with node js? I'm trying to set up a build system with node js.. but I'm getting stuck
Michael Bomholt
@bomholtm
Jul 03 2016 00:07
could someone from america confirm that my °F / °C toggle is working for them? https://s.codepen.io/bomholt/debug/zqgoOe
Diego Mayer
@Chrono79
Jul 03 2016 00:08
@bomholt from America the continent? If so, yes, it works
Michael Bomholt
@bomholtm
Jul 03 2016 00:10
@Chrono79 for people who get °F on initial visit and then can change it to °C
sorry im hella tired ... hope you get what im sayin =)
Diego Mayer
@Chrono79
Jul 03 2016 00:11
@bomholt I got ºC on initial visit
Michael Bomholt
@bomholtm
Jul 03 2016 00:12
@Chrono79 where are you from? you country doesnt use °C?
that would be weird
Diego Mayer
@Chrono79
Jul 03 2016 00:13
@bomholt Argentina, and yes, we use ºC
Michael Bomholt
@bomholtm
Jul 03 2016 00:13
@Chrono79 haha okay yea it should display what you use by itself and then let you toggle
so its working =) @Chrono79 thanks
CamperBot
@camperbot
Jul 03 2016 00:13
bomholt sends brownie points to @chrono79 :sparkles: :thumbsup: :sparkles:
:star2: 1397 | @chrono79 |http://www.freecodecamp.com/chrono79
Diego Mayer
@Chrono79
Jul 03 2016 00:14
@bomholt no problem, I was wondering if ºF on first visit wasn't working and ºC was
damn weather, it says it'll continue raining until wednesday (almost a week in a row :()
96street
@96street
Jul 03 2016 00:17

My .filter() isn't working with prepend..anyone know why? http://codepen.io/kingdezz/pen/VjbWRK?editors=0010

nevermind got it working

Toby Milroy
@tobytkd
Jul 03 2016 00:18
Ok,
I'm an idiot
can anyone tell me why this isn't right for the "escape" string section for Javascrot.
var myStr ="Here is a backslash: \.\n\t\t Here is a new line with 2 tabs"; // Change this line
Diego Mayer
@Chrono79
Jul 03 2016 00:19
@tobytkd delete the space after the last \t and add a period after 2 tabs
Toby Milroy
@tobytkd
Jul 03 2016 00:21
hmmmm...
like this?
var myStr ="Here is a backslash: \.\n\t\tHere is a new line with 2 tabs."; // Change this line
it's not printing right here.
Diego Mayer
@Chrono79
Jul 03 2016 00:21
use backticks
but yes, like that should work
Toby Milroy
@tobytkd
Jul 03 2016 00:22
doesn't seem to be.
SMH
Diego Mayer
@Chrono79
Jul 03 2016 00:22
var myStr = "Here is a backslash: \\.\n\t\tHere is a new line with two tabs.";
Toby Milroy
@tobytkd
Jul 03 2016 00:23
"Here is a backslash: \.\n\t\tHere is a new line with 2 tabs.";
this is what I'm using....
Diego Mayer
@Chrono79
Jul 03 2016 00:23
@tobytkd replace number 2 with word two
Toby Milroy
@tobytkd
Jul 03 2016 00:23
Oh...for "FU#@S" sake.
Worked.
THANKS!!!
Couldn't figure that out...was focussed on the escape string issue...
heh...
Thanks @Chrono79
CamperBot
@camperbot
Jul 03 2016 00:24
tobytkd sends brownie points to @chrono79 :sparkles: :thumbsup: :sparkles:
:star2: 1398 | @chrono79 |http://www.freecodecamp.com/chrono79
Diego Mayer
@Chrono79
Jul 03 2016 00:24
no problem, the devil is in the details
@96street if you have a codepen, paste the link
I tried to make a <li></li> and then append to it using resultList.filter('li') but didn't work
img's not working too
Diego Mayer
@Chrono79
Jul 03 2016 00:42
Pizza has arrived, I'll check it later
andreas2249
@andreas2249
Jul 03 2016 00:42
Thank you @DanCouper. (Very late reply...) I appreciated your explanation. :+1:
CamperBot
@camperbot
Jul 03 2016 00:42
andreas2249 sends brownie points to @dancouper :sparkles: :thumbsup: :sparkles:
:cookie: 155 | @dancouper |http://www.freecodecamp.com/dancouper
Stephen James
@sjames1958gm
Jul 03 2016 00:42
@Chrono79 Save me a piece
marcusmJSCoder
@marcusmJSCoder
Jul 03 2016 00:42
Quick question: I'm working on a JS/DOM project for class, and one exercise was to trigger a prompt where a user would enter text into the prompt, then to populate a text field with the prompt. I've found two ways that produce the desired results - which is better?
  1. document.getElementById("textOutput").value = userInput;
  2. document.getElementById("textOutput").innerHTML = userInput;
Sam
@alakasam
Jul 03 2016 00:45
Hey guys, for the "random quote generator" challenge, can anyone point me to a decent resource on getting primed in APIs/jQuery? I'm not getting much out of FCC's
Igor Laskaev
@ilaskaev
Jul 03 2016 00:46
@marcusmJSCoder value is generally used for form elements/inputs, innerHTML is generally used for div/span and other similar elements.
marcusmJSCoder
@marcusmJSCoder
Jul 03 2016 00:47
Thanks @ilaskaev !
CamperBot
@camperbot
Jul 03 2016 00:47
marcusmjscoder sends brownie points to @ilaskaev :sparkles: :thumbsup: :sparkles:
:cookie: 88 | @ilaskaev |http://www.freecodecamp.com/ilaskaev
Ronique Ricketts
@RoniqueRicketts
Jul 03 2016 00:48
hi everyone. I am stuck working on search abd replace algorithm
function myReplace(str, before, after) {
 //var beforeStr = /+ before +/i;
  var str = str.replace(before, after);
  console.log(str);
  return str;
}

myReplace("A quick brown fox jumped over the lazy dog", "jumped", "leaped");
andreas2249
@andreas2249
Jul 03 2016 00:48

Good afternoon, Campers. I'm very confused about when to use dot-notation vs. brackets notation. I can't figure out why the following only works with bracket notation:

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

function checkObj(checkProp) {
  if (myObj.hasOwnProperty(checkProp)) {
    return myObj[checkProp];
} 
return "Not Found";
}
checkObj("gift");

Stymied here. Thanks in advance. :)

Ronique Ricketts
@RoniqueRicketts
Jul 03 2016 00:49
Why Can't this work?
Stephen James
@sjames1958gm
Jul 03 2016 00:51
@RoniqueRicketts How are you stuck?
Igor Laskaev
@ilaskaev
Jul 03 2016 00:51
@RoniqueRicketts Seems like that'd work
Ronique Ricketts
@RoniqueRicketts
Jul 03 2016 00:51
When i run my code above it won't work
function myReplace(str, before, after) {
 //var beforeStr = /+ before +/i;
  var str = str.replace(before, after);
  console.log(str);
  return str;
}

myReplace("A quick brown fox jumped over the lazy dog", "jumped", "leaped");
It only pass 2 of the challenges.
Stephen James
@sjames1958gm
Jul 03 2016 00:52
@andreas2249 Use dot notation only when you know the property name and the property name is a valid js identifier (no spaces, can't start with number)
@RoniqueRicketts Which challenges does it fail?
andreas2249
@andreas2249
Jul 03 2016 00:52
@RoniqueRicketts, that looks like it'll work. I wonder if there's an "exercise-specific" reason...
@RoniqueRicketts, is it possible that the exercise is asking for something slightly different?
Brendan Kinahan
@BKinahan
Jul 03 2016 00:53
This message was deleted
Igor Laskaev
@ilaskaev
Jul 03 2016 00:54
@andreas2249 Since he's returning a string, I'm wondering if him not assigning that to a variable or actually using that returned string has anything to do with his error.
Brendan Kinahan
@BKinahan
Jul 03 2016 00:54
It doesn't work because you have to maintain the case of the original word you're replacing.
Ronique Ricketts
@RoniqueRicketts
Jul 03 2016 00:54
@sjames1958gm @andreas2249 it passes 2 out of 5 challenges
Stephen James
@sjames1958gm
Jul 03 2016 00:54
@RoniqueRicketts NOTE: Preserve the case of the original word when you are replacing it. For example if you mean to replace the word "Book" with the word "dog", it should be replaced as "Dog"
Brendan Kinahan
@BKinahan
Jul 03 2016 00:54
^
Ronique Ricketts
@RoniqueRicketts
Jul 03 2016 00:55
@sjames1958gm so it is case sensitive?
andreas2249
@andreas2249
Jul 03 2016 00:55
Thank you for your prompt reply @sjames1958gm. I'll follow that rule. :+1:
CamperBot
@camperbot
Jul 03 2016 00:55
andreas2249 sends brownie points to @sjames1958gm :sparkles: :thumbsup: :sparkles:
:star2: 1705 | @sjames1958gm |http://www.freecodecamp.com/sjames1958gm
andreas2249
@andreas2249
Jul 03 2016 00:57
@ilaskaev, good point. I dunno...
@ilaskaev, it just has a "feel" of something specific to the exercise might not be adhered to in this case...
Randy Goldsmith
@Dueldrawer8
Jul 03 2016 01:00
why doesnt this work? it goes to the last else but returns nothing
function rot13(str) {
     var newString = "";
  for(var i = 0; i < str.length; i++){
     newString += str.charCodeAt(i);
     if(str.charCodeAt[i] < 65 || str.charCodeAt[i] > 90){
        return String.fromCharCode(newString[i]);
      }
      else if(str.charCodeAt[i] < 78){
        return String.fromCharCode(newString[i] + 13);
      }
      else{
          return String.fromCharCode(newString[i] - 13);
        }

    }
} //function

rot13("SERR PBQR PNZC");
Diego Mayer
@Chrono79
Jul 03 2016 01:00
@96street create all html of a result first, including the opening and closing li and append to resultList after you've created it
Stephen James
@sjames1958gm
Jul 03 2016 01:01
@Dueldrawer8 All you paths return so you only get one pass through the for loop. Build your response - don't return
Randy Goldsmith
@Dueldrawer8
Jul 03 2016 01:02
@sjames1958gm it still doesnt subtract or add 13 to the numbers when it goes through the loop\
tkruger3902
@tkruger3902
Jul 03 2016 01:03
Has anyone recently completed the "Word Blanks" challenge? I am confused by the instructions and do not even know where to begin
Randy Goldsmith
@Dueldrawer8
Jul 03 2016 01:03
function rot13(str) {
     var newString = "";
  for(var i = 0; i < str.length; i++){
     newString += str.charCodeAt(i);
     if(str.charCodeAt[i] < 65 || str.charCodeAt[i] > 90){
         String.fromCharCode(newString[i]);
      }
      else if(str.charCodeAt[i] < 78){
         String.fromCharCode(newString[i] + 13);
      }
      else{
         String.fromCharCode(newString[i] - 13);
        }

    }
    return newString;
} //function

rot13("SERR PBQR PNZC");
```
Diego Mayer
@Chrono79
Jul 03 2016 01:03
@tkruger3902 what is it that's troubling you?
@Dueldrawer8 use str.charCodeAt(i) inside fromCharCode
and newString += before String.fromCharCode
delete this line: newString += str.charCodeAt(i);
Randy Goldsmith
@Dueldrawer8
Jul 03 2016 01:08
@Chrono79 still doesnt work
 function rot13(str) {
     var newString = "";
  for(var i = 0; i < str.length; i++){
     if(str.charCodeAt[i] < 65 || str.charCodeAt[i] > 90){
         newString += String.fromCharCode(str.charCodeAt[i]);
      }
      else if(str.charCodeAt[i] < 78){
         newString += String.fromCharCode(str.charCodeAt[i] + 13);
      }
      else{
         newString += String.fromCharCode(str.charCodeAt[i] - 13);
        }

    }
    return newString;
} //function

rot13("SERR PBQR PNZC");
```
Diego Mayer
@Chrono79
Jul 03 2016 01:09
@Dueldrawer8 rethink your ifs
Igor Laskaev
@ilaskaev
Jul 03 2016 01:09
@Dueldrawer8 Which problem is this for?
Randy Goldsmith
@Dueldrawer8
Jul 03 2016 01:11
@ilaskaev casers cipher
Igor Laskaev
@ilaskaev
Jul 03 2016 01:13
@Dueldrawer8 Give me a min I'll take alook at it
Diego Mayer
@Chrono79
Jul 03 2016 01:13
@Dueldrawer8 if(str.charCodeAt[i] < 65 || str.charCodeAt[i] > 90){
should be if(str.charCodeAt(i) < 65 || str.charCodeAt(i) > 90){
fix this one too else if(str.charCodeAt[i] < 78){
and this is not needed: newString += String.fromCharCode(str.charCodeAt[i]); simply do this newString += str[i];
Igor Laskaev
@ilaskaev
Jul 03 2016 01:16
@Dueldrawer8
function rot13(str) {
     var newString = "";
  for(var i = 0; i < str.length; i++){
     if(str.charCodeAt(i) < 65 || str.charCodeAt(i) > 90){
         newString += String.fromCharCode(str.charCodeAt(i));
      }
      else if(str.charCodeAt(i) < 78){
         newString += String.fromCharCode(str.charCodeAt(i) + 13);
      }
      else{
         newString += String.fromCharCode(str.charCodeAt(i) - 13);
        }
    }
    return newString;
} //function

rot13("SERR PBQR PNZC");
Randy Goldsmith
@Dueldrawer8
Jul 03 2016 01:20
@ilaskaev @Chrono79 thank u
CamperBot
@camperbot
Jul 03 2016 01:20
dueldrawer8 sends brownie points to @ilaskaev and @chrono79 :sparkles: :thumbsup: :sparkles:
:cookie: 91 | @ilaskaev |http://www.freecodecamp.com/ilaskaev
:star2: 1399 | @chrono79 |http://www.freecodecamp.com/chrono79
Randy Goldsmith
@Dueldrawer8
Jul 03 2016 01:21
took me awhile
@Chrono79 did it take you long to do the intermediate algos?
tkruger3902
@tkruger3902
Jul 03 2016 01:24
@Chrono79 I don't understand what to do with this : You will need to use string operators to build a new string, result, using the provided variables: myNoun, myAdjective, myVerb, and myAdverb.
I don't know what that looks like
Diego Mayer
@Chrono79
Jul 03 2016 01:24
@Dueldrawer8 one week?
Moisés Man
@moigithub
Jul 03 2016 01:25
function rot13(str){
var abc = "ABCDEFGHIJKLMNOPQRSTUVWXYZ",
enc="NOPQRSTUVWXYZABCDEFGHIJKLM",
newStr="";
for(var i = 0; i<str.length; i++){
        var char = abc.indexOf(str[i]); //index
      if(char>=0) {newStr+=enc[char]}
      else {newStr+=str[i];}
}
return newStr;
}
Charles Bakar
@charlesBak
Jul 03 2016 01:25
hi guys please see if my weather app works fine
http://codepen.io/charlesB/full/yJbxPm/
GalactikJ
@GalactikJ
Jul 03 2016 01:25
how do i link my code that im struggling with?
Randy Goldsmith
@Dueldrawer8
Jul 03 2016 01:25
@Chrono79 wow.. do you arleady have experience with comp sci/algorithms?
i meant did you
@Dueldrawer8 yes
Randy Goldsmith
@Dueldrawer8
Jul 03 2016 01:26
@Chrono79 oh
Norvin Burrus
@ndburrus
Jul 03 2016 01:26
@tkruger3902 the word blanks lesson is asking for a sentence to be built using the 4 word types given. it may be helpful to think of a complete sentence (with punctuation & spacing) using those words. then, build the sentence. getting clearer?
Diego Mayer
@Chrono79
Jul 03 2016 01:27
@charlesBak it works, but see the comma: Buenos Aires ,AR
GalactikJ
@GalactikJ
Jul 03 2016 01:28

function wordBlanks(myNoun, myAdjective, myVerb, myAdverb) {
var result = "";
// Your code below this line
var myNoun = "dog";
var myNoun2 = "cat";
var myAdjective = "big";
var myAdjective2 = "little";
var myVerb = "ran";
var myVerb2 = "hit";
var myAdverb = "quickly";
var myAdverb2 = "slowly";
var result = "my " + myNoun + " is " + myAdjective + " and " + myVerb + " very " + myAdverb + " to the ice-cream truck";
var result = "my " + myNoun2 + " is " + myAdjective2 + " and " + myVerb2 + " very " + myAdverb2 + " to the ice-cream truck";

// Your code above this line
return result;
}

Moisés Man
@moigithub
Jul 03 2016 01:28
@Dueldrawer8 :point_up: July 2, 2016 8:25 PM <--what ya think ?? my rot13
tkruger3902
@tkruger3902
Jul 03 2016 01:28
Thank you @Chrono79
CamperBot
@camperbot
Jul 03 2016 01:28
tkruger3902 sends brownie points to @chrono79 :sparkles: :thumbsup: :sparkles:
:star2: 1400 | @chrono79 |http://www.freecodecamp.com/chrono79
GalactikJ
@GalactikJ
Jul 03 2016 01:28
idk how to stop result 1 from getting overwritten
Charles Bakar
@charlesBak
Jul 03 2016 01:28
@Chrono79 ok ill fixed that thank you
CamperBot
@camperbot
Jul 03 2016 01:28
charlesbak sends brownie points to @chrono79 :sparkles: :thumbsup: :sparkles:
:star2: 1401 | @chrono79 |http://www.freecodecamp.com/chrono79
tkruger3902
@tkruger3902
Jul 03 2016 01:28
Yes, thank you @ndburrus
CamperBot
@camperbot
Jul 03 2016 01:28
tkruger3902 sends brownie points to @ndburrus :sparkles: :thumbsup: :sparkles:
:cookie: 787 | @ndburrus |http://www.freecodecamp.com/ndburrus
Diego Mayer
@Chrono79
Jul 03 2016 01:29
@GalactikJ leave only this line: var result = "my " + myNoun + " is " + myAdjective + " and " + myVerb + " very " + myAdverb + " to the ice-cream truck"; and delete the var keyword, result is already declared above
Abhishek Baliyan
@abhishekdevinfo
Jul 03 2016 01:29
@GalactikJ use spaces in your string
GalactikJ
@GalactikJ
Jul 03 2016 01:29
@Chrono79 @abhishekdevinfo ok thanks guys
CamperBot
@camperbot
Jul 03 2016 01:29
galactikj sends brownie points to @chrono79 and @abhishekdevinfo :sparkles: :thumbsup: :sparkles:
:star2: 1402 | @chrono79 |http://www.freecodecamp.com/chrono79
:cookie: 223 | @abhishekdevinfo |http://www.freecodecamp.com/abhishekdevinfo
Diego Mayer
@Chrono79
Jul 03 2016 01:30
@GalactikJ you don't have to create new vars, just use the parameters of your function, in every call they change its value
Norvin Burrus
@ndburrus
Jul 03 2016 01:31
@GalactikJ ok... all of the given variables are already defined.... resulting in code errors.
JohnWright24
@JohnWright24
Jul 03 2016 01:32
Hey guys, I'm working on the "Understanding Case Sensitivity in Variables" exercise and I'm lost. Any pointers?
GalactikJ
@GalactikJ
Jul 03 2016 01:32
@Chrono79 I see ok. @ndburrus sorry im new to javascript guys still getting the hang of it. Trying my best though.
Norvin Burrus
@ndburrus
Jul 03 2016 01:33
@JohnWright24 can you post your code so far? @GalactikJ no worries... i'm learning too.. :sparkles:
GalactikJ
@GalactikJ
Jul 03 2016 01:34
@ndburrus awesome :D
JohnWright24
@JohnWright24
Jul 03 2016 01:34

@ndburrus ```
// Declarations
var stUdLyCapVaR = 10;
var CamelCase = 9000;
var titleCaseOver = "A String";

// Assignments
studLyCapVar = 10;
CamelCase = "A String";
titleCaseOver = 9000;

I had to reset the code lol @ndburrus
Norvin Burrus
@ndburrus
Jul 03 2016 01:36
@JohnWright24 ok, this may be helpful:
  • Capitalization Styles.aspx) - see Camel case.
    also this area: // Declarations is for declarations (assignments not needed here). note: stUdLyCapVaR !== studlyCapVaR
96street
@96street
Jul 03 2016 01:36
@Chrono79 so create 10 <li>'s ?
(the amount of results i'm appending)
JohnWright24
@JohnWright24
Jul 03 2016 01:37
@ndburrus Okay, I'll give it a look! Thanks man!
CamperBot
@camperbot
Jul 03 2016 01:37
johnwright24 sends brownie points to @ndburrus :sparkles: :thumbsup: :sparkles:
:cookie: 788 | @ndburrus |http://www.freecodecamp.com/ndburrus
Diego Mayer
@Chrono79
Jul 03 2016 01:38
@96street create a var, let's say individualResult, and after you've created it, append it to the other var
Charles Bakar
@charlesBak
Jul 03 2016 01:38
@Chrono79 the api that i used for the geolocation seems not work for everybody do you know a better one?
Sean DiSanti
@badc0ded
Jul 03 2016 01:39
i found a good one, its.... (sorry have to load codepen to check)
Charles Bakar
@charlesBak
Jul 03 2016 01:40
sure tell me if you ready @badc0ded thanks
CamperBot
@camperbot
Jul 03 2016 01:40
charlesbak sends brownie points to @badc0ded :sparkles: :thumbsup: :sparkles:
:cookie: 391 | @badc0ded |http://www.freecodecamp.com/badc0ded
Sean DiSanti
@badc0ded
Jul 03 2016 01:40
i used ipinfo.io
i have it get location based on ip prior to trying to get it from navigator
Charles Bakar
@charlesBak
Jul 03 2016 01:41
i used this one http://ip-api.com/json
Sean DiSanti
@badc0ded
Jul 03 2016 01:42
so it tries to use browser but already has fail over from ip if share denied or not browser supported
Charles Bakar
@charlesBak
Jul 03 2016 01:42
tell me if it get your city right
Sean DiSanti
@badc0ded
Jul 03 2016 01:43
close enough for mine, i'm using vpn so it's anybody's guess
lol
i know my endpoint is in california and your page says LA, so i trust it
Diego Mayer
@Chrono79
Jul 03 2016 01:44

@96street

    for(var page in pages) { 
      var individualResult = '<li><h2>' + pages[page].title + '</h2><p>' + pages[page].extract + '</p>';


      if(pages[page].thumbnail) { 

        individualResult += '<img src=' + pages[page].thumbnail.source + '></li>';

      } else {individualResult += "<img src='#'></li>";}
      resultList.append(individualResult);
    }

Like this

Charles Bakar
@charlesBak
Jul 03 2016 01:44
@badc0ded it is not even get my city right ahaha
Sean DiSanti
@badc0ded
Jul 03 2016 01:44
looks good @charlesBak
Charles Bakar
@charlesBak
Jul 03 2016 01:45
ill maybe try yours
Sean DiSanti
@badc0ded
Jul 03 2016 01:45
one second i'll turn off vpn to check
city right, weather wrong
we definitely have at least partly cloudy
Charles Bakar
@charlesBak
Jul 03 2016 01:46
humm what do you think may be the problem here?
Sean DiSanti
@badc0ded
Jul 03 2016 01:47
as far as the weather being off? i'd say not to worry about it, you're just reporting what's returned
you can't be expected to validate their weather data beyond making sure it's supplied and then displayed
Charles Bakar
@charlesBak
Jul 03 2016 01:48
right
Sean DiSanti
@badc0ded
Jul 03 2016 01:48
and the city was right on my side
Charles Bakar
@charlesBak
Jul 03 2016 01:48
thanks you for your assisstance man @badc0ded i appreciate
CamperBot
@camperbot
Jul 03 2016 01:48
charlesbak sends brownie points to @badc0ded :sparkles: :thumbsup: :sparkles:
:warning: charlesbak already gave badc0ded points
Sean DiSanti
@badc0ded
Jul 03 2016 01:48
no problem
if you want to see the way i've started mine, it's at http://codepen.io/badc0ded/pen/qNmVYB
opening console will show you the ip and weather data
or if you want to see a REAL weather site I did, that's at http://rainfall.net
i did everthing but the design / visual look on that one
initially anyway, other members of the team have helped with support
Charles Bakar
@charlesBak
Jul 03 2016 01:51
woww loooks good
Sean DiSanti
@badc0ded
Jul 03 2016 01:51
i can only take credit for the functionality, the appearance was done by a designer we used to have here
Charles Bakar
@charlesBak
Jul 03 2016 01:52
did you use the same api you suggested before?
Sean DiSanti
@badc0ded
Jul 03 2016 01:52
as far as picking the color scheme and fonts etc
yes i did
the call for it is super simple
 $.getJSON('http://ipinfo.io', function(data) {
    apiInfo.ip = data;
    console.log('ip-data', data);
}
Charles Bakar
@charlesBak
Jul 03 2016 01:52
at the end is the functionality the most inportant part
Sean DiSanti
@badc0ded
Jul 03 2016 01:53
it's debatable
but it's a trade off everywhere in nature
an ugly site that works perfectly is better than a gorgeous one that doesn't do what it's supposed to, but ideally you shoot for somewhere in the middle
Charles Bakar
@charlesBak
Jul 03 2016 01:55
did you do it for the all country?
Sean DiSanti
@badc0ded
Jul 03 2016 01:55
that one is for the state of west virginia, but we use the same data stream to drive http://water.weather.gov
i can't take nearly as much credit for that site, but I am one of 5 that maintain and do work for it
Charles Bakar
@charlesBak
Jul 03 2016 01:56
you guys did a great job on this one really
Sean DiSanti
@badc0ded
Jul 03 2016 01:57
i did the bulk of the functionalilty work (front end and back) for http://water.weather.gov/precip and the inundation interfaces like http://water.weather.gov/ahps/inundation/index.php?gage=jrsp1
just re-implementing functionality that they had previously with old unreliable code
thanks, that one is a years long ongoing project
i only started with it about 2.5 years ago, but it was already a project for the company for years before that
railgun210
@railgun210
Jul 03 2016 01:59
str.legnth <= num ? str.slice() : num < 3 ? str.slice(0 , num) + "..." : str.slice(0, num-3) + "..."; as this line of code in js, why str.length <= num is false even num is actually larger than num?
Charles Bakar
@charlesBak
Jul 03 2016 01:59
do you have your company build on this?
Sean DiSanti
@badc0ded
Jul 03 2016 01:59
i am an employee of the company that currently develops it
railgun210
@railgun210
Jul 03 2016 01:59
num is actually larger than str.length*
Sean DiSanti
@badc0ded
Jul 03 2016 02:00
we may have to see it in context to help with that one railgun
railgun210
@railgun210
Jul 03 2016 02:01
its the challenge Truncate a string
Charles Bakar
@charlesBak
Jul 03 2016 02:01
how long have you been doing this already i mean programming with javascript
railgun210
@railgun210
Jul 03 2016 02:01
function truncateString(str, num) {
// Clear out that junk in your trunk
return str.legnth <= num ? str.slice() : num < 3 ? str.slice(0 , num) + "..." : str.slice(0, num-3) + "...";
}
Sean DiSanti
@badc0ded
Jul 03 2016 02:02
i've been programming for a long time, but the bulk of that time was spent doing systems work rather than web stuff. i have been doing web stuff again for 5 or 6 years
railgun210
@railgun210
Jul 03 2016 02:02
43 43
VM1340:7 A-tisket a-tasket A green and yellow bas...
VM1340:5 45 43
VM1340:7 A-tisket a-tasket A green and yellow baske... and my console.log shows this
i dont know why str.length <= num is false here...
Sean DiSanti
@badc0ded
Jul 03 2016 02:02
you shouldn't do it all in your return statement
just for readability if nothing else
i personally am a fan of ternaries, but they do hurt readability and you should avoid doing any kind of conditional logic within a return statement as it can be unpredictable
my portfolio page @charlesBak http://codepen.io/badc0ded/full/wMKmxj/
cd83xx
@cd83x
Jul 03 2016 02:04

Can anyone help my figure out why this isn't passing.

"myStr = "This is a backslash: \.\n\t\t Here is a new line with two tabs."" -- it wants:

Here is a backslash: backslash.newline tab tab Here is a new line with two tabs.

railgun210
@railgun210
Jul 03 2016 02:04
okay, i think ill just recode it then....
Sean DiSanti
@badc0ded
Jul 03 2016 02:05
why not just move it up a line and assign the result to a variable
then you can log the variable to make sure it's what you expect, and if so return the variable
Charles Bakar
@charlesBak
Jul 03 2016 02:07
@badc0ded beautiful page
:+1:
Sean DiSanti
@badc0ded
Jul 03 2016 02:08
thanks @charlesBak believe it or not, finding/making the image for the initial load took up the bulk of the time
CamperBot
@camperbot
Jul 03 2016 02:08
badc0ded sends brownie points to @charlesbak :sparkles: :thumbsup: :sparkles:
:cookie: 307 | @charlesbak |http://www.freecodecamp.com/charlesbak
Charles Bakar
@charlesBak
Jul 03 2016 02:08
@badc0ded ya im really not good at designing things
Sean DiSanti
@badc0ded
Jul 03 2016 02:09
I'm not super creative and i don't have an eye for aesthetics so when i have to do design stuff it takes forever
Charles Bakar
@charlesBak
Jul 03 2016 02:09
maybe i should learn about that
Sean DiSanti
@badc0ded
Jul 03 2016 02:09
like if someone tells me what they want, i can make it happen, and fine tune it any way they want
that photography site on my portfolio is an example
she is an actual artist / graphic person and was able to tell me the kind of look she wanted and her colors and we made it happen
blah
anyway, i'm sorry I am currently banging my head on a stupid map issue and have to focus on that a bit
happy to help if anybody has any questions though, just throw me a mention and i'll get the alert
Charles Bakar
@charlesBak
Jul 03 2016 02:12
sure thanks man @badc0ded really great to know you
CamperBot
@camperbot
Jul 03 2016 02:12
charlesbak sends brownie points to @badc0ded :sparkles: :thumbsup: :sparkles:
:warning: charlesbak already gave badc0ded points
Sean DiSanti
@badc0ded
Jul 03 2016 02:12
no problem, i'm always happy to help
OH! and anybody looking to tag team challenges or projects, there's a 'LetsPair' room that's been a little too quiet the last few days
go introduce yourselves
gdalrymple9
@gdalrymple9
Jul 03 2016 02:26

Hi everyone, I'm working on jQuery right now. I am unable to pass and I'm not sure what I'm doing wrong. Here are my requirements: Use the jQuery addClass() function to give the classes animated and shake to all your elements with the class well.
Only use jQuery to add these classes to the element. Here is what I've coded so far: <script>
$(document).ready(function() {
$("button").addClass("animated bounce");
});
$(".well").ready(function() { $(".text-primary").addClass("animated shake");
});
</script>
<!-- Only change code above this line. -->

<div class="container-fluid">
<h3 class="text-primary text-center">jQuery Playground</h3>
<div class="row">
<div class="col-xs-6">
<h4>#left-well</h4>
<div class="well" id="left-well">
<button class="btn btn-default target" id="target1">#target1</button>
<button class="btn btn-default target" id="target2">#target2</button>
<button class="btn btn-default target" id="target3">#target3</button>
</div>
</div>
<div class="col-xs-6">
<h4>#right-well</h4>
<div class="well" id="right-well">
<button class="btn btn-default target" id="target4">#target4</button>
<button class="btn btn-default target" id="target5">#target5</button>
<button class="btn btn-default target" id="target6">#target6</button>
</div>
</div>
</div>
</div>

David Liendo
@DavLiendoProgramming
Jul 03 2016 02:29
well
i need help too....
if somebody could help me....
im on the seek and destroy challengue
and for some reason im not being able to destroy anythingxd

function destroyer(arr) {
  // Remove all the values
  for(var j = 1;j<arr.lenth;j++){
  for (var i=0;i<arr[0].length;i++){

    if(arr[0][i]==arr[j]){
      delete arr[0][i];
    }
  }
  }
  return arr.filter(Boolean);
}
Diego Mayer
@Chrono79
Jul 03 2016 02:31
@gdalrymple9 challenge name?
Sean DiSanti
@badc0ded
Jul 03 2016 02:31
you probably don't want to delete from an array you're iterating
Diego Mayer
@Chrono79
Jul 03 2016 02:31
@DavLiendoProgramming delete is for object's properties
Sean DiSanti
@badc0ded
Jul 03 2016 02:31
@geecheeche just paste your code, not the url to it
help format
CamperBot
@camperbot
Jul 03 2016 02:32

:point_right: code formatting [wiki]

Multi line Code

```js ⇦ Type 3 backticks and then press [shift + enter ⏎] (type js or html or css)

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

``` ⇦ Type 3 backticks, then press [enter ⏎]

Single line Code

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

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

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

Sean DiSanti
@badc0ded
Jul 03 2016 02:32
formatted is best:
Jon Mullins
@mullinswebworx
Jul 03 2016 02:33
can someone help with the Record Collection challenge?
Sean DiSanti
@badc0ded
Jul 03 2016 02:33
yes, what's up?
geecheechee
@geecheeche
Jul 03 2016 02:33

@badc0ded , here: You will need to use escape sequences to insert special characters correctly. You will also need to follow the spacing as it looks above with no additional spaces between each escape sequence.

Here is the text with the escape sequences written out.

Here is a backslash: backslash.newline tab tab Here is a new line with two tabs. And my code is this: var myStr; "\ \n \t \t";// Change this line

Jon Mullins
@mullinswebworx
Jul 03 2016 02:34
I believe I have everything correct, but I can't pass this: After updateRecords(5439, "tracks", "Take a Chance on Me"), tracks should have "Take a Chance on Me" as the last element.
my code is:

// Only change code below this line
function update(id, prop, value) {
if (value === '') {
delete collection[id][prop];
} else if (prop !== 'tracks') {
collection[id][prop] = value;
} else {
collection[id][prop].push(value);
}

return collection;
}

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

Diego Mayer
@Chrono79
Jul 03 2016 02:35
@gdalrymple9
$(document).ready(function() {
  $("button").addClass("animated bounce"); // this is ok, do almost the same with $(".well")
});
Sean DiSanti
@badc0ded
Jul 03 2016 02:36
what does that test return when you run it?
Jon Mullins
@mullinswebworx
Jul 03 2016 02:36

// Only change code below this line
function update(id, prop, value) {
if (value === '') {
delete collection[id][prop];
} else if (prop !== 'tracks') {
collection[id][prop] = value;
} else {
collection[id][prop].push(value);
}

return collection;
}

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

Norvin Burrus
@ndburrus
Jul 03 2016 02:36
@geecheeche where did the period from the 1st sentence go? also, ensure the spacing (and spaces are/) is accurate. examples: the spacing after : & before H :sparkles:
Jon Mullins
@mullinswebworx
Jul 03 2016 02:37
oops on moment
Diego Mayer
@Chrono79
Jul 03 2016 02:37
@mullinswebworx use format
help format
CamperBot
@camperbot
Jul 03 2016 02:37

:point_right: code formatting [wiki]

Multi line Code

```js ⇦ Type 3 backticks and then press [shift + enter ⏎] (type js or html or css)

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

``` ⇦ Type 3 backticks, then press [enter ⏎]

Single line Code

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

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

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

geecheechee
@geecheeche
Jul 03 2016 02:38
@ndburrus cheers, let me try that.
Diego Mayer
@Chrono79
Jul 03 2016 02:38
@mullinswebworx almost ok, but tracks as property could not exist in every record, so you have to create the property before trying to use push (that's an array method)
Jon Mullins
@mullinswebworx
Jul 03 2016 02:39
how can I copy the output?
Sean DiSanti
@badc0ded
Jul 03 2016 02:39
yes, i was going to say you should definitely be checking for hasOwnProperty also
Diego Mayer
@Chrono79
Jul 03 2016 02:39
copy the output? @mullinswebworx
Sean DiSanti
@badc0ded
Jul 03 2016 02:40
I usually work in the console
Jon Mullins
@mullinswebworx
Jul 03 2016 02:40
the text under the "reset, help, bug" buttons
Sean DiSanti
@badc0ded
Jul 03 2016 02:40
i would just paste the function into the console, and then run the test
Juan Cieri
@juancieri
Jul 03 2016 02:40
whats wrong in this?
var myStr = "Here is a backlash: \.\n\t\t Here is a new line with two tabs."; // Change this line
geecheechee
@geecheeche
Jul 03 2016 02:40
@ndburrus Do I have to include the words as well?
Diego Mayer
@Chrono79
Jul 03 2016 02:41
@mullinswebworx don't know, never tried it and I see you can't just copy it like normal text
This message was deleted
Norvin Burrus
@ndburrus
Jul 03 2016 02:42
@geecheeche we're going backwards, aren't we? take a look at what you had previously for the 1st \ !! :cake: also, review the previous comments, carefully... :) :point_up: July 2, 2016 10:36 PM
Diego Mayer
@Chrono79
Jul 03 2016 02:42
@juancieri delete the space after the last \t
Juan Cieri
@juancieri
Jul 03 2016 02:44
something like this?:
var myStr = "Here is a backlash: \.\n\t\tHere is a new line with two tabs.";
still not working :s
geecheechee
@geecheeche
Jul 03 2016 02:44
@ndburrus Man, I'm all confused now. I have been at it for a bit. I did it that way with the period and all and it did not work.
Jon Mullins
@mullinswebworx
Jul 03 2016 02:44
I'm lost, I've even tried looking at other passing code for this challenge, and it seems to match mine. Not sure what I'm missing.
Norvin Burrus
@ndburrus
Jul 03 2016 02:45
@mullinswebworx @juancieri are you both working on this one also?
geecheechee
@geecheeche
Jul 03 2016 02:45
@juancieri I am struggling with the same bit. I think the way they pose their questions is tricky, or we just don't get it...
Norvin Burrus
@ndburrus
Jul 03 2016 02:46
@juancieri can you post your code?
Diego Mayer
@Chrono79
Jul 03 2016 02:46

var myStr = "Here is a backlash: \.\n\t\tHere is a new line with two tabs.";

misspelled backslash @juancieri

Jon Mullins
@mullinswebworx
Jul 03 2016 02:46
I'm working on Record Collection
geecheechee
@geecheeche
Jul 03 2016 02:46
@ndburrus here: "Here is a backslash: \.\n \t \t Here is a new line with two tabs"
Norvin Burrus
@ndburrus
Jul 03 2016 02:47
@geecheeche are you escaping the 1st backslash? and does the 2nd sentence have punctuation?
geecheechee
@geecheeche
Jul 03 2016 02:47
Yes, for some reason it did not show on the code I pasted.
Diego Mayer
@Chrono79
Jul 03 2016 02:47
@ndburrus yes he is, try quoting him
Norvin Burrus
@ndburrus
Jul 03 2016 02:47
@mullinswebworx did you post?
Diego Mayer
@Chrono79
Jul 03 2016 02:47
@geecheeche use backticks
Bryan Raynor
@bryanraynor
Jul 03 2016 02:47
Ok, the record collection is really annoying
Jon Mullins
@mullinswebworx
Jul 03 2016 02:48
@bryanraynor yes
Diego Mayer
@Chrono79
Jul 03 2016 02:48
@juancieri did you fixed it?
Jon Mullins
@mullinswebworx
Jul 03 2016 02:49
@ndburrus did i post what?
Bnobo
@acloud12345678
Jul 03 2016 02:49
I need help
here is my code
Norvin Burrus
@ndburrus
Jul 03 2016 02:49
@mullinswebworx your code...
edison sim
@Edisonsim
Jul 03 2016 02:49
hi guys, anyone know how do i get cross and circle for tic tac toe?
geecheechee
@geecheeche
Jul 03 2016 02:49
@Chrono79 not working as well man
Jon Mullins
@mullinswebworx
Jul 03 2016 02:49
sorry, I will post again
Bnobo
@acloud12345678
Jul 03 2016 02:50

var myStr = 'This string has "double quotes" in it. And "probably" lots of them.';
Diego Mayer
@Chrono79
Jul 03 2016 02:50
@geecheeche you have spaces after some of your codes, and you missed a period at the end
Bnobo
@acloud12345678
Jul 03 2016 02:50
var myStr = 'This string has "double quotes" in it. And "probably" lots of them.';
Jon Mullins
@mullinswebworx
Jul 03 2016 02:50
// Only change code below this line
function update(id, prop, value) {
  if (value === '') {
    delete collection[id][prop];
  } else if (prop !== 'tracks') {
    collection[id][prop] = value;
  } else {
    collection[id][prop].push(value);
  }


  return collection;
}

// Alter values below to test your code
update(5439, "artist", "ABBA");
Norvin Burrus
@ndburrus
Jul 03 2016 02:50
@juancieri escape the 1st backslash, space at 2nd sentence beginning... :sparkles: :
Bnobo
@acloud12345678
Jul 03 2016 02:51

var myStr = 'This string has "double quotes" in it. And "probably" lots of them.';




var myStr = 'This string has "double quotes" in it. And "probably" lots of them.';

var myStr = 'This string has "double quotes" in it. And "probably" lots of them.';
Norvin Burrus
@ndburrus
Jul 03 2016 02:52
@acloud12345678 Which lesson/exercise (name) is this?
Diego Mayer
@Chrono79
Jul 03 2016 02:52
@ndburrus @juancieri text is ok, he only needs to fix backlash
Bryan Raynor
@bryanraynor
Jul 03 2016 02:52
amazingly enough I can get record 5439 to update, but not record 2468
Diego Mayer
@Chrono79
Jul 03 2016 02:52
@acloud12345678 challenge name or goal?
Jon Mullins
@mullinswebworx
Jul 03 2016 02:53
@bryanraynor with my code?
Diego Mayer
@Chrono79
Jul 03 2016 02:53
@mullinswebworx :point_up: 2 de julio de 2016 23:38
Bryan Raynor
@bryanraynor
Jul 03 2016 02:54
With my code, similar to use, but I use a check for hasOwnProperty
geecheechee
@geecheeche
Jul 03 2016 02:54
@Chrono79 I this is what I did: "Here is a backslash:\\n\t\t Here is a new line with two tabs.";
Bnobo
@acloud12345678
Jul 03 2016 02:54
@Chrono79 @ndburrus Quoting Strings with Single Quotes
this is on javascript
Diego Mayer
@Chrono79
Jul 03 2016 02:56
"Here is a backslash:\\\n\t\t Here is a new line with two tabs.";
add a space after : put a period before \n and delete the space after the last \t @geecheeche
Bnobo
@acloud12345678
Jul 03 2016 02:56
me?
Jon Mullins
@mullinswebworx
Jul 03 2016 02:56
@Chrono79 , my brain is shot, can you clarify "create the property?
@acloud12345678 not you yet
Bnobo
@acloud12345678
Jul 03 2016 02:57
ok
Jon Mullins
@mullinswebworx
Jul 03 2016 02:59
@Chrono79 Thanks, I'll have a look.
CamperBot
@camperbot
Jul 03 2016 02:59
mullinswebworx sends brownie points to @chrono79 :sparkles: :thumbsup: :sparkles:
:star2: 1403 | @chrono79 |http://www.freecodecamp.com/chrono79
Diego Mayer
@Chrono79
Jul 03 2016 03:00
@acloud12345678 this is the string you should work with: var myStr = "<a href=\"http://www.example.com\" target=\"_blank\">Link</a>";
Instructions
Change the provided string from double to single quotes and remove the escaping.
geecheechee
@geecheeche
Jul 03 2016 03:00
@Chrono79 I have never seen this ridiculousness before in the few days I have been coding. So, this is the result: "Here is a backslash: \.\n\t\t Here is a new line with two tabs."; //still not working!
Diego Mayer
@Chrono79
Jul 03 2016 03:01
@geecheeche remove this space \tREMOVEMEHere
if all goes well that challenge will change soon
Bnobo
@acloud12345678
Jul 03 2016 03:02
what do you mean by escaping? @Chrono79
geecheechee
@geecheeche
Jul 03 2016 03:02
@Chrono79 I did, and refreshed my browser, it is not taking it.
Juan Moraza
@Morazajuan
Jul 03 2016 03:02
Hello Campers! i dont get why the challenge objective isnt still checked. im getting what the objective is asking me.
The challenge its called "Record Collection", and the second objective is the one im talking about. here is my code

// Setup
var collection = {
    "2548": {
      "album": "Slippery When Wet",
      "artist": "Bon Jovi",
      "tracks": [ 
        "Let It Rock", 
        "You Give Love a Bad Name" 
      ]
    },
    "2468": {
      "album": "1999",
      "artist": "Prince",
      "tracks": [ 
        "1999", 
        "Little Red Corvette" 
      ]
    },
    "1245": {
      "artist": "Robert Palmer",
      "tracks": [ ]
    },
    "5439": {
      "album": "ABBA Gold"
    }

};
// Keep a copy of the collection for tests
var collectionCopy = JSON.parse(JSON.stringify(collection));

// Only change code below this line
function updateRecords(id, prop, value) {
console.log(id);
  console.log(collection[id][prop]);

if(prop !== collection[id][prop]  ){
 collection[id][prop]= value;

}else{
  delete collection[id][prop];
}
  if (collection[id][prop] === ""){
    delete collection[id][prop];
  }else{
   //delete collection[id][prop];

  }
  return collection;
}

var trackObj= "tracks";
var trackName= collection[trackObj];
  console.log(trackName);

// Alter values below to test your code
updateRecords(5439, "tracks", "Take a Chance on Me");
Diego Mayer
@Chrono79
Jul 03 2016 03:02
@geecheeche from what you have pasted it's there
Bnobo
@acloud12345678
Jul 03 2016 03:02
@Chrono79 thanks, it worked
geecheechee
@geecheeche
Jul 03 2016 03:02
@acloud12345678 I think he means the slash symbol/mark this thing in parentheses ().
Diego Mayer
@Chrono79
Jul 03 2016 03:03
@acloud12345678 :+1:
Bnobo
@acloud12345678
Jul 03 2016 03:03
@geecheeche i understand, thanks anyway
CamperBot
@camperbot
Jul 03 2016 03:03
acloud12345678 sends brownie points to @geecheeche :sparkles: :thumbsup: :sparkles:
:cookie: 234 | @geecheeche |http://www.freecodecamp.com/geecheeche
Diego Mayer
@Chrono79
Jul 03 2016 03:03
@geecheeche paste it again
Abhishek Baliyan
@abhishekdevinfo
Jul 03 2016 03:03
need help
Bnobo
@acloud12345678
Jul 03 2016 03:03
@Chrono79 thank you
CamperBot
@camperbot
Jul 03 2016 03:03
acloud12345678 sends brownie points to @chrono79 :sparkles: :thumbsup: :sparkles:
:star2: 1404 | @chrono79 |http://www.freecodecamp.com/chrono79
Abhishek Baliyan
@abhishekdevinfo
Jul 03 2016 03:04
in Record Collection java-script challange
geecheechee
@geecheeche
Jul 03 2016 03:04
@Chrono79 here: "Here is a backslash: \.\n\t\tHere is a new line with two tabs.";
Abhishek Baliyan
@abhishekdevinfo
Jul 03 2016 03:04

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

// Only change code below this line
function updateRecords(id, prop, value) {
  if( id.hasOwnProperty("tracks") ) {
    if( "tracks" === [] ) {
      id.tracks.push(["The last one","Take a Chance on Me"]);
    }
  }
  else {
    id.tracks = [];
    id.tracks.push(["The last one","Take a Chance on Me"]);
  }

  return collection;
}

// Alter values below to test your code
updateRecords(5439, "artist", "ABBA");
Diego Mayer
@Chrono79
Jul 03 2016 03:05

@Chrono79 here: "Here is a backslash: \.\n\t\tHere is a new line with two tabs.";

you have 2 spaces after : @geecheeche
I think you have var myStr = before that don't you?

Bnobo
@acloud12345678
Jul 03 2016 03:06
i need help with Escape Sequences in Strings
please
Diego Mayer
@Chrono79
Jul 03 2016 03:06
@acloud12345678 look a few posts above
we're already discussing it
geecheechee
@geecheeche
Jul 03 2016 03:07
@Chrono79 this is whole piece of code that I am dealing with:
var myStr; "Here is a backslash: \.\n\t\tHere is a new line with two tabs.";
Diego Mayer
@Chrono79
Jul 03 2016 03:08
var myStr ; "Here is a backslash: \.\n\t\tHere is a new line with two tabs.";
replace the ; after myStr with =
geecheechee
@geecheeche
Jul 03 2016 03:08
@Chrono79 I realized that I had not put the assignment = after myStr
@Chrono79 You are a legend. minstrels will sing songs about you mate! Thanks a dozen.
CamperBot
@camperbot
Jul 03 2016 03:09
geecheeche sends brownie points to @chrono79 :sparkles: :thumbsup: :sparkles:
:star2: 1405 | @chrono79 |http://www.freecodecamp.com/chrono79
Diego Mayer
@Chrono79
Jul 03 2016 03:10
:+1:
Bnobo
@acloud12345678
Jul 03 2016 03:11
@Chrono79 thanks
CamperBot
@camperbot
Jul 03 2016 03:11
acloud12345678 sends brownie points to @chrono79 :sparkles: :thumbsup: :sparkles:
:warning: acloud12345678 already gave chrono79 points
geecheechee
@geecheeche
Jul 03 2016 03:11
@acloud12345678 which exercise, I just managed to get one done correctly with the help of @Chrono79 . I would be glad to walk you through it.
Bnobo
@acloud12345678
Jul 03 2016 03:11
@geecheeche okay
then can you help me with Concatenating Strings with Plus Operator
Ayush Ojha
@ashojha21
Jul 03 2016 03:12
help needed.. Profile Lookup javascript
CamperBot
@camperbot
Jul 03 2016 03:12
no wiki entry for: needed profile lookup javascript
Juan Moraza
@Morazajuan
Jul 03 2016 03:12

Hello Campers! i dont get why the challenge objective isnt still checked. im getting what the objective is asking me.
The challenge its called "Record Collection", and the second objective is the one im talking about. here is my code
```

// Setup
var collection = {
"2548": {
"album": "Slippery When Wet",
"artist": "Bon Jovi",
"tracks": [
"Let It Rock",
"You Give Love a Bad Name"
]
},
"2468": {
"album": "1999",
"artist": "Prince",
"tracks": [
"1999",
"Little Red Corvette"
]
},
"1245": {
"artist": "Robert Palmer",
"tracks": [ ]
},
"5439": {
"album": "ABBA Gold"
}

};
// Keep a copy of the collection for tests
var collectionCopy = JSON.parse(JSON.stringify(collection));

// Only change code below this line
function updateRecords(id, prop, value) {
console.log(id);
console.log(collection[id][prop]);

if(prop !== collection[id][prop] ){
collection[id][prop]= value;

}else{
delete collection[id][prop];
}
if (collection[id][prop] === ""){
delete collection[id][prop];
}else{
//delete collection[id][prop];

}
return collection;
}

var trackObj= "tracks";
var trackName= collection[trackObj];
console.log(trackName);

// Alter values below to test your code
updateRecords(5439, "tracks", "Take a Chance on Me");

```

geecheechee
@geecheeche
Jul 03 2016 03:13
@acloud12345678 make sure you provide for space between the + operator and the strings.
Diego Mayer
@Chrono79
Jul 03 2016 03:13
@ashojha21 copy only your function (we already know the setup)
Bnobo
@acloud12345678
Jul 03 2016 03:13
@geecheeche ok, let me try
Billel
@lelbil
Jul 03 2016 03:13
Hi everyone. Can I ask you if there is a way to use recursion in a javascript function. We learned some basic Ocaml and recursion in uni and that's the type of function I want to use for the challenge of flattening an array in Front End medium algorithm challenges. Thank you
Bryan Raynor
@bryanraynor
Jul 03 2016 03:14
@Morazajuan I would help you but I am stuck on the same one.
Bnobo
@acloud12345678
Jul 03 2016 03:14
@geecheeche ok it worked, thanks
CamperBot
@camperbot
Jul 03 2016 03:14
acloud12345678 sends brownie points to @geecheeche :sparkles: :thumbsup: :sparkles:
:warning: acloud12345678 already gave geecheeche points
Billel
@lelbil
Jul 03 2016 03:14
haha want to go on private and try pair coding ? @Morazajuan
geecheechee
@geecheeche
Jul 03 2016 03:15
@acloud12345678 Cheers mate!
Diego Mayer
@Chrono79
Jul 03 2016 03:15
@Morazajuan this isn't what you have to do:
if(prop !== collection[id][prop] ){
Delete this:
var trackObj= "tracks";
var trackName= collection[trackObj];
console.log(trackName);
Billel
@lelbil
Jul 03 2016 03:16
ew sorry @Morazajuan I didn't mean to mention you
oh*
Bnobo
@acloud12345678
Jul 03 2016 03:16
@geecheeche wait, can you explain Concatenating Strings with the Plus Equals Operator to me?
Diego Mayer
@Chrono79
Jul 03 2016 03:17
@lelbil yes, you can use recursion in javascript
Norvin Burrus
@ndburrus
Jul 03 2016 03:17
Billel
@lelbil
Jul 03 2016 03:19
@ndburrus @Chrono79 Thanks, I'm exited to know I'm actually going to use concepts I learned in school lol. starting to read right away
CamperBot
@camperbot
Jul 03 2016 03:19
lelbil sends brownie points to @ndburrus and @chrono79 :sparkles: :thumbsup: :sparkles:
:star2: 1406 | @chrono79 |http://www.freecodecamp.com/chrono79
:cookie: 791 | @ndburrus |http://www.freecodecamp.com/ndburrus
Norvin Burrus
@ndburrus
Jul 03 2016 03:20
@lelbil you're welcome! :cake:
Joseph
@revisualize
Jul 03 2016 03:20

@Morazajuan
You are given a JSON object representing a part of your musical album collection. Each album has several properties and a unique id number as its key. Not all albums have complete information.

Write a function which takes an album's id (like 2548), a property prop (like "artist" or "tracks"), and a value (like "Addicted to Love") to modify the data in this collection.

If prop isn't "tracks" and value isn't blank, update or set the value for that record album's property.

Your function must always return the entire collection object.

There are several rules for handling incomplete data:

If prop is "tracks" but the album doesn't have a "tracks" property, create an empty array before adding the new value to the album's corresponding property.

If prop is "tracks" and value isn't blank, push the value onto the end of the album's existing tracks array.

If value is blank, delete that property from the album.

Diego Mayer
@Chrono79
Jul 03 2016 03:22
@revisualize do you know how much time will it take for that text change to finally happen?
Joseph
@revisualize
Jul 03 2016 03:24
@Chrono79 No idea.
Diego Mayer
@Chrono79
Jul 03 2016 03:25
Hopefully soon I guess
Joseph
@revisualize
Jul 03 2016 03:25
I wish.
vaibhav sharma
@vaibsharma
Jul 03 2016 03:25
hey! everyone .. Is there any way that I can delete or i can ignore non alphanumerics.
?
*in a string
Diego Mayer
@Chrono79
Jul 03 2016 03:26
@vaibsharma with replace and a regex
help regex
CamperBot
@camperbot
Jul 03 2016 03:26

:point_right: js regex resources [wiki]

Regular Expressions Resources

Links to useful RegEx resources.

See also: :clipboard: Tutorials | :syringe: Testing | :soccer: Games | :newspaper: Blogs | :package: Software

:pencil: read more about js regex resources on the FCC Wiki

Khaleel Syed
@khaleelsyed
Jul 03 2016 03:28

Hi guys, I was wondering if I could have a hint or two? I'm stuck in my algorithm challenge:
https://github.com/khaleelsyed/challenges_freecodecamp/blob/master/basic_algorithm/Return_Largest_Numbers_Arrays.js

I just can't get it to work properly! It's the "Return Largest Numbers in Arrays". Any help would be really awesome!

Diego Mayer
@Chrono79
Jul 03 2016 03:28
@khaleelsyed can you show some code?
Khaleel Syed
@khaleelsyed
Jul 03 2016 03:29
@Chrono79 I posted the code on GitHub with my link.
function largestOfFour(arr) {
  var i=0,j=0,k=[0,0,0,0];
  while(i<4){ //Probably a problem with the first loop as i refuses to follow the direction of the loop.
    while(j<4){
      if(arr[i][j]>k[i]){
        k[i]=arr[i][j]; //Solved part of the issue!
      }
      j++;
    }
    i++;
  }
  return k; //Returns [5,0,0,0]
}
largestOfFour([[4, 5, 1, 3],[13, 27, 18, 26],[32, 35, 37, 39],[1000, 1001, 857, 1]]);
Diego Mayer
@Chrono79
Jul 03 2016 03:31
@khaleelsyed reset j to 0 before i++
Khaleel Syed
@khaleelsyed
Jul 03 2016 03:32
@Chrono79 Damn that makes sense! I'll go and see if that works. Thank you!
CamperBot
@camperbot
Jul 03 2016 03:32
khaleelsyed sends brownie points to @chrono79 :sparkles: :thumbsup: :sparkles:
:star2: 1407 | @chrono79 |http://www.freecodecamp.com/chrono79
Khaleel Syed
@khaleelsyed
Jul 03 2016 03:34
@Chrono79 Wait, how can I make that work out? I've got a while loop. If I make j=0 within the loop, we're going to have a problem - infinite loop thingy. So how can I overcome that?
@Chrono79 that was a ridiculously silly question. Sorry, I solved it now.
Diego Mayer
@Chrono79
Jul 03 2016 03:36
:+1:
@khaleelsyed if you used for loops instead of while loops the reset would be automagical ;)
you could also use .length instead of hardcoding 4, but in this case both ways work
Bryan Raynor
@bryanraynor
Jul 03 2016 03:39
So, is it normal to solve a challenge and not understand what you did to solve it?
Diego Mayer
@Chrono79
Jul 03 2016 03:39
@bryanraynor do you have split personality?
:P
Bryan Raynor
@bryanraynor
Jul 03 2016 03:40
nope, I just think I got lucky.
Khaleel Syed
@khaleelsyed
Jul 03 2016 03:40
@Chrono79 YES! You're right! That totally makes sense. Thanks for the wisdom. I really appreciate these small tips! And yes, .length would work, but I thought 4 would just make it simple, but the challenge explicitly stated that the array would be of length 4 and so would the sub-array.
CamperBot
@camperbot
Jul 03 2016 03:40
khaleelsyed sends brownie points to @chrono79 :sparkles: :thumbsup: :sparkles:
:warning: khaleelsyed already gave chrono79 points
Khaleel Syed
@khaleelsyed
Jul 03 2016 03:40
@bryanraynor What do you mean by that?
Bryan Raynor
@bryanraynor
Jul 03 2016 03:40
I copied into notepad so I can review it later. I'm going to have to pencil and paper my way through this to understand it.
as far as getting lucky, I just kept throwing different lines of code in till something worked.
Khaleel Syed
@khaleelsyed
Jul 03 2016 03:41
was that directed towards me? If it was, I would appreciate any feedback.
Diego Mayer
@Chrono79
Jul 03 2016 03:41
@khaleelsyed no, he was talking about himself I guess
Khaleel Syed
@khaleelsyed
Jul 03 2016 03:41
@bryanraynor Well, that isn't really a great way, I mean once it works, you're probably going to spend 15 minutes figuring out why it worked, unless you don't really care.
Bryan Raynor
@bryanraynor
Jul 03 2016 03:42
At least I have it saved on notepad to look at again later.
Diego Mayer
@Chrono79
Jul 03 2016 03:42
@bryanraynor not the best way of doing things, better is reducing the complexity
and making sure each little thing works as you expect them to do
Abhishek Baliyan
@abhishekdevinfo
Jul 03 2016 03:43
Need help in javascript
Diego Mayer
@Chrono79
Jul 03 2016 03:43
you're in the right place @abhishekdevinfo
Bryan Raynor
@bryanraynor
Jul 03 2016 03:43
Ahh, I do know the "proper" way to code. (I am a c# developer) Just something in this exercise was not working so I finally took the weirdest approach to solve it and it worked.
Khaleel Syed
@khaleelsyed
Jul 03 2016 03:43
@bryanraynor Well I don't think anyone actually "edits" on the freecodecamp site, I used to edit on Atom until I discovered Cloud9 IDE and now I pretty much use it to do all my work. I can easily shift my machines from my dad's Mac, my bro's windows laptop to my awesome Arch desktop.
Abhishek Baliyan
@abhishekdevinfo
Jul 03 2016 03:44
@Chrono79 i have problem in Record Collection in Java-script
Diego Mayer
@Chrono79
Jul 03 2016 03:45
:point_up: 3 de julio de 2016 0:20 read these improved instructions @abhishekdevinfo
Khaleel Syed
@khaleelsyed
Jul 03 2016 03:45
And having a pen and paper beside me really helps me breakdown the issue, half the time though, I just scribble all the variables and the solution I should be achieving, it makes me feel like my mind is working. No idea how much it actually helps me xD
Abhishek Baliyan
@abhishekdevinfo
Jul 03 2016 03:45
@Chrono79 ok
Bryan Raynor
@bryanraynor
Jul 03 2016 03:46
@abhishekdevinfo Thats the one I just finished. The new improved directions worked wonders to understand what was happening.
On a side note, I finally figured out what I actually did and why it works. Hurray for patience.
Diego Mayer
@Chrono79
Jul 03 2016 03:46
:+1:
Ayush Ojha
@ashojha21
Jul 03 2016 03:47
hey there
i am stuck in a javascript problem
anyone there for help?
Bryan Raynor
@bryanraynor
Jul 03 2016 03:47
which problem and whats the issue
Diego Mayer
@Chrono79
Jul 03 2016 03:47
just paste the code and some js fairy will help you @ashojha21 ;)
it's a kind of magic :musical_score:
jake-thewoz
@jake-thewoz
Jul 03 2016 03:48
Has anyone else had trouble with the "convert to html entities" challenge? My solution definitely works, but it's saying it's not
Diego Mayer
@Chrono79
Jul 03 2016 03:49
@jake-thewoz show your code and we'll see how definitely it works
jake-thewoz
@jake-thewoz
Jul 03 2016 03:49

function convertHTML(str) {
var strArr = str.split('');
for (var i in strArr) {

  switch (strArr[i]) {
    case "&":
      strArr[i] = "&amp;";
      break;
    case "<":
      strArr[i] = "$lt;";
      break;
    case ">":
      strArr[i] = "$gt;";
      break;
    case "\"":
      strArr[i] = "$quot;";
      break;
    case "'":
      strArr[i] = "$apos;";
      break;

}

}
str = strArr.join('');
return str;
}

convertHTML("Dolce & Gabbana");

hahaha okay, nvm
jess
@jessmear
Jul 03 2016 03:50
i got stuck on how to make an api call in javascript a while ago... anyone have a good link to something about that
jake-thewoz
@jake-thewoz
Jul 03 2016 03:50
looks like I have some $s instead of & for the html entities
wow. :P
Diego Mayer
@Chrono79
Jul 03 2016 03:51
@jake-thewoz the devil is in the details ;)
jake-thewoz
@jake-thewoz
Jul 03 2016 03:54
^^
96street
@96street
Jul 03 2016 03:55
I did what you said @Chrono79 It worked but now i'm trying to add a placeholder image if there is no image available http://codepen.io/kingdezz/pen/VjbWRK?editors=0110
Diego Mayer
@Chrono79
Jul 03 2016 03:55
@jayelbe not really, can you use jquery or vanilla javascript only?
I don't read it all: https://www.sitepoint.com/ajaxjquery-getjson-simple-example/ but that can help I guess
96street
@96street
Jul 03 2016 03:55
but it screwed up
Luis
@LGgit
Jul 03 2016 03:56
hello all, i think i might have a scope issue im hoping someone can help with... tic tac toe game.. if I click "x" then T1.. T1 should update to X but it doesn't http://codepen.io/atreides326/pen/ZOKNpL
jess
@jessmear
Jul 03 2016 03:57
@Chrono79 It could be anything I think, because it's for the Random Quote Machine
Diego Mayer
@Chrono79
Jul 03 2016 03:58
@96street you do know that with this: $('img').attr('src', '#'); you're targeting all img elements of your page don't you?
@jayelbe I suggest using getJSON then
jess
@jessmear
Jul 03 2016 04:00
i will google that, thank you!
Diego Mayer
@Chrono79
Jul 03 2016 04:06

@96street

    for(var page in pages) { 
     var imgSrc = pages[page].hasOwnProperty("thumbnail") ? pages[page].thumbnail.source : "the other image src here";
      resultList.append('<li>' + '<img src=' + imgSrc + '>' + '<h2>' + pages[page].title + '</h2>' + '<p>' + pages[page].extract + '</p>' + '</li>');
    }

Try something like this instead

Shabz17
@Shabnam17
Jul 03 2016 04:12
Stuck up here..
var Bike = function() {

  // Only change code below this line.
var gear=0;

  this.getGear=function(){
    return gear;
  };
  this.setGear=function(change){
    gear += change;
  };
};

var myCar = new Car();

var myBike = new Bike();
myBike.setGear(change);
Diego Mayer
@Chrono79
Jul 03 2016 04:13
@Shabnam17 setGear should set, not increase as its name suggest
tkruger3902
@tkruger3902
Jul 03 2016 04:13

Can't figure this challenge out: function wordBlanks(myNoun, myAdjective, myVerb, myAdverb) {
var result = "The big dog ran quickly";
// Your code below this line
result = '"The " + myAdjective + myNoun + myVerb + myAdverb.';

// Your code above this line
return result;
}

// Change the words here to test your function
wordBlanks("dog", "big", "ran", "quickly");

Anyone know what the heck is going on?
Diego Mayer
@Chrono79
Jul 03 2016 04:13
+= increase, = set @Shabnam17
Shabz17
@Shabnam17
Jul 03 2016 04:13
it throws an error like "change is not defined" I tried declaring change like "var change=0;" below gear property, even then not resolved
Diego Mayer
@Chrono79
Jul 03 2016 04:14
@Shabnam17 myBike.setGear(change); because of this line, you should use a number there
Shabz17
@Shabnam17
Jul 03 2016 04:14
ohh ok.. lemme try
Diego Mayer
@Chrono79
Jul 03 2016 04:15
@tkruger3902 reset your challenge and only touch below // Your code below this line and above // Your code above this line
Shabz17
@Shabnam17
Jul 03 2016 04:15
@Chrono79 Sorry.. could u make it more clear?
Diego Mayer
@Chrono79
Jul 03 2016 04:16
@Shabnam17
var Bike = function() {

  // Only change code below this line.
var gear=0;

  this.getGear=function(){
    return gear;
  };
  this.setGear=function(change){
    gear += change; // here use = instead of +=
  };
};

var myCar = new Car();

var myBike = new Bike();
myBike.setGear(change); // change doesn't exist here, use a number like 4
Palakurthi Durga Kiran Kumar
@durgakiran
Jul 03 2016 04:16

i am stuck in Return Early Pattern for Functions. this is my code function abTest(a, b) {
// Only change code below this line
if (a||b<0){
return undefined;
}

// Only change code above this line

return Math.round(Math.pow(Math.sqrt(a) + Math.sqrt(b), 2));
}

// Change values below to test your code
abTest(2,2);

Diego Mayer
@Chrono79
Jul 03 2016 04:17
@tkruger3902 read mad libs link and review this challenge: https://www.freecodecamp.com/challenges/constructing-strings-with-variables
@durgakiran this is wrong: if (a||b<0){
that says if a is not false or b <0, and a being a number means that a != 0
Palakurthi Durga Kiran Kumar
@durgakiran
Jul 03 2016 04:17
i think i didn't understand the challenge
got it thanks @Chrono79
CamperBot
@camperbot
Jul 03 2016 04:18
durgakiran sends brownie points to @chrono79 :sparkles: :thumbsup: :sparkles:
:star2: 1408 | @chrono79 |http://www.freecodecamp.com/chrono79
Diego Mayer
@Chrono79
Jul 03 2016 04:18
@durgakiran you have to repeat <0 in both sides of the ||
Shabz17
@Shabnam17
Jul 03 2016 04:18
Resolved! thanks @Chrono79
CamperBot
@camperbot
Jul 03 2016 04:18
shabnam17 sends brownie points to @chrono79 :sparkles: :thumbsup: :sparkles:
:star2: 1409 | @chrono79 |http://www.freecodecamp.com/chrono79
tkruger3902
@tkruger3902
Jul 03 2016 04:21
Is any of what I put in the correct area correct? @Chrono79 Because I feel like a newborn baby...I have no clue what I am supposed to do. I reviewed the challenge you recommended I review, but I can't seem to apply it. Sorry :/
Khaleel Syed
@khaleelsyed
Jul 03 2016 04:21
I'm really stuck with this algorithm: "Titlecase a sentence", been on this for 2 days and still going no where, I know I'm so close. Any pointers, O'wise Javascript Wizards? My Code on GitHub: https://github.com/khaleelsyed/challenges_freecodecamp/blob/master/basic_algorithm/Titlecase.js
Diego Mayer
@Chrono79
Jul 03 2016 04:22
@tkruger3902 '"The " + myAdjective + myNoun + myVerb + myAdverb.'; this is a string literally it is this string: "The " + myAdjective + myNoun + myVerb + myAdverb.
remove the single quotes and then add some words and/or spaces between your vars, otherwise they'll end up joined in a single non existent word
Sean DiSanti
@badc0ded
Jul 03 2016 04:24
@khaleelsyed what have you got for code? and what test(s) are failing?
tkruger3902
@tkruger3902
Jul 03 2016 04:25
Thanks @Chrono79
CamperBot
@camperbot
Jul 03 2016 04:25
tkruger3902 sends brownie points to @chrono79 :sparkles: :thumbsup: :sparkles:
:star2: 1410 | @chrono79 |http://www.freecodecamp.com/chrono79
Khaleel Syed
@khaleelsyed
Jul 03 2016 04:26

well, I've got the code up on my Repo: https://github.com/khaleelsyed/challenges_freecodecamp/blob/master/basic_algorithm/Titlecase.js

My issue is, it just isn't capitalising what needs to be capitalised. The function ".toUpperCase()" just isn't working, I've looked everywhere on the internet, and that's the correct way to have it. I don't know where I'm going wrong.

Sean DiSanti
@badc0ded
Jul 03 2016 04:26
ok, one sec will take a look
Khaleel Syed
@khaleelsyed
Jul 03 2016 04:27
@badc0ded Thanks
CamperBot
@camperbot
Jul 03 2016 04:27
khaleelsyed sends brownie points to @badc0ded :sparkles: :thumbsup: :sparkles:
:cookie: 392 | @badc0ded |http://www.freecodecamp.com/badc0ded
Diego Mayer
@Chrono79
Jul 03 2016 04:27
@khaleelsyed toUpperCase doesn't modify the letter for itself, you have to assign that to something (like arr1[i][0])
and add the joins
Sean DiSanti
@badc0ded
Jul 03 2016 04:27
no problem
as @Chrono79 says, toUpperCase returns a value
Khaleel Syed
@khaleelsyed
Jul 03 2016 04:28
@Chrono79 I've tried that too. It doesn't work.
hang on, I'll show an example
Diego Mayer
@Chrono79
Jul 03 2016 04:28
@khaleelsyed yes it does
Sean DiSanti
@badc0ded
Jul 03 2016 04:30
i am making some changes to your code and will post with explanation
There, it doesn't work. =(
Diego Mayer
@Chrono79
Jul 03 2016 04:33
@khaleelsyed
function titleCase(str) {
  var arr=[""],i,arr1=[""];
  arr=str.toLowerCase().split(" ");
  for(i=0;i<arr.length;i++){
    arr1[i]=arr[i].split("");
  }
  for(i=0;i<arr.length;i++){
    arr1[i][0] = arr1[i][0].toUpperCase(); //yes, it does the job
    arr1[i] = arr1[i].join("");
  }
  return arr1.join(" ");
}
titleCase("sHoRt AnD sToUt");
Khaleel Syed
@khaleelsyed
Jul 03 2016 04:33
It works, can I have a walkthrough please?
Diego Mayer
@Chrono79
Jul 03 2016 04:35
@khaleelsyed arr[i] were your words, so why would you store the capital letters there and then return arr1[0][0]?
Khaleel Syed
@khaleelsyed
Jul 03 2016 04:35
The return, that was just to show you guys it wasn't working
Sean DiSanti
@badc0ded
Jul 03 2016 04:36
also you're initializing arr twice
and to initialize an empty array you just do []
[""] is a single element array that contains an empty string
Khaleel Syed
@khaleelsyed
Jul 03 2016 04:39

Alright, I'll keep that in mind for the future @badc0ded

@Chrono79 I just checked on a comparison site: https://www.diffchecker.com/btidnqda
I feel like an idiot, why did I try to do arr[i]=arr1[i][0].toUpperCase(); , that still is a wonder to me.

I'm grateful to both of you, I really better stop making these silly mistakes.

Diego Mayer
@Chrono79
Jul 03 2016 04:39
function titleCase(str) {
  var arr=str.toLowerCase().split(" ");
  for(var i=0;i<arr.length;i++){
    arr[i] = arr[i].charAt(0).toUpperCase() + arr[i].slice(1);
  }
  return arr.join(" ");
}
titleCase("sHoRt AnD sToUt");
less loops
Khaleel Syed
@khaleelsyed
Jul 03 2016 04:40
I can't remember what I done yesterday, but I made a fundamental error yesterday too. I gotta stop
tkruger3902
@tkruger3902
Jul 03 2016 04:41
Screen Shot 2016-07-02 at 9.40.31 PM.png
No worries @khaleelsyed . At least you aren't stuck on this basic challenge. How do I get this last box checked so I can move on with my life?
Diego Mayer
@Chrono79
Jul 03 2016 04:42
@tkruger3902 use your function parameters, not all strings, that's why I told you to review that other challenge, so you see how to construct a string with vars
Khaleel Syed
@khaleelsyed
Jul 03 2016 04:43
@tkruger3902 use the variables in the above function wordBlanks(var1,var2,var3,var4)
Using them in the thing will solve your problem
Diego Mayer
@Chrono79
Jul 03 2016 04:43
@khaleelsyed not all, missing spaces for instance
Khaleel Syed
@khaleelsyed
Jul 03 2016 04:44
@Chrono79 yes! indeed
jess
@jessmear
Jul 03 2016 04:45
One thing that helps me is to try to track down each little piece of what is going wrong. So right now you are stuck with struggling with getting toUpperCase to work, so build something very tiny to see how it works or if you can get it to work at all
for instance:
var myString = "asdf asdf asdf".toUpperCase();
console.log(myString);
vaibhav sharma
@vaibsharma
Jul 03 2016 04:46
I want to replace non alphanumeric with the "" . Is this the way I should be doin' it ?.
Diego Mayer
@Chrono79
Jul 03 2016 04:46
@tkruger3902 I'm gonna give you a simple example code:
var myString1 = "Hello";
var myString2 = "world!";
var myJoinedString = myString1 + " " + myString2; // this is "Hello World" with a space between my 2 vars see?
vaibhav sharma
@vaibsharma
Jul 03 2016 04:47
var newstr = str.replace(/[^\w]*/,"");
Diego Mayer
@Chrono79
Jul 03 2016 04:48
@vaibsharma no, use g modifier and instead of [^\w]* use [\W]
You have to get rid of underscores too, so the above regex isn't the final one
Norvin Burrus
@ndburrus
Jul 03 2016 04:48
@tkruger3902 the space trailing the sentence punctuation may be an issue. :cactus:
tkruger3902
@tkruger3902
Jul 03 2016 04:49
Whenever I try to do : var myNoun, it says myNoun is already defined.
vaibhav sharma
@vaibsharma
Jul 03 2016 04:49
then How should I do make this done ? @Chrono79
Diego Mayer
@Chrono79
Jul 03 2016 04:49
@tkruger3902 don't define it again, as I said, I was giving you a simple example.
But you can see how you add a space between vars don't you? And those vars (in your case, your function params) haven't quotes around?
tkruger3902
@tkruger3902
Jul 03 2016 04:56
var myString1 = "I" myFinal = "Yes," + myString1 + "understand."
Like this?
Diego Mayer
@Chrono79
Jul 03 2016 04:56
@tkruger3902 a freebie for you, complete it
result = "My " + myAdjective + " " + ... ;
You aren't leaving spaces between your strings and your vars there, so your myFinal value will be "Yes,Iunderstand."
The spaces that count are encased between quotes, so you could write myFinal = "Yes, " + myString1 + " understand."
tkruger3902
@tkruger3902
Jul 03 2016 04:59
result = "The" + myAdjective + " " + myNoun + " " + myVerb + " " + myAdverb + ".";
Diego Mayer
@Chrono79
Jul 03 2016 05:00
@tkruger3902 add a space after The and before ", like this "The "
tkruger3902
@tkruger3902
Jul 03 2016 05:01
Ok, I understand. That's extremely simple but I just couldn't understand what they were asking for. Thank you for walking me though that.
Thank you @Chrono79
CamperBot
@camperbot
Jul 03 2016 05:01
tkruger3902 sends brownie points to @chrono79 :sparkles: :thumbsup: :sparkles:
:warning: tkruger3902 already gave chrono79 points
Diego Mayer
@Chrono79
Jul 03 2016 05:02
@tkruger3902 no problem, now that you know how it works, you can add some more words to the sentence
like an "always" or "blue" or think of something else, like the mad libs link
tkruger3902
@tkruger3902
Jul 03 2016 05:03
result = "The " + myAdjective + " " + myNoun + " " + myVerb + " " + myAdverb + " " + "through " + " " + "park. ";
There is a "the" there at the end lol
Diego Mayer
@Chrono79
Jul 03 2016 05:04
@tkruger3902 better, you can make this "through " + " " + "park. " into only one string
"through the park. "
tkruger3902
@tkruger3902
Jul 03 2016 05:04
"through the park. "; ??
Diego Mayer
@Chrono79
Jul 03 2016 05:04
yes
tkruger3902
@tkruger3902
Jul 03 2016 05:05
Great, thank you @Chrono79
CamperBot
@camperbot
Jul 03 2016 05:05
tkruger3902 sends brownie points to @chrono79 :sparkles: :thumbsup: :sparkles:
:warning: tkruger3902 already gave chrono79 points
Diego Mayer
@Chrono79
Jul 03 2016 05:05
@tkruger3902 refactor your code (not only this one, maybe you don't want to see it anymore) when you have more tools to work with
Phillip
@phillipjg
Jul 03 2016 05:06
Hi, I'm working on the profile lookup challenge, but I'm having trouble.
'''
function lookUpProfile(firstName, prop){
// Only change code below this line
for (var i = 0; i < contacts.length; i++) {
if (firstName == contacts[i].firstName) {
if (contacts[i].hasOwnProperty(prop)) {
return contacts[i][prop];
}
else return "No such property";
}
return "No such contact";
}
}
'''
Diego Mayer
@Chrono79
Jul 03 2016 05:06
you'll discover you can make your code shorter or better later
@phillipjg when are you sure about this sentence? return "No such contact";
I mean when can you say someone isn't there? After you've looked for each and every contact, don't you?
Where in your code does that happen?
Phillip
@phillipjg
Jul 03 2016 05:11
@Chrono79 I want to return "no such contact" after exhausting every other option after the loop has completed.
Diego Mayer
@Chrono79
Jul 03 2016 05:11
bingo, move it outside of your loop then, and before your function end
Phillip
@phillipjg
Jul 03 2016 05:14
I recognize that it works when I move that statement outside the loop, but I'm confused because the output within the FCC sidebar displays a property from the object, it's just the wrong property. Shouldn't the problem be that it's returning "no such contact" instead of returning a property?
Diego Mayer
@Chrono79
Jul 03 2016 05:16
@phillipjg / Change these values to test your function
lookUpProfile("Bob", "number"); <- is this the test you're using?
Phillip
@phillipjg
Jul 03 2016 05:18
@Chrono79 ah, that's it. Thanks for the help!
CamperBot
@camperbot
Jul 03 2016 05:18
phillipjg sends brownie points to @chrono79 :sparkles: :thumbsup: :sparkles:
:star2: 1411 | @chrono79 |http://www.freecodecamp.com/chrono79
Abhishek Baliyan
@abhishekdevinfo
Jul 03 2016 05:28
@Chrono79 need help in javascript record collection
would u please see my code
Diego Mayer
@Chrono79
Jul 03 2016 05:29
@abhishekdevinfo paste it, only your function
Abhishek Baliyan
@abhishekdevinfo
Jul 03 2016 05:29
function updateRecords(id, prop, value) {
  if ( collection[id].hasOwnProperty(prop) !== 0 ) {
    collection[id][prop] = value;
  } 
  if( collection[id].hasOwnProperty("tracks") ) {
    if( collection[id].tracks.length === 0 ){
      delete collection[id].tracks;      
    }    
  }
  else {
    collection[id].tracks = [];
    collection[id].tracks.push("The last one","Take a Chance on Me");
  }

  return collection;
}
Diego Mayer
@Chrono79
Jul 03 2016 05:32
:point_up: 3 de julio de 2016 0:20 read this improved instructions @abhishekdevinfo
@abhishekdevinfo and you're not using the methods well, for instance: collection[id].hasOwnProperty(prop) returns true or false
Abhishek Baliyan
@abhishekdevinfo
Jul 03 2016 05:35
@Chrono79 ok give me some time
vaibhav sharma
@vaibsharma
Jul 03 2016 05:39
@Chrono79 hey ! can you tell me the difference between these two regex (?=a)b and (?<=a)b ? I couldn't understand it ?
Diego Mayer
@Chrono79
Jul 03 2016 05:42
@vaibsharma http://www.regular-expressions.info/refadv.html
The first one is called a positive lookahead and the second a positive lookbehind JavaScript do not support lookbehind.
vaibhav sharma
@vaibsharma
Jul 03 2016 05:46
but what that exactly means ? does that mean .. <=a is all the character having ASCII value less than 'a'? @Chrono79
Diego Mayer
@Chrono79
Jul 03 2016 05:47
no
it'll match all bs that are immediatly preceded by an a
tylerprosper
@removed~tylerprosper
Jul 03 2016 05:49
Hey guys can anybody point out what I'm doing incorrectly here?

var myStr= "Here is a backslash: \\.\n
\t\t    Here is a new line with two tabs.";
Ananay
@ananaymital
Jul 03 2016 05:51
make it a single line
remove enter after \n
tylerprosper
@removed~tylerprosper
Jul 03 2016 05:51
@Deadpool37 oh ok. thx
CamperBot
@camperbot
Jul 03 2016 05:51
tylerprosper sends brownie points to @deadpool37 :sparkles: :thumbsup: :sparkles:
:cookie: 258 | @deadpool37 |http://www.freecodecamp.com/deadpool37
vaibhav sharma
@vaibsharma
Jul 03 2016 05:51
@Chrono79 thanks but still I am not getting it :(
CamperBot
@camperbot
Jul 03 2016 05:51
vaibsharma sends brownie points to @chrono79 :sparkles: :thumbsup: :sparkles:
:star2: 1412 | @chrono79 |http://www.freecodecamp.com/chrono79
Ananay
@ananaymital
Jul 03 2016 05:52
can someone help me in seek and destroy challenge?
function destroyer(arr) {
  var arg = Array.prototype.slice.call(arguments,1);
  arr.filter(function(val){
    for(var i=0; i < arg.length; i++){
      if(val==arg[i]){
        var index = arr.indexOf(val);
        delete arr[index];
      }
    }
    return arr;
  });
  return arr;
}
Diego Mayer
@Chrono79
Jul 03 2016 05:54
@Deadpool37 delete is for object properties, use filter instead inside the loop, instead of the loop inside the filter
Ananay
@ananaymital
Jul 03 2016 05:54
when I call this destroyer([1,2, 3,5,1, 2, 3], 3,2);
it returns [1,null,null,5,1,null,null]
Avinash Kuduvalli
@manicmarvin
Jul 03 2016 05:55
@Deadpool37 if you do want to use slice.call (which is bad in the future for optimisation) you need arguments,0 otherwise var args = arr will work fine.
@Deadpool37 Use filter with a call back function defined outside of the loop, Not delete
Ananay
@ananaymital
Jul 03 2016 05:57
I don't get it
how do I do that?
this code works fine
I need another way of removing a value from an array
Avinash Kuduvalli
@manicmarvin
Jul 03 2016 06:02

@Deadpool37 You also need to record all the values to be seeded in another array.
Like seeks = arguments(1);
Then set up a function, let's says destroyIt

function destroyIt(value) {
if (value !== seeks[i])
return value;
}

then inside your for loop call the filter with the destroyIt callback.

also, you need your loop to iterate through the seeks, i.e. seeks.length not arg.

@Deadpool37 but if you want to stick to using only one array, arg, rethink and use the filter method
Avinash Kuduvalli
@manicmarvin
Jul 03 2016 06:08

Can somebody help me figure out why my Where Do I Belong code wont work for only one kind of test, where the number fits between the the last and the second last elements of the array.

Here's the code

function getIndexToIns(arr, num) {
  // Find my place in this sorted array.
  index = arr.length;
  if (num < arr[0])
    index= 0;
  for (var i = 0; i < arr.length; i++) {
  if (num === arr[i])
    index = i; 
  else if (num > arr[i] && num < arr[i+1])
    index = i + 1;
    }
  return index;
}

here's the challenge it fails:

getIndexToIns([2, 20, 10], 19) should return 2.

instead it returns 1

OH! Of course, I forgot to sort the array!
edison sim
@Edisonsim
Jul 03 2016 06:37
Hi guys im doing tic tac toe but im still very confuse how to even start writing javascript
Coy Sanders
@coymeetsworld
Jul 03 2016 06:44
@Edisonsim you should probably do the JavaScript challenges as well as the other ziplines first, tic-tac-toe is fairly involved even if you don't make it unbeatable
edison sim
@Edisonsim
Jul 03 2016 06:45
I already done doing those challenge but the problem is say start from scratch how to write it or so
i sat here for hrs trying to find out how to even start it =( @coymeetsworld
Will
@Will-is-Coding
Jul 03 2016 06:46
@Edisonsim Try writing it down in pseudo code or at least as a flow chart on paper/digital
Just the basics
Coy Sanders
@coymeetsworld
Jul 03 2016 06:47
@Edisonsim are you sure? I don't see any JS completed on your page
also don't see any submissions for earlier projects, i would recommend doing those first as they are easier to get done. Try going in the order they give you
as I said Tic-Tac-Toe is pretty involved
edison sim
@Edisonsim
Jul 03 2016 06:50
I mean in codecademy @coymeetsworld
Coy Sanders
@coymeetsworld
Jul 03 2016 06:53
oh ok, well I guess I would recommend starting small @Edisonsim
edison sim
@Edisonsim
Jul 03 2016 06:54
Alright i will give it a try now thanks @coymeetsworld
CamperBot
@camperbot
Jul 03 2016 06:54
edisonsim sends brownie points to @coymeetsworld :sparkles: :thumbsup: :sparkles:
:star2: 1232 | @coymeetsworld |http://www.freecodecamp.com/coymeetsworld
edison sim
@Edisonsim
Jul 03 2016 06:54
Wait where can i write psecudo code?
Coy Sanders
@coymeetsworld
Jul 03 2016 06:54
what do you mean?
edison sim
@Edisonsim
Jul 03 2016 06:55
Will told me earlier on to write down in pseudo code
Coy Sanders
@coymeetsworld
Jul 03 2016 06:55
oh well wherever you want, can be pen and paper or use something like codepen
but main thing is don't try to do too much at once. Start small, make a grid and when you click on it a mark shows up
Will
@Will-is-Coding
Jul 03 2016 06:56
Pseudo code being not valid code https://en.wikipedia.org/wiki/Pseudocode#Syntax It doesn't need to be that formal, but ish. But I think a flow chart of what can and should go on in a typical Tic-Tac-Toe game would be better first then you can write out the pseudo code.
Coy Sanders
@coymeetsworld
Jul 03 2016 06:56
and go from there, find a way for a computer "opponent" to put a mark down
create function to check for win/loss/draw, etc.
try to do all that at once and its going to be a nightmare
Will
@Will-is-Coding
Jul 03 2016 06:57
^ Step at a time
edison sim
@Edisonsim
Jul 03 2016 06:57
U know i actually went to join general assembly for the bootcamp without any coding background and now struggling with JS
JuvasArray
@JuvasArray
Jul 03 2016 07:04
Hi everyone, can someone spot a bug in this for loop:
var fruits = [ "Apple", "Mango", "Banana", "Grapes" ];

for (var i = 0; i < fruits.length; i++) {

  document.write(fruits[i] + "<br>");

}
Dado5
@Dado5
Jul 03 2016 07:07

In the editor you can see an example of a Car constructor that implements this pattern.

Now try it yourself! Modify the Bike constructor to have a private property called gear and two public methods called getGear and setGear to get and set that value.

Chaitanya Mukka
@mukkachaitanya
Jul 03 2016 07:09

Hi people! Can anyone help me with the JS of the following pen??
What I aim to do is to save the latitude and longitude values in lat and log. These values do show up in the Dev Console, but don't seem to add to the apiCall string when added.
http://codepen.io/chaitanyamukka/pen/jAmovV

Thanks in advance.

Norvin Burrus
@ndburrus
Jul 03 2016 07:19
@JuvasArray Which lesson/exercise (name) is this?
JuvasArray
@JuvasArray
Jul 03 2016 07:24
It's not a lesson, just a snippet. Doesn't work on my phone. when I tried with jsfiddle it's worked. :smile:
Norvin Burrus
@ndburrus
Jul 03 2016 07:26
@JuvasArray code result: ReferenceError: document is not defined
this code works:
code:
var fruits = [ "Apple", "Mango", "Banana", "Grapes" ];
for (var i = 0; i < fruits.length; i++) {
  console.log(fruits[i]);
  //document.write(fruits[i] + "<br>");
}
output:
Apple
Mango
Banana
Grapes
Chris Cullen
@123xylem
Jul 03 2016 07:32

function permAlone(str) {
  var duplicates;
 str=str.split("");

  var search=str.forEach(function(x){
     duplicates=0;
 var stop=str.length;
   while(stop>1&&str.lastIndexOf(x)!== -1){
     duplicates++;
     stop--;

   }
     return duplicates;
  }); 



    function factorial(n) {

        if (n === 0) {
            return 1;
        }

        return n * factorial(n - 1); //HERE WE HAVE MAX FACTORIAL OF n BUT I cant return yet before I DIVIDE SO
    }

    function divide(n) { //HERE I MAKE THE DIvision part of the function
        return n * factorial(n - 1)/(n - duplicates);
    }

    return duplicates;
    //divide(factorial(str.length));

}

permAlone('aabb');
Can you help with my duplicates function at the top.. Its returning 3 for aabb but it should be 2 right?
Adam
@alacrity26
Jul 03 2016 07:44
hi, can someone pls help?
function largestOfFour(arr) {
  // You can do this!
  var maxArr=0;
  for (i=0;i<arr.length;i++)
  {
    for (j=0;j<arr[i].length; j++)
    {
      //maxArr=arr[i][j];
      if (arr[i][j]>maxArr)
      {
        maxArr=arr[i][j];
      }

    }
    //return maxArr;

  }
  return maxArr;
}

largestOfFour([[4, 5, 1, 3], [13, 27, 18, 26], [32, 35, 37, 39], [1000, 1001, 857, 1]]);
could find the biggest number, but not from each array itself? what went wrong?
Markus Kiili
@Masd925
Jul 03 2016 07:46
@alacrity26 Initialize maxArr to 0 or -Infinity for each subarray (before j loop) and after j loop assign maxArr to arr[i] (stores the largest number of a subarray). Return arr after i loop.
Another way would be to use an return array and store the largest numbers there, but you can use arr too.
Adam
@alacrity26
Jul 03 2016 07:50
@Masd925 thanks. will try and see how it goes!
CamperBot
@camperbot
Jul 03 2016 07:50
alacrity26 sends brownie points to @masd925 :sparkles: :thumbsup: :sparkles:
:star2: 2023 | @masd925 |http://www.freecodecamp.com/masd925
DJ
@qualitymanifest
Jul 03 2016 07:52
@Masd925 never thought to initialize something to -Infinity. why? just for fun? or for a real reason, like if you want to initialize something with a type of Number but want to prevent Boolean confusion that you may get when initializing to 0 instead? am i thinking too hard about this??
Markus Kiili
@Masd925
Jul 03 2016 07:52
@qualitymanifest To make it also work with negative numbers. Infinity works well as an initial value on such cases.
DJ
@qualitymanifest
Jul 03 2016 07:53
@Masd925 ah, yeah that makes sense. thanks
CamperBot
@camperbot
Jul 03 2016 07:53
qualitymanifest sends brownie points to @masd925 :sparkles: :thumbsup: :sparkles:
:star2: 2024 | @masd925 |http://www.freecodecamp.com/masd925
Jayrex Acilo
@ajayrexluega
Jul 03 2016 08:11

function nextInLine(arr, item) {
// Your code here
testArr.push(item);
var removed = arr.shift();
return removed; // Change this line

}

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

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

how to change this ^?
Markus Kiili
@Masd925
Jul 03 2016 08:12
@ajayrexluega Use function parameters inside the function, not testArr. testArr is used by FCC to test your function.
Jayrex Acilo
@ajayrexluega
Jul 03 2016 08:14
that works thanks :)
@Masd925 thanks a lot :). bdw how to change a code to look like it is in a sublime text editor?
CamperBot
@camperbot
Jul 03 2016 08:14
ajayrexluega sends brownie points to @masd925 :sparkles: :thumbsup: :sparkles:
:star2: 2025 | @masd925 |http://www.freecodecamp.com/masd925
Markus Kiili
@Masd925
Jul 03 2016 08:15
explain format
CamperBot
@camperbot
Jul 03 2016 08:15

:point_right: code formatting [wiki]

Multi line Code

```js ⇦ Type 3 backticks and then press [shift + enter ⏎] (type js or html or css)

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

``` ⇦ Type 3 backticks, then press [enter ⏎]

Single line Code

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

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

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

Jayrex Acilo
@ajayrexluega
Jul 03 2016 08:15
i mean here in chat like others do
santhosh
@santhoshnv
Jul 03 2016 08:16

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

function checkObj(checkProp) {
// Your Code Here
myObj.hasOwnProperty(checkProp);
var found = myObj.gift;
return found ;
}

// Test your code by modifying these values
checkObj("gift");

Jayrex Acilo
@ajayrexluega
Jul 03 2016 08:16

function nextInLine(arr, item) {
// Your code here
arr.push(item);
var removed = arr.shift();
return removed; // Change this line

}

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

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

Markus Kiili
@Masd925
Jul 03 2016 08:16
@santhoshnv myObj.hasOwnProperty(checkProp) returns a boolean. Do something with it.
santhosh
@santhoshnv
Jul 03 2016 08:18
how to solve this
Jack
@jh0l
Jul 03 2016 08:18
why isn't this correct?
var myStr = "Here is a backslash: \\ .\n\t\t Here is a new line with two tabs.";
Evgueni
@Redoras
Jul 03 2016 08:18
I use getJSON to receive data from https://api.twitch.tv/kraken/streams/OgamingSC2 but when trying to extract a value from it, for instance the channel logo url I use data.stream.channel.logo but it doesn't do anything, as if no information is getting called
Markus Kiili
@Masd925
Jul 03 2016 08:18
@santhoshnv Use if to test the .hasOwnProperty return value.
Jayrex Acilo
@ajayrexluega
Jul 03 2016 08:19
@Masd925 how to make it look nice when i send some codes here? i mean like adam do
santhosh
@santhoshnv
Jul 03 2016 08:19
Ok i'll try @Masd925
Markus Kiili
@Masd925
Jul 03 2016 08:20
@ajayrexluega
explain format
CamperBot
@camperbot
Jul 03 2016 08:20

:point_right: code formatting [wiki]

Multi line Code

```js ⇦ Type 3 backticks and then press [shift + enter ⏎] (type js or html or css)

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

``` ⇦ Type 3 backticks, then press [enter ⏎]

Single line Code

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

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

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

Jack
@jh0l
Jul 03 2016 08:21
var myStr = "Here is a backslash: \\ .\n\t\t Here is a new line with two tabs.";
santhosh
@santhoshnv
Jul 03 2016 08:22
it's not work can you explain it @Masd925
Jack
@jh0l
Jul 03 2016 08:22
pls
help
CamperBot
@camperbot
Jul 03 2016 08:22

CamperBot

Hi, I'm CamperBot! I can help you in this chatroom :smile:

Basic Commands:

  • find TOPIC find all entries about topic. e.g. 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

meet CamperBot in FreeCodeCamp/camperbotPlayground

:pencil: read more about camperbot on the FCC Wiki

Norvin Burrus
@ndburrus
Jul 03 2016 08:22
@Jhollond What are you working on (exercise name)?
Jayrex Acilo
@ajayrexluega
Jul 03 2016 08:22

function nextInLine(arr, item) {
// Your code here
arr.push(item);
var removed = arr.shift();
return removed; // Change this line

}

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

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

Jayrex Acilo
@ajayrexluega
Jul 03 2016 08:22

function nextInLine(arr, item) {
// Your code here
arr.push(item);
var removed = arr.shift();
return removed; // Change this line

}

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

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

Jack
@jh0l
Jul 03 2016 08:22
blob
blob
Anush Reddy
@anushreddy
Jul 03 2016 08:23
how to solve chunky monkey ?
Jayrex Acilo
@ajayrexluega
Jul 03 2016 08:23
@Jhollond it has a title, send it here
Sean DiSanti
@badc0ded
Jul 03 2016 08:23
help chunky monkey
CamperBot
@camperbot
Jul 03 2016 08:23

:point_right: algorithm chunky monkey [wiki]

Algorithm Chunky Monkey

:triangular_flag_on_post: Remember to use Read-Search-Ask if you get stuck. Try to pair program :busts_in_silhouette: and write your own code :pencil:

:checkered_flag: Problem Explanation:

Our goal for this Algorithm is to split arr (first argument) into smaller chunks of arrays with the length provided by size (second argument). There are 4 green checks (objectives) our code needs to pass in order to complete this Algorithm:

  1. (['a', 'b', 'c', 'd'], 2) is expected to be [['a', 'b'], ['c', 'd']]
  2. ([0, 1, 2, 3, 4, 5], 3) is expected to be [[0, 1, 2], [3, 4, 5]]
  3. ([0, 1, 2, 3, 4, 5], 2) is expected to be [[0, 1], [2, 3], [4, 5]]
  4. ([0, 1, 2, 3, 4, 5], 4) is expected to be [[0, 1, 2, 3], [4, 5]]

Relevant Links

:pencil: read more about algorithm chunky monkey on the FCC Wiki

Norvin Burrus
@ndburrus
Jul 03 2016 08:23
@Jhollond there is an extra space in the first sentence...

@anush6533 these may be useful :sparkles: :

can you post your code so far?

Sean DiSanti
@badc0ded
Jul 03 2016 08:24
@anush6533 You split the first array into smaller arrays of length size
Jayrex Acilo
@ajayrexluega
Jul 03 2016 08:25
function nextInLine(arr, item) {
  // Your code here
  arr.push(item);
  var removed = arr.shift();
  return removed;  // Change this line

}

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

// Display Code
console.log("Before: " + JSON.stringify(testArr));
console.log(nextInLine(testArr, 10)); // Modify this line to test
console.log("After: " + JSON.stringify(testArr));
santhosh
@santhoshnv
Jul 03 2016 08:25
@Jhollond could you tell me the level name
@ndburrus what do you mean?
Sean DiSanti
@badc0ded
Jul 03 2016 08:26
help escape sequences in strings
CamperBot
@camperbot
Jul 03 2016 08:26

:point_right: challenge escape sequences in strings [wiki]

Challenge Escape Sequences in Strings

Quotes are not the only characters that can be escaped inside a string. Here is a table of common escape sequences:

Code Output
\' single quote
\" double quote
\ backslash
\n new line
\r carriage return
\t tab
\b backspace
\f form feed

Note that the backslash itself must be escaped in order to display as a backslash.

:pencil: read more about challenge escape sequences in strings on the FCC Wiki

santhosh
@santhoshnv
Jul 03 2016 08:27
var myStr = 'Here is a backslash: \.\n\t\tHere is a new line with two tabs.'; // Change this line
try this @Jhollond
Sean DiSanti
@badc0ded
Jul 03 2016 08:27
that's the one he's working on. just escape the characters in the sequence so that they actually print as described
like to print the backslash, \ becomes \\
Jack
@jh0l
Jul 03 2016 08:28
I think it's broken
Sean DiSanti
@badc0ded
Jul 03 2016 08:28
that's what it sounds like anyway
try refreshing and resubmitting
sometimes that happens
Norvin Burrus
@ndburrus
Jul 03 2016 08:29
@santhoshnv escape the 1st backslash...
Jack
@jh0l
Jul 03 2016 08:29
can someone show me their answer? this is like the most rediculous challange omg
ridiculous
Jayrex Acilo
@ajayrexluega
Jul 03 2016 08:29
@Jhollond remove the spaces after escapes
santhosh
@santhoshnv
Jul 03 2016 08:30
@ndburrus can you help in"Testing Objects for Properties" level
Jayrex Acilo
@ajayrexluega
Jul 03 2016 08:30
@Jhollond it should not have space after escape sequences
Norvin Burrus
@ndburrus
Jul 03 2016 08:31
@santhoshnv can you post your code so far?
@Jhollond can you post what you have now?
Jack
@jh0l
Jul 03 2016 08:31
there aren't any spaces after the escape sequences and it's still not correct i don't know what to
do
var myStr = "Here is a backslash: \\.\n\t\t Here is a new line with two tabs.\";
Sean DiSanti
@badc0ded
Jul 03 2016 08:32
take out the space before the H
Jayrex Acilo
@ajayrexluega
Jul 03 2016 08:32
@Jhollond yeah
Sean DiSanti
@badc0ded
Jul 03 2016 08:32
and the backslash before closing quote
Jack
@jh0l
Jul 03 2016 08:32
OMG
Norvin Burrus
@ndburrus
Jul 03 2016 08:33
This message was deleted
Jack
@jh0l
Jul 03 2016 08:33
@badc0ded thank u
CamperBot
@camperbot
Jul 03 2016 08:33
jhollond sends brownie points to @badc0ded :sparkles: :thumbsup: :sparkles:
:cookie: 397 | @badc0ded |http://www.freecodecamp.com/badc0ded
Sean DiSanti
@badc0ded
Jul 03 2016 08:34
no problem, it was definitely a group effort
Menna490
@Menna490
Jul 03 2016 08:39
Sean DiSanti
@badc0ded
Jul 03 2016 08:39
the left side of the screen on that one tells you the formula to use
help convert celsius to fahrenheit
CamperBot
@camperbot
Jul 03 2016 08:40

:point_right: challenge convert celsius to fahrenheit [wiki]

Challenge Convert Celsius to Fahrenheit

:triangular_flag_on_post: Remember to use Read-Search-Ask if you get stuck. Try to pair program :busts_in_silhouette: and write your own code :pencil:

:checkered_flag: Problem Explanation:

The algorithm to convert from Celsius to Fahrenheit is the temperature in Celsius times 9/5, plus 32.

You are given a variable celsius representing a temperature in Celsius. Use the variable fahrenheit already defined and apply the algorithm to assign it the corresponding temperature in Fahrenheit.

Relevant Links

:pencil: read more about challenge convert celsius to fahrenheit on the FCC Wiki

Sean DiSanti
@badc0ded
Jul 03 2016 08:40
Right under problem explanation
F = (celsius * 9 / 5 + 32)
Jack
@jh0l
Jul 03 2016 08:42
my issue with that one fahrenheit had not been assigned the celsius value so I was just running 0 through the algorithm lol
Menna490
@Menna490
Jul 03 2016 08:43
ok that's clear now , Thank you
Justice K. Dube
@kazd
Jul 03 2016 08:46
need help with Increment a Number with JavaScript this part "myVar = myVar should be changed "
its not working
Will
@Will-is-Coding
Jul 03 2016 08:49
@kazd What do you have right now?
Sean DiSanti
@badc0ded
Jul 03 2016 08:50
no problem @Menna490 i'm glad i could help
Justice K. Dube
@kazd
Jul 03 2016 08:51
this is what i have myVar = myVar + 1;
myVar = myVar;
myVar = myVar ++;
Sean DiSanti
@badc0ded
Jul 03 2016 08:52
you can also do += 1 to add 1
Justice K. Dube
@kazd
Jul 03 2016 08:54
yoo, never mind i got it...thanx
JaivePNG
@JaivePNG
Jul 03 2016 08:58

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

// Only change code below this line
function updateRecords(id, prop, value) {
if (value !== "" && prop !== "tracks") {
collection[id][prop] = value;
} else if (prop === "tracks" && value !== "") {
collection[id][prop]=[value];
} else if (value === "") {
delete collection[id][prop];
}

return collection;
}

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

What is wrong with my code, I have spent all day on this:
Its not passing the 2nd last test "After updateRecords(2468, "tracks", "Free"), tracks should have "1999" as the first element."
Sean DiSanti
@badc0ded
Jul 03 2016 08:59
step through it with those arguments
you're setting collection[2468].tracks = 'free'
because your first condition is false as value is not empty string and prop is tracks
afani martin
@whiz25
Jul 03 2016 09:02
I need help on challenge 171
Sean DiSanti
@badc0ded
Jul 03 2016 09:02
second condition is true, because prop is tracks and value is not empty string
For that one, it's very easy to run into circular or flawed logic
the easiest thing to do is to first write a comment explaining each possible outcome, and how you could tell it to be the case
then write the code with the comment
make sense?
@whiz25 which one is that?
Markus Kiili
@Masd925
Jul 03 2016 09:07
@whiz25 There are no challenge numbers, only names.
Sean DiSanti
@badc0ded
Jul 03 2016 09:07
alright it's 2 am i have to call it a night. everyone have a good one
Evgueni
@Redoras
Jul 03 2016 09:10
I'm very confused, why does the member array get undefined when it comes to the "else" statement: http://codepen.io/RedCone/pen/vKgYjW?editors=1011
members *
Norvin Burrus
@ndburrus
Jul 03 2016 09:16
@whiz25 can you post the lesson name, please? :sparkles:
Azra Masood
@Aeropio
Jul 03 2016 09:19
https://www.freecodecamp.com/challenges/condense-arrays-with-reduce... can some one explain me the reduce function in javascript?
Markus Kiili
@Masd925
Jul 03 2016 09:21
@Aeropio Array method reduce iterates through the array and updates a running value on each array element and returns the running value at the end. The callback function you pass into reduce, tells reduce how to get the next running value from the previous running value and the array element being iterated.
Azra Masood
@Aeropio
Jul 03 2016 09:22
oj ok thank u @Masd925
CamperBot
@camperbot
Jul 03 2016 09:22
aeropio sends brownie points to @masd925 :sparkles: :thumbsup: :sparkles:
:star2: 2026 | @masd925 |http://www.freecodecamp.com/masd925
Markus Kiili
@Masd925
Jul 03 2016 09:23
@Aeropio It is the most general of all array iterators.
Azra Masood
@Aeropio
Jul 03 2016 09:23
ok
John Alcher
@alchermd
Jul 03 2016 09:24
Hey fellas. Anyone here who have done the wiki viewer project? Can you give a brief overview on what the API call looks like?
I'm having a hard time understanding the documentation. Basically I want my search bar to work the same as the search bar on the wikipedia site...
Chris Cullen
@123xylem
Jul 03 2016 09:24
function permAlone(str) {
  var duplicates;
 str=str.split("");

  var search=str.forEach(function(x){

    duplicates=0;

    var stop=str.length;

    while(stop>=0)
    {stop--;

     if(str.lastIndexOf(x)!== -1){//THIS LINE NEEDS TWEAKING
     duplicates++;

     }
   }
     return duplicates;
  }); 



    function factorial(n) {

        if (n === 0) {
            return 1;
        }

        return n * factorial(n - 1); //HERE WE HAVE MAX FACTORIAL OF n BUT I cant return yet before I DIVIDE SO
    }

    function divide(n) { //HERE I MAKE THE DIvision part of the function
        return n * factorial(n - 1)/(n - duplicates);
    }

    return duplicates;
    //divide(factorial(str.length));

}

permAlone('aabb');
Anyone know why my duplicates function at the top isnt giving 2 duplicates on return/?
Azra Masood
@Aeropio
Jul 03 2016 09:28
@ndburrus thank you
CamperBot
@camperbot
Jul 03 2016 09:28
aeropio sends brownie points to @ndburrus :sparkles: :thumbsup: :sparkles:
:cookie: 799 | @ndburrus |http://www.freecodecamp.com/ndburrus
Norvin Burrus
@ndburrus
Jul 03 2016 09:29
@Aeropio you're welcome! enjoy :palm_tree:
Muhammad Bilal
@mba2295
Jul 03 2016 09:36
Can someboldy elaborate javascript variable hoisting
Markus Kiili
@Masd925
Jul 03 2016 09:39
@abhinamnaisocha When an execution context is formed for a script or a function call, the engine first looks at all variable and function declarations. Then the code is executed line by line. Therefore it doesn't matter where a declarations is made. You can think that declarations are hoisted at the top of script or function.
marcint87
@marcint87
Jul 03 2016 09:46
HI !!
im curious about others FreeCodeCampers solutions to the exercise called " Drop it" in Intermediate Algorithm Scripting.
Did you use all suggested helpfull methods? e.i. slice(), argumetns object and shift?
Matthew Choi
@choiikjun
Jul 03 2016 10:03
Hi guys
I'm writing the code for "Record Collection"
And I'm stuck
and it seems that i don't fully understand the concept of key and a value
can someone help me explain this concept
Sebry
@Sebry
Jul 03 2016 10:14
Hi guys, can someone help me please? I'm stuck and I don't understand what I have to write. #challenge 187 "Local scope and functions".

function myLocalScope() {
  var myVar = 'use strict';


  console.log(myVar);
}
myLocalScope();

// Run and check the console
// myVar is not defined outside of myLocalScope
console.log(myVar);

// Now remove the console log line to pass the test
Brendan Kinahan
@BKinahan
Jul 03 2016 10:23
@Sebry follow what the // commented lines say to do
@choiikjun in an object, a key is a property name and a value is the value of that property
Chris Cullen
@123xylem
Jul 03 2016 10:25
function permAlone(str) {
  var duplicates;
 str=str.split("");

  var search=str.forEach(function(x){

    duplicates=0;

    var stop=str.length;

    while(stop>=0)
    {stop--;

     if(str.lastIndexOf(x)!== -1){//THIS LINE NEEDS TWEAKING
     duplicates++;

     }
   }
     return duplicates;
  }); 



    function factorial(n) {

        if (n === 0) {
            return 1;
        }

        return n * factorial(n - 1); //HERE WE HAVE MAX FACTORIAL OF n BUT I cant return yet before I DIVIDE SO
    }

    function divide(n) { //HERE I MAKE THE DIvision part of the function
        return n * factorial(n - 1)/(n - duplicates);
    }

    return duplicates;
    //divide(factorial(str.length));

}

permAlone('aabb');
Anyone know why my duplicates function at the top isnt giving 2 duplicates on return/?
Jayrex Acilo
@ajayrexluega
Jul 03 2016 10:26
Hi, I need some help in "Counting Cards" challenge. I'm confused with it. Here's what i've got

var count = 0;

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

  if (card == 2 || card == 3 || card == 4 || card == 5 || card == 6) {
    x = count + 1;
    q = x + " Bet";
    answer = q;
  }
  else if (card == 7 || card == 8 || card == 9) {
    x = count + card;
    q = count + " Hold";
    answer = q;
  }
  else if (card == 10 || card == 'J' || card == 'Q' || card == 'K' || card == 'A') {
    x = count - 1;
    q = x + " Hold";
    answer = q;
  }
  return answer;

  // Only change code above this line
}

// Add/remove calls to test your function.
// Note: Only the last will display
cc(2); cc(3); cc(7); cc('K'); cc('A');
Victor
@Vicktorius
Jul 03 2016 10:26
Guys need some help please

function multiplyAll(arr) {
var product = 1;
// Only change code below this line
for (var i=0;i < arr.length;i++) {
for (var j=0;j <arr[i].length;j++){
product *= multiplyAll[i][j];
}
}

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

// Modify values below to test your code
multiplyAll([[1,2],[3,4],[5,6,7]]);

Jayrex Acilo
@ajayrexluega
Jul 03 2016 10:27
@Vicktorius what is the name if that challenge?
Victor
@Vicktorius
Jul 03 2016 10:27
this is the nesting for loop challange
Norvin Burrus
@ndburrus
Jul 03 2016 10:27
@Vicktorius ok, here: product *= multiplyAll[i][j];review/check the variable/s... here is what we're trying to do: Modify function multiplyAll so that it multiplies the product variable by each number in the sub-arrays of arr multiplyAll is the function. :) so, what should it look like?
Victor
@Vicktorius
Jul 03 2016 10:27
@ndburrus nesting for loop challange
Jayrex Acilo
@ajayrexluega
Jul 03 2016 10:28
@Vicktorius can you help me with counting cards challenge? i think you're done with this. i'm kinda confused
Sebry
@Sebry
Jul 03 2016 10:28
@BKinahan Thank you, I didn't pay attention
CamperBot
@camperbot
Jul 03 2016 10:28
:star2: 1898 | @bkinahan |http://www.freecodecamp.com/bkinahan
sebry sends brownie points to @bkinahan :sparkles: :thumbsup: :sparkles:
Victor
@Vicktorius
Jul 03 2016 10:29
@ajayrexluega hmmm let me see
Brendan Kinahan
@BKinahan
Jul 03 2016 10:29
@Sebry :thumbsup:
Jayrex Acilo
@ajayrexluega
Jul 03 2016 10:29
Counting Cards challenge. I'm confused

var count = 0;

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

  if (card == 2 || card == 3 || card == 4 || card == 5 || card == 6) {
    x = count + 1;
    q = x + " Bet";
    answer = q;
  }
  else if (card == 7 || card == 8 || card == 9) {
    q = count + " Hold";
    answer = q;
  }
  else if (card == 10 || card == 'J' || card == 'Q' || card == 'K' || card == 'A') {
    x = count - 1;
    q = x + " Hold";
    answer = q;
  }
  return answer;

  // Only change code above this line
}

// Add/remove calls to test your function.
// Note: Only the last will display
cc(2); cc(3); cc(7); cc('K'); cc('A');
Victor
@Vicktorius
Jul 03 2016 10:30
@ajayrexluega use case

@ajayrexluega
var count = 0;

function cc(card) {
// Only change code below this line
switch (card) {
case 2:
case 3:
case 4:
case 5:
case 6:
count+=1;
break;

case "7":
case "8":
case "9":
count += 0;
break;
case 10:
case "J":
case "Q":
case "K":
case "A":
count-=1;
break;
}
if (count <= 0) {
return count + " Hold";
} else {
return count + " Bet";
}
// Only change code above this line
}

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

function cc(card) {
// Only change code below this line
switch (card) {
case 2:
case 3:
case 4:
case 5:
case 6:
count+=1;
break;

case "7":
case "8":
case "9":
count += 0;
break;
case 10:
case "J":
case "Q":
case "K":
case "A":
count-=1;
break;
}
if (count <= 0) {
return count + " Hold";
} else {
return count + " Bet";
}
// Only change code above this line
}

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

this should be your code
Brendan Kinahan
@BKinahan
Jul 03 2016 10:32
@Vicktorius Please don't post solutions; that's what the Wiki is for if people want that :)
Victor
@Vicktorius
Jul 03 2016 10:32
@BKinahan oops sorry
Jayrex Acilo
@ajayrexluega
Jul 03 2016 10:32
@Vicktorius thanks, I will check out your code and learn for it :)
CamperBot
@camperbot
Jul 03 2016 10:32
ajayrexluega sends brownie points to @vicktorius :sparkles: :thumbsup: :sparkles:
:cookie: 217 | @vicktorius |http://www.freecodecamp.com/vicktorius
Brendan Kinahan
@BKinahan
Jul 03 2016 10:33
@Vicktorius (Anyway you don't need cases for "7", "8", and "9", for two reasons: the number cards are never string inputs, and those cases don't change anything and so they can be omitted)
Norvin Burrus
@ndburrus
Jul 03 2016 10:34
@ajayrexluega the result/s should be handled outside of the conditional. keep in mind that the if/else statement is evaluating multiple cards (5), so the result/s will be cumulative.
Victor
@Vicktorius
Jul 03 2016 10:34
@BKinahan yeah true, but I realised that after I did the exercise
challange*
some halp with the Nesting for Loop challange please
Norvin Burrus
@ndburrus
Jul 03 2016 10:36
@Vicktorius see previous comment/s, here: :point_up: July 3, 2016 6:27 AM
Dana Aljirudi
@DanaJirudi
Jul 03 2016 10:37
Hey guys. Can Anybody tell me how they solved the "Word Blanks" challenge? I think the instructions are not very clear to me..
ahmed abouhay
@abohay
Jul 03 2016 10:38
hi any one can help me with the counting cards challenge
Victor
@Vicktorius
Jul 03 2016 10:39
@ndburrus Should multiplyAll look like a var?
Norvin Burrus
@ndburrus
Jul 03 2016 10:39
@Vicktorius well, it will be a var/iable. the question is, which one? let's narrow the focus, here: multiplies the product variable... which would be...?
Victor
@Vicktorius
Jul 03 2016 10:40
@ndburrus oh ofc arr
Dana Aljirudi
@DanaJirudi
Jul 03 2016 10:40
anyone?
Victor
@Vicktorius
Jul 03 2016 10:41
@ndburrus thank you very much :D
CamperBot
@camperbot
Jul 03 2016 10:41
vicktorius sends brownie points to @ndburrus :sparkles: :thumbsup: :sparkles:
:cookie: 801 | @ndburrus |http://www.freecodecamp.com/ndburrus
Markus Kiili
@Masd925
Jul 03 2016 10:41
@DanaJirudi Use string operations and function parameters to make a long sentence.
Norvin Burrus
@ndburrus
Jul 03 2016 10:42
@DanaJirudi the lesson is asking for a sentence to be constructed with the 4 word types given. it may be helpful to go ahead and make a complete (including punctuation & spacing) sentence using those 4 words given. next, we'll build the sentence, ok?
@Vicktorius you're welcome! excellent work :+1:
Dana Aljirudi
@DanaJirudi
Jul 03 2016 10:42
@ndburrus alright do I have to create new strings or not?
Ivan Aganin
@criativ
Jul 03 2016 10:43
Hello :)
Mustafijur rahman
@Dinar717
Jul 03 2016 10:43
@DanaJirudi just add the strings with a space between them
Jayrex Acilo
@ajayrexluega
Jul 03 2016 10:43
@Vicktorius i'm confused with the examples, because in the example output is "-3 Hold" / "5 Bet".
Norvin Burrus
@ndburrus
Jul 03 2016 10:44
@DanaJirudi well, the result variable (an empty string) has been created already - we'll be using it to build the sentence...
Ivan Aganin
@criativ
Jul 03 2016 10:44
I have a question... I have a json callback, and one of the fields is the URL of a site. How do I make a certain DIV in the HTML into a linkt to that URL? :)
I just want to add a link to a div
Victor
@Vicktorius
Jul 03 2016 10:46
@ajayrexluega yeah don't worry about that, focus on the output
Jayrex Acilo
@ajayrexluega
Jul 03 2016 10:47
@Vicktorius yeah i din't thought that the output will just 1 , -1 or 0
Dana Aljirudi
@DanaJirudi
Jul 03 2016 10:50
@ndburrus Maybe it should be something like this? "result = "The" + myAdjective + myNoun + myVerb + "very" + myAdverb;" it didn't work so could you please tell me what's wrong with it? sorry I'm a beginner :worried:
Markus Kiili
@Masd925
Jul 03 2016 10:50
@DanaJirudi ;" <- problem here. Remove the quotes from the ends of that line.
Ivan Aganin
@criativ
Jul 03 2016 10:51
@ndburrus It's not exactly what I asked. I do know how to get the callback'ed data into the HTML. But One of the fields of returned data, in my case data[3][1] is an url. I would like to apply this ULR to a div in HTML. So if you CLICK on a specific URL it will take you to a specific(data[3][1]) url :)
Norvin Burrus
@ndburrus
Jul 03 2016 10:51
@DanaJirudi ok, you've got the idea... now let's attend to the punctuation & spacing... create the sentence you made to see if it is a complete sentence.
Dana Aljirudi
@DanaJirudi
Jul 03 2016 10:51
@Masd925 I just have the quotation marks because I don't know how to quote the code here correctly...
Markus Kiili
@Masd925
Jul 03 2016 10:51
@DanaJirudi ok
Norvin Burrus
@ndburrus
Jul 03 2016 10:52
help format @DanaJirudi
CamperBot
@camperbot
Jul 03 2016 10:52

:point_right: code formatting [wiki]

Multi line Code

```js ⇦ Type 3 backticks and then press [shift + enter ⏎] (type js or html or css)

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

``` ⇦ Type 3 backticks, then press [enter ⏎]

Single line Code

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

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

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

Levi
@MalangeLevi
Jul 03 2016 10:52
@ndburrus im facing a problem..i dont know what is wrong
Dana Aljirudi
@DanaJirudi
Jul 03 2016 10:52
@ndburrus Yes it printed "The big dog ran very quickly"
Levi
@MalangeLevi
Jul 03 2016 10:52
im doing a very simple task, get a data from input and display it on element p but does not work, i get the input but dont show or does not stay on it
Norvin Burrus
@ndburrus
Jul 03 2016 10:52
@DanaJirudi ...alright, good! is this a complete sentence?
Levi
@MalangeLevi
Jul 03 2016 10:53
$("#btn1").click(function(){
        var getvalue= $("#numb").val();
        $("#numb").val = (getvalue.value);
        alert(getvalue);
        $("#demo").html("Hello");
    });
Norvin Burrus
@ndburrus
Jul 03 2016 10:53
@MalangeLevi Which lesson/exercise (name) is this?
Dana Aljirudi
@DanaJirudi
Jul 03 2016 10:53
@ndburrus hmmm Yes? I guess
Norvin Burrus
@ndburrus
Jul 03 2016 10:54

@DanaJirudi let's check the definition, shall we?

A complete sentence is a group of words related by meaning, which: Starts with a capital letter and ends with a period (exclamation or question marks); Has a subject and a verb predicate (which should agree with each other in number); Has a complete thought.

Levi
@MalangeLevi
Jul 03 2016 10:55
is not a lesson, just testing a code to apply on weather project. i have done the project, works fine but i want to add a new function, which is to display weather from any country, by asking the user to type a country name input type="text"
Dana Aljirudi
@DanaJirudi
Jul 03 2016 10:56
@ndburrus :smile: Thanks for the definition. I still think it's complete though lol
CamperBot
@camperbot
Jul 03 2016 10:56
danajirudi sends brownie points to @ndburrus :sparkles: :thumbsup: :sparkles:
:cookie: 802 | @ndburrus |http://www.freecodecamp.com/ndburrus
Norvin Burrus
@ndburrus
Jul 03 2016 10:56
@DanaJirudi nice job! :violin:
Dana Aljirudi
@DanaJirudi
Jul 03 2016 10:56
@ndburrus I added a period but didn't work
@ndburrus sorry I'm asking too much
Norvin Burrus
@ndburrus
Jul 03 2016 10:57
@DanaJirudi can you please post your entire code?
Islam Ibakaev
@dagman
Jul 03 2016 10:57
@MalangeLevi this one will not work $("#numb").val = (getvalue.value);
Dana Aljirudi
@DanaJirudi
Jul 03 2016 10:58

@ndburrus function wordBlanks(myNoun, myAdjective, myVerb, myAdverb) {
var result = "";
// Your code below this line
result = "The " + myAdjective + myNoun + myVerb + "very" + myAdverb + ".";
// Your code above this line
return result;
}

// Change the words here to test your function
wordBlanks("dog ", "big ", "ran ", " quickly");

Levi
@MalangeLevi
Jul 03 2016 10:58
@dagman i tried text() too
@dagman what is the best way of doing it then?
Norvin Burrus
@ndburrus
Jul 03 2016 10:58
@DanaJirudi if you test the code, what do you get?
Islam Ibakaev
@dagman
Jul 03 2016 10:58
@MalangeLevi i see that you are retrieving input's value and alerts it
Levi
@MalangeLevi
Jul 03 2016 10:59
@DanaJirudi u need to use your parameters only
Islam Ibakaev
@dagman
Jul 03 2016 10:59
@MalangeLevi is it your aim?
Levi
@MalangeLevi
Jul 03 2016 10:59
@dagman yes that part works
Islam Ibakaev
@dagman
Jul 03 2016 10:59
@MalangeLevi what a u trying to achieve
Dana Aljirudi
@DanaJirudi
Jul 03 2016 10:59
@ndburrus It tells me that I haven't achieved this "wordBlanks("dog", "big", "ran", "quickly") should contain all of the passed in words separated by non-word characters (and any additional words in your madlib)."
Levi
@MalangeLevi
Jul 03 2016 10:59
@dagman yes i want to retrieve it, that bit works fine, after that i want to pass or set that value to p element
Norvin Burrus
@ndburrus
Jul 03 2016 10:59
@ndburrus did you change the function tests? they should be verbatim as listed....
Abhishek Baliyan
@abhishekdevinfo
Jul 03 2016 11:00
hi
need help in java-script
Levi
@MalangeLevi
Jul 03 2016 11:00

    $("#btn1").click(function(){
        var getvalue= $("#numb").val();
        $("#demo").html("Hello");
    });
@abhishekdevinfo what kind of help?
Dana Aljirudi
@DanaJirudi
Jul 03 2016 11:00
@MalangeLevi I tried that but still didn't work
Islam Ibakaev
@dagman
Jul 03 2016 11:00
@MalangeLevi does p has id of demo?
Abhishek Baliyan
@abhishekdevinfo
Jul 03 2016 11:00
i have a problem in Profile Lookup in Java-script
Krishna Sai Gullapalli
@Krish2704
Jul 03 2016 11:01
@abhishekdevinfo what's up?
Levi
@MalangeLevi
Jul 03 2016 11:01
@dagman yes... @dagman ```
<div class="container text-center">
<div class="row">
<div class="col-sm-offset-4 col-sm-4">
<p id="demo" class="city-size"> </p>
</div>
</div>
</div>
Islam Ibakaev
@dagman
Jul 03 2016 11:01
@MalangeLevi if yes maybe try $("#demo").html(getValue);
Norvin Burrus
@ndburrus
Jul 03 2016 11:01
@DanaJirudi this: wordBlanks("dog ", "big ", "ran ", " quickly"); appears to be different, than this: wordBlanks("dog", "big", "ran", "quickly") see the difference/s?
Abhishek Baliyan
@abhishekdevinfo
Jul 03 2016 11:02
This message was deleted
This message was deleted
Levi
@MalangeLevi
Jul 03 2016 11:02
@dagman i noticed that when you use bootstrap library lot thing dont work
Abhishek Baliyan
@abhishekdevinfo
Jul 03 2016 11:02

//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 lookUpProfile(firstName, prop){
// Only change code below this line
  for ( var i = 0; i < contacts.length; i++) {
    if (firstName == contacts[i].firstName ) {
      for (var key in contacts[i]) {
        if( contacts[i].hasOwnProperty( prop ) ) {
          return contacts[i].prop;         
          }
        else {
          return console.log("No such property");
        }        
      }
    }
    else {
      return console.log("No such contacts")
    }
  }
// Only change code above this line
}

// Change these values to test your function
lookUpProfile("Akira", "likes");
Levi
@MalangeLevi
Jul 03 2016 11:02
but if you write just plain html and js inside the page works better...why?
Dana Aljirudi
@DanaJirudi
Jul 03 2016 11:02
@ndburrus Hmmm let me check
Islam Ibakaev
@dagman
Jul 03 2016 11:02
@MalangeLevi did you add jquery before bootstrap.min.js file
Levi
@MalangeLevi
Jul 03 2016 11:03
@dagman yes i did using google one...
Islam Ibakaev
@dagman
Jul 03 2016 11:03
@MalangeLevi all bootstrap niceties work very well
ahmed abouhay
@abohay
Jul 03 2016 11:03

var count = 0;

function cc(card) {
// Only change code below this line
switch (card){
case 2 || 3 || 4 || 5 || 6:
count++;
break;
case 7 || 8 || 0:
count +=0;
break;
case 10 || 'J' || 'Q' || 'K' || 'A':
count --;
break;
}
if (count > 0){
return count+ " Bet";
}else{
return count + " Hold";
}

return "Change Me";
// Only change code above this line
}

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

any one can help
Levi
@MalangeLevi
Jul 03 2016 11:03
@dagman should i just use boostrap js?
ahmed abouhay
@abohay
Jul 03 2016 11:03
counting card challenge
Abhishek Baliyan
@abhishekdevinfo
Jul 03 2016 11:03
@MalangeLevi @Krish2704 i think my second for loop in function is not correct
Krishna Sai Gullapalli
@Krish2704
Jul 03 2016 11:04
@abhishekdevinfo contacts[i][prop] . you shouldn't use dot for prop since it's a variable
Islam Ibakaev
@dagman
Jul 03 2016 11:04
better use bootstrap.min.js
Levi
@MalangeLevi
Jul 03 2016 11:04
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
@dagman let me try
@dagman i get back on you...
Abhishek Baliyan
@abhishekdevinfo
Jul 03 2016 11:04
@Krish2704 ok
Krishna Sai Gullapalli
@Krish2704
Jul 03 2016 11:04
@abhishekdevinfo and why are you using two loops?
Islam Ibakaev
@dagman
Jul 03 2016 11:04
@MalangeLevi maybe try to add latest version of jquery or maybe 2.4 version
Levi
@MalangeLevi
Jul 03 2016 11:05
@dagman let me try...post the link please to get the latest...
Islam Ibakaev
@dagman
Jul 03 2016 11:05
Abhishek Baliyan
@abhishekdevinfo
Jul 03 2016 11:06
@Krish2704 the first loop is work for array and the second loop is for array of object
Dana Aljirudi
@DanaJirudi
Jul 03 2016 11:06
@ndburrus Problem solved! turns out I just have to put quotation marks with spaces between the parameters.. Thank you for your help :smile:
CamperBot
@camperbot
Jul 03 2016 11:06
danajirudi sends brownie points to @ndburrus :sparkles: :thumbsup: :sparkles:
:warning: danajirudi already gave ndburrus points
Norvin Burrus
@ndburrus
Jul 03 2016 11:06
@abohay review/check the case statement syntax... :sparkles:
Islam Ibakaev
@dagman
Jul 03 2016 11:06
@MalangeLevi better add this https://cdnjs.com/libraries/jquery/2.2.4
Norvin Burrus
@ndburrus
Jul 03 2016 11:06
@DanaJirudi excellent work! :+1:
Islam Ibakaev
@dagman
Jul 03 2016 11:06
@MalangeLevi i am not sure on 3.0 version
Chris Cullen
@123xylem
Jul 03 2016 11:07
function permAlone(str) {
  var duplicates;
 str=str.split("");
str.forEach(function(x){

    duplicates=0;

    var stop=str.length;
                           //while stop (4) is more than 0 go through all elements

     if(str.lastIndexOf(x)!== -1){//IF theres a duplicate ------------------------THIS LINE???

    console.log(x);
         duplicates++;   //++duplicates
                         //THis is doing this thogh   0123012301230123

     }return duplicates;
   });
permAlone('aaabb');
My forEach is going through all the letters but It doesnt recognise duplicates for some reason!!! Can you help with the Code PLease?
Robert Marić
@Mariciano95
Jul 03 2016 11:07
function titleCase(str) {
  var arr = str.split(' ');
  for (var i = 0; i < arr.length; i++) {
    p = arr[i][0].toUpperCase();
  }
  return str;
}

titleCase("I'm a little tea pot");
Am I on the right track?
Krishna Sai Gullapalli
@Krish2704
Jul 03 2016 11:07
@abhishekdevinfo if the firstname coondition satisfies, you'll have to check the property for only that element no need of all keys
Robert Marić
@Mariciano95
Jul 03 2016 11:07
I know I need to define p
Norvin Burrus
@ndburrus
Jul 03 2016 11:08
@abohay here: case 7 || 8 || 0: what exactly is the zero for? and what about here: return "Change Me"; ?
Abhishek Baliyan
@abhishekdevinfo
Jul 03 2016 11:08
@Krish2704 but after checking the firstname i also have to check the pros
Islam Ibakaev
@dagman
Jul 03 2016 11:09
@Roba94 strings are immutable so u cant just do this p = arr[i][0].toUpperCase();
teethgrinder
@teethgrinder
Jul 03 2016 11:09
how do copy styled copy here ? I want to ask my code ?
Abhishek Baliyan
@abhishekdevinfo
Jul 03 2016 11:09
@Krish2704 and the pros is not defined( It would be anything)
Islam Ibakaev
@dagman
Jul 03 2016 11:10
@teethgrinder ctrl + :arrow_up: +m
Krishna Sai Gullapalli
@Krish2704
Jul 03 2016 11:10
@abhishekdevinfo for only that elemenet not all. if contacts[i]'s firstname is eual to firstname then check the property of contact[i]. only one for loop
Robert Marić
@Mariciano95
Jul 03 2016 11:10
@dagman Then I guess back to the drawing board. Thanks.
CamperBot
@camperbot
Jul 03 2016 11:10
roba94 sends brownie points to @dagman :sparkles: :thumbsup: :sparkles:
:cookie: 592 | @dagman |http://www.freecodecamp.com/dagman
Abhishek Baliyan
@abhishekdevinfo
Jul 03 2016 11:11
@Krish2704 ohh i got it thanks
CamperBot
@camperbot
Jul 03 2016 11:11
abhishekdevinfo sends brownie points to @krish2704 :sparkles: :thumbsup: :sparkles:
:cookie: 587 | @krish2704 |http://www.freecodecamp.com/krish2704
Norvin Burrus
@ndburrus
Jul 03 2016 11:11
@abohay how are we doing? see the comment/s? here: :point_up: July 3, 2016 7:08 AM
ahmed abouhay
@abohay
Jul 03 2016 11:11
@ndburrus i don't know where's the issue
Islam Ibakaev
@dagman
Jul 03 2016 11:12
@Roba94 try achieve this effect little -> L+ ittle
Norvin Burrus
@ndburrus
Jul 03 2016 11:12
help format @teethgrinder
CamperBot
@camperbot
Jul 03 2016 11:12

:point_right: code formatting [wiki]

Multi line Code

```js ⇦ Type 3 backticks and then press [shift + enter ⏎] (type js or html or css)

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

``` ⇦ Type 3 backticks, then press [enter ⏎]

Single line Code

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

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

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

teethgrinder
@teethgrinder
Jul 03 2016 11:14

`function largestOfFour(arr) {
for (var i=0; i < arr.length; i++){
arr[i].sort();
console.log(arr[i]);
}
console.log(arr);
return arr;
}

largestOfFour([[4, 5, 1, 3], [13, 27, 18, 26], [32, 35, 37, 39], [1000, 1001, 857, 1]]);`

sorry , will solve now
Robert Marić
@Mariciano95
Jul 03 2016 11:15
@dagman Ok, I'l mess around with it.
teethgrinder
@teethgrinder
Jul 03 2016 11:18

`function largestOfFour(arr) {
for (var i=0; i < arr.length; i++){
arr[i].sort();
console.log(arr[i]);
}
console.log(arr);
return arr;
}

largestOfFour([[4, 5, 1, 3], [13, 27, 18, 26], [32, 35, 37, 39], [1000, 1001, 857, 1]]);` I have a problem with sorting here in the console last subarray is shown Array [ 1, 1000, 1001, 857 ]

Levi
@MalangeLevi
Jul 03 2016 11:18
@dagman im getting this error:
bootstrap.min.js:6 Uncaught Error: Bootstrap's JavaScript requires jQuery(anonymous function) @ bootstrap.min.js:6
Norvin Burrus
@ndburrus
Jul 03 2016 11:19
@teethgrinder Which lesson/exercise (name) is this?
teethgrinder
@teethgrinder
Jul 03 2016 11:20
Return Largest Numbers in Arrays
Vipuljn
@Vipuljn
Jul 03 2016 11:20

function convertToF(celsius) {
var fahrenheit;
// Only change code below this line
celsius = 9/5+32;

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

// Change the inputs below to test your code
convertToF(30);

is this code correct for converting celsius into farhnhite
Islam Ibakaev
@dagman
Jul 03 2016 11:21
@MalangeLevi can i take a look at your html file
@MalangeLevi make a snap of it if you working locally
Krishna Sai Gullapalli
@Krish2704
Jul 03 2016 11:22
@Vipuljn well you should multiply 9/5 with celsius, check the ffforemula again
formula*
Abhishek Baliyan
@abhishekdevinfo
Jul 03 2016 11:22
@Krish2704 r u there?
teethgrinder
@teethgrinder
Jul 03 2016 11:22

```
function largestOfFour(arr) {
for (var i=0; i < arr.length; i++){
arr[i].sort();
console.log(arr[i]);
}
console.log(arr);
return arr;
}

largestOfFour([[4, 5, 1, 3], [13, 27, 18, 26], [32, 35, 37, 39], [1000, 1001, 857, 1]]);
``` @ndburrus ... the problem is

Norvin Burrus
@ndburrus
Jul 03 2016 11:22
@Vipuljn is the formula accurate? reference: Fahrenheit is the temperature in Celsius times 9/5, plus 32compare the code vs. the requirement... :)
Krishna Sai Gullapalli
@Krish2704
Jul 03 2016 11:22
@abhishekdevinfo yeah?
Abhishek Baliyan
@abhishekdevinfo
Jul 03 2016 11:23
@Krish2704 i changed my code
would u please see
Krishna Sai Gullapalli
@Krish2704
Jul 03 2016 11:23
@abhishekdevinfo sure
Vipuljn
@Vipuljn
Jul 03 2016 11:23

function convertToF(celsius) {
var fahrenheit;
// Only change code below this line
celsius = fahrenheit * 9/5 + 32;

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

// Change the inputs below to test your code
convertToF(30);

Abhishek Baliyan
@abhishekdevinfo
Jul 03 2016 11:23
function lookUpProfile(firstName, prop){
// Only change code below this line
  for ( var i = 0; i < contacts.length; i++) {
    if (firstName == contacts[i].firstName ) {

      if (contacts[i].hasOwnProperty( prop ) ) {
        return contacts[i][prop];
      }

      else {
      return console.log("No such contacts");
      }

    }
      else {
          return console.log("No such property");
       }      

  }
// Only change code above this line
}
Levi
@MalangeLevi
Jul 03 2016 11:23

<html>

<head>
<title> Weather APP</title>
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">
<link rel="stylesheet" href="BestAppWeathercss.css">
<script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
<script src ="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.2.4/jquery.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<!-- jQuery library -->



<!-- Latest compiled JavaScript -->



<script src="bestweatherappscript.js"></script>

</head>

Vipuljn
@Vipuljn
Jul 03 2016 11:23
i use dthis again
Levi
@MalangeLevi
Jul 03 2016 11:23
<html>
<head>
<title> Weather APP</title>
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">
<link rel="stylesheet" href="BestAppWeathercss.css">
<script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
<script src ="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.2.4/jquery.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<!-- jQuery library -->



<!-- Latest compiled JavaScript -->



<script src="bestweatherappscript.js"></script>

</head>
@dagman posted
teethgrinder
@teethgrinder
Jul 03 2016 11:24
@ndburrus all the arrays are sorted except for the last one ```
Norvin Burrus
@ndburrus
Jul 03 2016 11:24
@Vipuljn are the variables reversed? details, details.... :point_up: July 3, 2016 7:22 AM
Vipuljn
@Vipuljn
Jul 03 2016 11:25
i got it bro
Norvin Burrus
@ndburrus
Jul 03 2016 11:26
@teethgrinder see previous comment/s... :point_up: July 3, 2016 7:19 AM
Vipuljn
@Vipuljn
Jul 03 2016 11:26
i hve to reverse position of celisus and fahrenhite
Norvin Burrus
@ndburrus
Jul 03 2016 11:26
@Vipuljn bingo! :panda_face:
Vipuljn
@Vipuljn
Jul 03 2016 11:26
by the way thnks
hello
Levi
@MalangeLevi
Jul 03 2016 11:27
i solved the error, u have to load js file before boostrap...
Vipuljn
@Vipuljn
Jul 03 2016 11:27
i m 3rd year comuter science engg student
Norvin Burrus
@ndburrus
Jul 03 2016 11:27
@Vipuljn you're welcome! does it pass? :+1: nice, this stuff is right up your alley, then. you'll be a pro in no time!
Vipuljn
@Vipuljn
Jul 03 2016 11:27
@ndburrus yup
teethgrinder
@teethgrinder
Jul 03 2016 11:28
test of my editor
Islam Ibakaev
@dagman
Jul 03 2016 11:28
@MalangeLevi put all scripts before </body>
Abhishek Baliyan
@abhishekdevinfo
Jul 03 2016 11:29
@Krish2704 is there something wrong in my code
lizziebethw
@lizziebethw
Jul 03 2016 11:29
Hi for the testing objects for properties challenge do we still have to not use if/else?
Islam Ibakaev
@dagman
Jul 03 2016 11:29
@MalangeLevi one jquery file is sufficient but it should go BEFORE bootstrap js file
teethgrinder
@teethgrinder
Jul 03 2016 11:29

```
function largestOfFour(arr) {
for (var i=0; i < arr.length; i++){
arr[i].sort();
console.log(arr[i]);
}
console.log(arr);
return arr;
}

largestOfFour([[4, 5, 1, 3], [13, 27, 18, 26], [32, 35, 37, 39], [1000, 1001, 857, 1]]);

Array [ 1, 3, 4, 5 ]
Array [ 13, 18, 26, 27 ]
Array [ 32, 35, 37, 39 ]
Array [ 1, 1000, 1001, 857 ]
``` @ndburrus thanks, I am in exercise "Return Largest Numbers in Arrays" the problem is when I sort array the last one looks wrong

CamperBot
@camperbot