These are chat archives for FreeCodeCamp/HelpJavaScript

11th
Jul 2016
Greg Duncan
@GregatGit
Jul 11 2016 00:01
@tylerprosper collection[id][prop].push(value); if there is no property 'tracks' (5439 has none) you can't push to an array and property that isn't there
mrscouture
@mrscouture
Jul 11 2016 00:02
@ChadDean82 check your spaces, like between quoted\"string - It looks good to me just can't tell if there are spaces or not
Greg Duncan
@GregatGit
Jul 11 2016 00:05
@mrscouture try using shift() and push
tylerprosper
@removed~tylerprosper
Jul 11 2016 00:06
@GregatGit ok thx
CamperBot
@camperbot
Jul 11 2016 00:06
tylerprosper sends brownie points to @gregatgit :sparkles: :thumbsup: :sparkles:
:cookie: 671 | @gregatgit |http://www.freecodecamp.com/gregatgit
daiwik
@daiwik
Jul 11 2016 00:06
 var template = [["PENNY", 0.01], ["NICKEL", 0.05], ["DIME", 0.10], ["QUARTER", 0.25], ["ONE", 1.00], ["FIVE", 5.00], ["TEN", 10.00], ["TWENTY", 20.00], ["ONE HUNDRED", 100.00]];

if(template[i][1] == 0){
                  template.splice(i,1);
              }
It's not working. someone help. I get TypeError: Cannot read property '1' of undefined
bitgrower
@bitgrower
Jul 11 2016 00:07
@tylerprosper - Greg's diagnosed the problem correctly ... but you still have to check if the property tracks exists, and if not, instantiate it with an array ... :) only when the value of the property is seen as an array will you be able to use push ... :)
LoLZ
@barak113
Jul 11 2016 00:08
http://prntscr.com/bratmg can somebody give me a hint?
Chad Hurley
@ChadDean82
Jul 11 2016 00:08
@mrscouture I know right that is what I thought a couple of times tried spaced & no spaced. Not sure what it is that is wrong. I figure it will be one of those makes me feel like a goof moments when I do see it
tylerprosper
@removed~tylerprosper
Jul 11 2016 00:09

I have another, related question regarding nesting if statements.
In this function:

function updateRecords(id, prop, value) {
  if(value !== "") { 
    if(prop === "tracks") { 
        collection[id][prop].push(value);
    } else { 
        collection[id][prop] = value;
    }

} else delete collection[id][prop]; 
return collection;
}

The second if statement has been nested within the first. Is that additive? That is to say, is it the same as saying:

function updateRecords(id, prop, value) {
  if(value !== "" && prop === "tracks") { 
        collection[id][prop].push(value);
    } else { 
        collection[id][prop] = value;
    }

} else delete collection[id][prop]; 
return collection;
}

?

LoLZ
@barak113
Jul 11 2016 00:11
http://prntscr.com/bratmg can somebody help me please ?
bitgrower
@bitgrower
Jul 11 2016 00:12
not precisely -- because the else is going to be semantically different ... it's going to be anything which does not match the first conditional, which is not the same in both
Chad Hurley
@ChadDean82
Jul 11 2016 00:12
@mrscouture yes it was a I feel like a goof moment spacing was a big key.
@mrscouture thank you
CamperBot
@camperbot
Jul 11 2016 00:12
chaddean82 sends brownie points to @mrscouture :sparkles: :thumbsup: :sparkles:
:cookie: 175 | @mrscouture |http://www.freecodecamp.com/mrscouture
tylerprosper
@removed~tylerprosper
Jul 11 2016 00:15
@bitgrower Was that in response to me?
@bitgrower thx
CamperBot
@camperbot
Jul 11 2016 00:16
tylerprosper sends brownie points to @bitgrower :sparkles: :thumbsup: :sparkles:
:star2: 1135 | @bitgrower |http://www.freecodecamp.com/bitgrower
LoLZ
@barak113
Jul 11 2016 00:17
can somebody help me please im stuck
bitgrower
@bitgrower
Jul 11 2016 00:17
yep, @tylerprosper ... & yw ... happy coding !
Stephen James
@sjames1958gm
Jul 11 2016 00:18
@barak113 Throw that man a rope
@barak113 What's your issue/
LoLZ
@barak113
Jul 11 2016 00:18
@sjames1958gm http://prntscr.com/bratmg i cant solve this
clintonjohn
@clintonjohn
Jul 11 2016 00:19
@Rafase282 is there a library (Ramda, Immutable) you'd recommend to solve chunky monkey functionally, in a terse and concise way? It seems like one must go through contortions to attempt it functionally in vanilla JavaScript. I looked at Ramda and it seemed to offer a function that could almost be described as a chunky monkey function.
LoLZ
@barak113
Jul 11 2016 00:19
dont exacly know what to do
clintonjohn
@clintonjohn
Jul 11 2016 00:20
@Rafase282 but I'd have to study it more to be sure
uniforlyff
@uniforlyff
Jul 11 2016 00:20
@barak113 form a sentence
Stephen James
@sjames1958gm
Jul 11 2016 00:20
@barak113 You want to build a string into the result variable using the variables passed into the function. myNoun, myAdjective, etc will contain parts of speech and you will form a sentence
uniforlyff
@uniforlyff
Jul 11 2016 00:20
@barak113 asign it to result
mrscouture
@mrscouture
Jul 11 2016 00:21
@GregatGit Thanks! Finally got it after I remembered to set the removed item as a variable to return :)
CamperBot
@camperbot
Jul 11 2016 00:21
mrscouture sends brownie points to @gregatgit :sparkles: :thumbsup: :sparkles:
:cookie: 672 | @gregatgit |http://www.freecodecamp.com/gregatgit
LoLZ
@barak113
Jul 11 2016 00:22
so i need to start with result = ?
Greg Duncan
@GregatGit
Jul 11 2016 00:22
@mrscouture :+1:
daiwik
@daiwik
Jul 11 2016 00:27
anyone know how to remove elements from array likee this
 var template = [["PENNY", 0.01], ["NICKEL", 0.05], ["DIME", 0.10], ["QUARTER", 0.25], ["ONE", 1.00], ["FIVE", 5.00], ["TEN", 10.00], ["TWENTY", 20.00], ["ONE HUNDRED", 100.00]];
i tried splice and pop but dont work
Stephen James
@sjames1958gm
Jul 11 2016 00:28
@daiwik slice and concatenate
falconpunch12
@falconpunch12
Jul 11 2016 00:29
struggling a bit with Title Case a Sentence. trying to capitalize the first letter of every string in my array. can someone please let me know if i'm on the right track?

function titleCase(str) {
  var letter = str.split(" ");
  var upperCase = [];
  for(var x = 0; x<letter.length;x++){
    upperCase.push(letter[x][0].toUpperCase());

    }

  return upperCase;
}

titleCase("I'm a little tea pot");
Joseph
@revisualize
Jul 11 2016 00:30
@falconpunch12 Stings are immutable.
falconpunch12
@falconpunch12
Jul 11 2016 00:31
@revisualize so do i need to split the array up into individual letters within an array? unfortunately what i have so far is just spitting out the first letter and thats it
Joseph
@revisualize
Jul 11 2016 00:32
regex??????
falconpunch12
@falconpunch12
Jul 11 2016 00:32
@revisualize that narrows it down. i spent a few minutes looking for something on here - https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions#special-non-word. will spend more time
thanks
João Ricardo Lhullier Lugão
@jlugao
Jul 11 2016 00:33
Hey guys
Joseph
@revisualize
Jul 11 2016 00:33
OR! You could just slice or substr.
I think I used substr the first time.
Rafael Uzcategui
@rafaelg21
Jul 11 2016 00:34
```js<
João Ricardo Lhullier Lugão
@jlugao
Jul 11 2016 00:34
just a quick question... When I am doing the exercises I seem to be able to solve them quite quickly, however when I am doing the projects I can't remember any of the stuff I just did in the exercises
is that normal?
Rafael Uzcategui
@rafaelg21
Jul 11 2016 00:34
function rot13(str) { // LBH QVQ VG!
  var n=0;
  var arr=[];
  var arr_At=[];
  var arg="";
  //var String="";
  arr=str.split("");
   //console.log(arr);   
  for(var i=0; i<arr.length;i++){
    n=arr[i].charCodeAt(0); 
    arr_At.push(n); 
    console.log(n);   
  }

  arg=arr_At.join(",");
  str=String.fromCharCode(83,69,82,82,32,80,66,81,82,32,80,78,90,67);
  //str.charCodeAt(arg);arg
  console.log(arg);
  //console.log(String.fromCharCode(n));
  return str;

}

// Change the inputs below to test
rot13("SERR PBQR PNZC");
Saludos s amigos, como seria este procedimiento....
LoLZ
@barak113
Jul 11 2016 00:34
tried everything so far and still cant solve it http://prntscr.com/brb1f7 help please
Stephen James
@sjames1958gm
Jul 11 2016 00:35
@jlugao Solving quickly is not super normal, but not remembering the details of the languages is as a beginner
@rafaelg21 While you are looping over arr, just convert the characters to number, add or subtract 13 then revert to string and concatenate to result string.
Rafael Uzcategui
@rafaelg21
Jul 11 2016 00:38
Gracias @sjames1958gm
Joseph
@revisualize
Jul 11 2016 00:39
@jlugao That is "normal" but, it shouldn't be.
João Ricardo Lhullier Lugão
@jlugao
Jul 11 2016 00:39
@sjames1958gm the reason why I solve these fast is because I already code in C and python (not quite advanced in either, but I've been coding for a while now), this is why I go through the exercises fast
tylerprosper
@removed~tylerprosper
Jul 11 2016 00:39
Ok so I've tried to append value as a child to id in my function if there is no "track" prop or value yet I'm still doing something wrong:
// 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(value !== "") { 
    if(prop === "tracks") { 
        collection[id][prop].push(value);
    } else if (value === null) {
        collection[id].children.push(value);
    }

    else { 
        collection[id][prop] = value;
    }

} else delete collection[id][prop]; 
return collection;
}

// Alter values below to test your code
updateRecords(5439, "artist", "ABBA");
João Ricardo Lhullier Lugão
@jlugao
Jul 11 2016 00:39
oops, repeated myself a bit there, sorry
Joseph
@revisualize
Jul 11 2016 00:39
@jlugao I highly recommend spending the time to retain the knowledge.
LoLZ
@barak113
Jul 11 2016 00:39
tried everything so far and still cant solve it http://prntscr.com/brb1f7 help please
Joseph
@revisualize
Jul 11 2016 00:39
@tylerprosper You're close. But, you are missing a part.
@barak113 You should NOT be overriding your parameters.
LoLZ
@barak113
Jul 11 2016 00:41
okay
Joseph
@revisualize
Jul 11 2016 00:41
@barak113 wordBlanks is a function and shouldn't be used as a variable name.
João Ricardo Lhullier Lugão
@jlugao
Jul 11 2016 00:41
@revisualize should I try doing more exercises with the new functions I learned then? The challenging part is getting to know the functions... The algorithm part is fine
LoLZ
@barak113
Jul 11 2016 00:41
yea i solved it now :P
Rafael Uzcategui
@rafaelg21
Jul 11 2016 00:41
@sjames1958gm Como es eso de sumar o restar?
LoLZ
@barak113
Jul 11 2016 00:41
@revisualize thanks anyway
Joseph
@revisualize
Jul 11 2016 00:41
@barak113 It is a lesson about string concatenation with variables.
CamperBot
@camperbot
Jul 11 2016 00:41
barak113 sends brownie points to @revisualize :sparkles: :thumbsup: :sparkles:
:star2: 1406 | @revisualize |http://www.freecodecamp.com/revisualize
Joseph
@revisualize
Jul 11 2016 00:41
@barak113 Awesome.
@jlugao I recommend practicing more now. Because if you want to move into industry... you'll be glad that you spent the time now to learn completely.
Pay now or pay later.
Paying later when you're on a deadline and everything is crunch time.. May suck!!!!
Stephen James
@sjames1958gm
Jul 11 2016 00:43
@rafaelg21 str.charCodeAt(0) + 13 or str.charCodeAt(0) -13 - based on character A-M or N-Z
João Ricardo Lhullier Lugão
@jlugao
Jul 11 2016 00:44
@revisualize thanks for the advice, will spend more time practicing each concept then.
CamperBot
@camperbot
Jul 11 2016 00:44
jlugao sends brownie points to @revisualize :sparkles: :thumbsup: :sparkles:
:star2: 1407 | @revisualize |http://www.freecodecamp.com/revisualize
Joseph
@revisualize
Jul 11 2016 00:45
I know that it sucks to hear.. Spend more time learning. But, it really all depends on what you want to do with your knowedge.
@jlugao
Rafael Uzcategui
@rafaelg21
Jul 11 2016 00:48
ok gracias @sjames1958gm ya entendi segun el valor asccii
tylerprosper
@removed~tylerprosper
Jul 11 2016 00:48
@revisualize I guess what I'm not understanding is that the instructions are telling me to delete nonexistent properties from the album, yet when I tried that it was telling me that a track should be appended where there was previously null
Joseph
@revisualize
Jul 11 2016 00:49
@tylerprosper *cough* .hasOwnProperty()
Stephen James
@sjames1958gm
Jul 11 2016 00:49
@rafaelg21 Here is what I did to make the code clearer.
  var A = "A".charCodeAt(0);
  var Z = "Z".charCodeAt(0);
  var M = "M".charCodeAt(0)
daiwik
@daiwik
Jul 11 2016 00:50
has anyone done exact change I think one of their test case is wrong
tylerprosper
@removed~tylerprosper
Jul 11 2016 00:51
@revisualize ah ok. thx
CamperBot
@camperbot
Jul 11 2016 00:51
tylerprosper sends brownie points to @revisualize :sparkles: :thumbsup: :sparkles:
:star2: 1408 | @revisualize |http://www.freecodecamp.com/revisualize
Joseph
@revisualize
Jul 11 2016 00:52
Record Collection is a CheckPoint.. Not a regular challenge. It takes your previous knowledge and pulls it all together.
It is basically a mini-algorithm challenge.
Aiden
@AidenMead
Jul 11 2016 00:57
I am having such a hard time to JavaScript -.-
J Travis Lindsey
@jtlindsey
Jul 11 2016 00:58
This message was deleted
Joseph
@revisualize
Jul 11 2016 00:58
Sup?
Anulekha
@AnulekhaG
Jul 11 2016 00:59

HI ... Need help on stand in line JavaScript
function nextInLine(arr, item) {
// Your code here
arr.push(6);
nextLine = arr.shift();
return nextLine; // Change this line
}

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

what is my error??
mistake*
@AnulekhaG You hard coded 6 into your push.
You should be pushing the number (item).
Also. .shift() returns the number removed.
Anulekha
@AnulekhaG
Jul 11 2016 01:01
we have a add a number at end of the array and remove the 1st element of the array right?
Joseph
@revisualize
Jul 11 2016 01:01
yes.
the number is item
Anulekha
@AnulekhaG
Jul 11 2016 01:02
ohhh ok
Joseph
@revisualize
Jul 11 2016 01:02
It says that in the instructions.
Anulekha
@AnulekhaG
Jul 11 2016 01:02
got it
ty
@revisualize ty
CamperBot
@camperbot
Jul 11 2016 01:02
anulekhag sends brownie points to @revisualize :sparkles: :thumbsup: :sparkles:
:star2: 1409 | @revisualize |http://www.freecodecamp.com/revisualize
Joseph
@revisualize
Jul 11 2016 01:02
// Write a function nextInLine which takes 
// an array (arr) and a number (item) as arguments.
function nextInLine(arr, item) {
    // Add the number to the end of the array,

    // then remove the first element of array.
    // The nextInLine function should 
    // then return the element that was removed.
    return item; // Change this line
}
Aiden
@AidenMead
Jul 11 2016 01:03
Thanks for that @revisualize ! I feel like I'm battling each step of the material, the whole concept it just hard for me to grasp for some reason. HTML and CSS I picked up no problem, but JavaScript is definitely challenging me.
CamperBot
@camperbot
Jul 11 2016 01:03
aidenmead sends brownie points to @revisualize :sparkles: :thumbsup: :sparkles:
:star2: 1410 | @revisualize |http://www.freecodecamp.com/revisualize
Anulekha
@AnulekhaG
Jul 11 2016 01:03
@revisualize got it .. ty :)
CamperBot
@camperbot
Jul 11 2016 01:03
anulekhag sends brownie points to @revisualize :sparkles: :thumbsup: :sparkles:
:warning: anulekhag already gave revisualize points
Joseph
@revisualize
Jul 11 2016 01:04
@AidenMead I have extra links in there for learning JS. There are some good videos online.
runningCoder81
@runningCoder81
Jul 11 2016 01:04
Hey guys, I solved this challenge but it does not show that I have solved it. Am I doing something wrong or is it a bug?

function confirmEnding(str, target) {

var result;

var len = target.length;

var end = str.substr(-len);

if ( end == target )
{
result = "true";
}
else
{
result = "false";
}

return result;

its the confirm the ending on the Basic Alg. Scripting
I solved it using .slice() first, but that did the same thing.
Norvin Burrus
@ndburrus
Jul 11 2016 01:08
@runningCoder81 i think the logic here (-len) needs adjusting. what is (-len) ?
runningCoder81
@runningCoder81
Jul 11 2016 01:08
@ndburrus ok?
Stephen James
@sjames1958gm
Jul 11 2016 01:11
@runningCoder81 "true" is a string and not the value true
runningCoder81
@runningCoder81
Jul 11 2016 01:11
len is the length of target
I subtracted len from str and put it in var end;
then compated them
@sjames1958gm Humm...
Rafael Uzcategui
@rafaelg21
Jul 11 2016 01:12

function rot13(str) { // LBH QVQ VG!
  var n=0;
  var arr=[];
  var arr_At=[];
  arr=str.split("");

  for(var i=0; i<arr.length;i++){
    n=arr[i].charCodeAt(0); 
    if(n>=65 && n<=77) 
      arr_At.push(String.fromCharCode(n+13)); 
    else if(n>=78 && n<=90) {
      arr_At.push(String.fromCharCode(n-13)); 
    }else{
      arr_At.push(String.fromCharCode(n)); 
    }    
  }

  str=arr_At.join("");
  return str;

}

// Change the inputs below to test
rot13("SERR PBQR PNZC");
Gracias ya lo hice, hay alguna forma de reducir mas el codigo?
Joseph
@revisualize
Jul 11 2016 01:13
@runningCoder81 Why does everyone think that if THEY cannot solve a challenge that it is a bug?
Geez.
runningCoder81
@runningCoder81
Jul 11 2016 01:14
@revisualize I don't really think it's a bug, just confused because the output matches the tests
Joseph
@revisualize
Jul 11 2016 01:14
function confirmEnding(str, target) {
  // "Never give up and good luck will find you."
  // -- Falcor
  return str.substr(-target.length) === target;
}
Norvin Burrus
@ndburrus
Jul 11 2016 01:16
@runningCoder81 there is an unmatched curly brace.
Dale Bobermien
@Daleee
Jul 11 2016 01:16
Hi There, is there anyone who can help me with #145
runningCoder81
@runningCoder81
Jul 11 2016 01:16
@revisualize Nice! How did you figure that out, I have been reading the documentation and haven't seen an example like that.
Joseph
@revisualize
Jul 11 2016 01:17
@runningCoder81 It is basically your solution but condensed.
runningCoder81
@runningCoder81
Jul 11 2016 01:17
I think I cut it off when I copied it, I think it's there.
Joseph
@revisualize
Jul 11 2016 01:17
I'm not using random variables when I shouldn't be.
Also, I understand that doing a comparison returns either true or false.
Laura Pope
@lauracpope
Jul 11 2016 01:18
Hey, how do I get my code from FreeCodeCamp, to show up nicely here (with the black background, etc)?
michael dorsey
@mikedorsey1021
Jul 11 2016 01:18
hello everyone. I am on the first algorithm challenge. reverse a string. I believe that i have a pretty good understanding of the javascript script language thus far. my question is how would i approach a problem like the one that i am facing. my objective was to write some code that would allow me to pass through a string and the string is reversed. problem is that I'm not sure how i would approach this problem. my thinking is that i can write a function that will first make the string into an array, then .split(); that array, then .reverse(); it, and finally .join(); it before it returns back to me the final reversed string. here is existing code:
function reverseString(str) {
  str = [str]; //making the string into an array



  /*
  ==============================
  code below is supposed to attempt the 
  explaination giving in the discription 
  of this problem.
  ==============================

  */
  var splitString = function (){    //Im sure that an if statement would work but not sure
                                    //how to properly set it up to do what i want
    str.split();
  };

  var reverseString = function(){
    splitString.reverse();
  };

  var joinAgain = function (){
    reverseString.join();
  };



  return str;
}

reverseString("hello");
João Ricardo Lhullier Lugão
@jlugao
Jul 11 2016 01:18
hey guys... I can't seem to make geolocation work on codepen
none faced this before?
I am getting access denied errors
revisualize @revisualize is afk. Walking home.
Norvin Burrus
@ndburrus
Jul 11 2016 01:19
This message was deleted
help format @laurcpope
using Shift + enter will give you additional line feeds (space) for pasting your code. also, the backticks (`) key is located to the left of the number one (#1) key.
in addition, you may find the two buttons (chat/compose & markdown - the chat/compose button alternates modes) to the right of the text entry area helpful.
CamperBot
@camperbot
Jul 11 2016 01:19

: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

Jaren Escueta
@jarenescueta731
Jul 11 2016 01:22
@jlugao are you using geolocation for the weather app project?
João Ricardo Lhullier Lugão
@jlugao
Jul 11 2016 01:22
yup
well trying to
Rose
@AIAGAX1
Jul 11 2016 01:23
Hi, anyone able to help me with javascript? "Local Scope and Functions" ReferenceError: myVar is not defined
João Ricardo Lhullier Lugão
@jlugao
Jul 11 2016 01:23
@jarenescueta731 what is weird is that other people's code ssem to work
@AIAGAX1 can you post the code here??
Olly Sholotan
@Ollysho
Jul 11 2016 01:24
@AIAGAX1 post the code
Jaren Escueta
@jarenescueta731
Jul 11 2016 01:24
@jlugao i assume you're using the ip-api.com api?
Olly Sholotan
@Ollysho
Jul 11 2016 01:24
@AIAGAX1 it may be a simple matter of adding var right behind the word myVar
runningCoder81
@runningCoder81
Jul 11 2016 01:25
@sjames1958gm Thanks! I took off the "" and it all works.
CamperBot
@camperbot
Jul 11 2016 01:25
runningcoder81 sends brownie points to @sjames1958gm :sparkles: :thumbsup: :sparkles:
:star2: 1775 | @sjames1958gm |http://www.freecodecamp.com/sjames1958gm
Darshan
@Dave1089
Jul 11 2016 01:25
@Will-is-Coding thanks.. I solved it
CamperBot
@camperbot
Jul 11 2016 01:25
dave1089 sends brownie points to @will-is-coding :sparkles: :thumbsup: :sparkles:
:cookie: 470 | @will-is-coding |http://www.freecodecamp.com/will-is-coding
João Ricardo Lhullier Lugão
@jlugao
Jul 11 2016 01:26
@jarenescueta731 no, I am trying to do something like this
if (navigator.geolocation) {
  navigator.geolocation.getCurrentPosition(function(position) {
    $("#data").html("latitude: " + position.coords.latitude + "<br>longitude: " + position.coords.longitude);
  });
}
Jaren Escueta
@jarenescueta731
Jul 11 2016 01:28
@jlugao does navigator.geolocation have a value of true?
João Ricardo Lhullier Lugão
@jlugao
Jul 11 2016 01:29
yes, I tried debugging a little more and it seems that I don't have permission to do this
Jaren Escueta
@jarenescueta731
Jul 11 2016 01:30
@jlugao where does the navigator object come from?
Laura Pope
@lauracpope
Jul 11 2016 01:30
// 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 (prop !== "tracks" && value.length !== 0) {
  collection[id][prop] = value;
} 
  else if (prop === "tracks" && value.length !== 0) {
  collection[id][prop] = [];
  collection[id][prop].push(value);
} 
  else if(value === ""){
  delete collection[id][prop];
}
  return collection;
}

// Alter values below to test your code
updateRecords(2468, "tracks", "Free");
I'm really stuck on the 2468 id, I can't seem to figure out what they would like
João Ricardo Lhullier Lugão
@jlugao
Jul 11 2016 01:31
@jarenescueta731 not sure
michael dorsey
@mikedorsey1021
Jul 11 2016 01:31
hello everyone. I am on the first algorithm challenge. reverse a string. I believe that i have a pretty good understanding of the javascript script language thus far. my question is how would i approach a problem like the one that i am facing. my objective was to write some code that would allow me to pass through a string and the string is reversed. problem is that I'm not sure how i would approach this problem. my thinking is that i can write a function that will first make the string into an array, then .split(); that array, then .reverse(); it, and finally .join(); it before it returns back to me the final reversed string. here is existing code:
function reverseString(str) {
  str = [str]; //making the string into an array



  /*
  ==============================
  code below is supposed to attempt the 
  explaination giving in the discription 
  of this problem.
  ==============================

  */
  var splitString = function (){    //Im sure that an if statement would work but not sure
                                    //how to properly set it up to do what i want
    str.split();
  };

  var reverseString = function(){
    splitString.reverse();
  };

  var joinAgain = function (){
    reverseString.join();
  };



  return str;
}

reverseString("hello");
Jaren Escueta
@jarenescueta731
Jul 11 2016 01:32
@jlugao i mean, how do you know what the properties of navigator are? is it defined somewhere else in your code?
João Ricardo Lhullier Lugão
@jlugao
Jul 11 2016 01:34
@jarenescueta731 no, it isn't defined. I just know that geolocation is true (or true-ish) because I added an else statement...
Rose
@AIAGAX1
Jul 11 2016 01:35
@Ollysho sorry something went wrong when I was trying to send the code. Thanks anyway :smile:
CamperBot
@camperbot
Jul 11 2016 01:35
aiagax1 sends brownie points to @ollysho :sparkles: :thumbsup: :sparkles:
:cookie: 231 | @ollysho |http://www.freecodecamp.com/ollysho
Justin Woodward
@jwoo92
Jul 11 2016 01:35
@mikedorsey1021 you are on the right path. make it all inside one function.
João Ricardo Lhullier Lugão
@jlugao
Jul 11 2016 01:35
I also added some callbacks for the error and it worked, and from what I found out is that I some how don't have permission
Olly Sholotan
@Ollysho
Jul 11 2016 01:35
@AIAGAX1 All good :)
Justin Woodward
@jwoo92
Jul 11 2016 01:35
@mikedorsey1021 all inside the reverseString function. this is where you are doing your magic.
Rose
@AIAGAX1
Jul 11 2016 01:36

function myLocalScope() {
'use strict';

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

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

Jaren Escueta
@jarenescueta731
Jul 11 2016 01:36
@jlugao yeah, i dunno man sorry. codepen can have weird rules sometimes
Rose
@AIAGAX1
Jul 11 2016 01:37
this is the code i'm stuck on... "Local Scope and Functions" in javascript.
Justin Woodward
@jwoo92
Jul 11 2016 01:37
@AIAGAX1 which section is it under?
João Ricardo Lhullier Lugão
@jlugao
Jul 11 2016 01:37
@jarenescueta731 I'll google a bit more then... lol... thanks man
CamperBot
@camperbot
Jul 11 2016 01:37
jlugao sends brownie points to @jarenescueta731 :sparkles: :thumbsup: :sparkles:
:cookie: 311 | @jarenescueta731 |http://www.freecodecamp.com/jarenescueta731
Justin Woodward
@jwoo92
Jul 11 2016 01:37
@jlugao what are you stuck on?
João Ricardo Lhullier Lugão
@jlugao
Jul 11 2016 01:38
@jwoo92 can't make geolocation work on codepen
Olly Sholotan
@Ollysho
Jul 11 2016 01:38
@AIAGAX1 You just haven't set myVar to anything yet, what is the lessons trying to get you to do?
Justin Woodward
@jwoo92
Jul 11 2016 01:38
@jlugao do you use chrome?
João Ricardo Lhullier Lugão
@jlugao
Jul 11 2016 01:38
yes
@jwoo92 yes, I do
Aiden
@AidenMead
Jul 11 2016 01:39
@AIAGAX1 there's two parts, first, inside the function, you have to declare the var myVar, run, then in the second part, follow the comments and remove the second "console.log"
Olly Sholotan
@Ollysho
Jul 11 2016 01:39
@AIAGAX1 it looks like earlier in the code you should say something like var myVar = "Chilli" that way the Javascript knows what to echo out when you want it to log myVar
Rose
@AIAGAX1
Jul 11 2016 01:39
it says: myVar is not defined
Justin Woodward
@jwoo92
Jul 11 2016 01:39
@jlugao that is why. geolocation and chrome do not match up well anymore. to combat that issue, get location through the ip's location. use this : http://ip-api.com/json
falconpunch12
@falconpunch12
Jul 11 2016 01:39
is someone available to provide guidance with Title Case a Sentence
Justin Woodward
@jwoo92
Jul 11 2016 01:39
@falconpunch12 whats up
Rose
@AIAGAX1
Jul 11 2016 01:40
@Ollysho okay, I'll try that.
João Ricardo Lhullier Lugão
@jlugao
Jul 11 2016 01:40
@jwoo92 what is weird is that I found some pens which use geolocation, however I can't find anything diferent... will use the api so I can move on. Thanks man
CamperBot
@camperbot
Jul 11 2016 01:40
jlugao sends brownie points to @jwoo92 :sparkles: :thumbsup: :sparkles:
:cookie: 387 | @jwoo92 |http://www.freecodecamp.com/jwoo92
falconpunch12
@falconpunch12
Jul 11 2016 01:40
@jwoo92 just been all over the place with this.. this is what i have at the moment

function titleCase(str) {
  var letter = str.split(" ");
  var upperCase = [];
  for(var x = 0; x<letter.length;x++){
    upperCase.push(letter[x][0].toUpperCase());

    }

  return upperCase;
}

titleCase("I'm a little tea pot");
Justin Woodward
@jwoo92
Jul 11 2016 01:41
@jlugao it can be done under https
@jlugao the api will be easier in your case.
Rose
@AIAGAX1
Jul 11 2016 01:41
Instructions:
Declare a local variable myVar inside myLocalScope. Run the tests and then follow the instructions commented out in the editor.
falconpunch12
@falconpunch12
Jul 11 2016 01:41
was going to use slice but im not sure how that would apply to an array..
Rose
@AIAGAX1
Jul 11 2016 01:42

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

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

João Ricardo Lhullier Lugão
@jlugao
Jul 11 2016 01:42
@falconpunch12 when you do srt.split(" ") you get words
then str.split("") to get letters
Jaren Escueta
@jarenescueta731
Jul 11 2016 01:43
@laurcpope did you ever get help with your Record Collection problem?
Olly Sholotan
@Ollysho
Jul 11 2016 01:43
@AIAGAX1 could you please past the whole code from the eidotr in here? use the ticks to format it and stuf
João Ricardo Lhullier Lugão
@jlugao
Jul 11 2016 01:43
and push sends the new item to the end of the array, so you probabbly want to use unshift there
falconpunch12
@falconpunch12
Jul 11 2016 01:44
i tried that as well but then its all jumbled up into a massive array with just individual letters. how can i get it to know when one word starts or ends
João Ricardo Lhullier Lugão
@jlugao
Jul 11 2016 01:46
split by words and then for each word split by letters
Justin Woodward
@jwoo92
Jul 11 2016 01:46
@falconpunch12 the way i did it was similiar to the way you started. i started with var arr = str.toLowerCase().split(' ');. so you are on the right track. then what i did was use a for loop for each word then i used a regex to replace the first letter with an upper case version. then returned the string.
@jlugao no need to split the letters, only the words in his case.
falconpunch12
@falconpunch12
Jul 11 2016 01:47
@jwoo92 just curious... which expression did you use?
i just spent 30 minutes sifting through the list..
João Ricardo Lhullier Lugão
@jlugao
Jul 11 2016 01:48
@jwoo92 if he wants to use push, pop, shift, unshift to change the case of the letters
Justin Woodward
@jwoo92
Jul 11 2016 01:49
the first part of the regular expression targets the first letter in the word. then i replace it with a function that returns .toUpperCase() of the character. @falconpunch12
João Ricardo Lhullier Lugão
@jlugao
Jul 11 2016 01:49
he must turn them into arrays, as string cannot be modified like that
Jaren Escueta
@jarenescueta731
Jul 11 2016 01:49
@laurcpope anyway, in your first else-if you are reassigning the value of collection[id][prop] as an empty array, but you shouldn't! get rid of that line and see if it works.
Justin Woodward
@jwoo92
Jul 11 2016 01:49
@jlugao there are many ways, the way he is attempting to do it currently is along the lines of what i am explaining to him. no need to confuse him when he is close already :)
@jlugao he has his words split already by whitespace, a regex can take care of the rest :)
falconpunch12
@falconpunch12
Jul 11 2016 01:51
@jwoo92 i was thinking the same thing but i cant find anything in the regex directory that might do this. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions#special-non-word
its been super frustrating -_-
soheilhm
@soheilhm
Jul 11 2016 01:51
Hi all,
Can somebody help with the profile lookup excercise on JavaScript? I have been stuck with it for a while and can't seem to be able to debug it
Laura Pope
@lauracpope
Jul 11 2016 01:52
@jarenescueta731 not yet... still trying to figure it out
Justin Woodward
@jwoo92
Jul 11 2016 01:52
@falconpunch12 hint: the first part...now just need a function that returns what you want replaced ;) .replace(/^./, function here)
João Ricardo Lhullier Lugão
@jlugao
Jul 11 2016 01:52
@jwoo92 he named the variable letters and he is trying to iterate them as letters... Plus he is using a push, so I figured he was doing something along the lines of what I said, that is why I suggested doing it that way
falconpunch12
@falconpunch12
Jul 11 2016 01:53
@jwoo92 @jlugao thanks guys, going to go back to the drawing board lol
CamperBot
@camperbot
Jul 11 2016 01:53
falconpunch12 sends brownie points to @jwoo92 and @jlugao :sparkles: :thumbsup: :sparkles:
:cookie: 388 | @jwoo92 |http://www.freecodecamp.com/jwoo92
:cookie: 264 | @jlugao |http://www.freecodecamp.com/jlugao
Laura Pope
@lauracpope
Jul 11 2016 01:53
@jarenescueta731 that gave me a type error, on the code in the line below
Justin Woodward
@jwoo92
Jul 11 2016 01:53
@jlugao i like your answer on it as well. he will get it either way i am sure.
soheilhm
@soheilhm
Jul 11 2016 01:53

this is the function that I wrote, but for some reason it is failing one of the tests, would appreciate any help:

function lookUpProfile(firstName, prop){
// Only change code below this line
var result;
var contactExists = false;
var propExists = false;
for (var i = 0; i < contacts.length - 1; i++) {
var obj = contacts[i];
if (obj.firstName === firstName) {
contactExists = true;
if (obj.hasOwnProperty(prop)){
propExists = true;
result = obj[prop];
}
}
}
if (contactExists) {
if (propExists) {
return result;
} else {
return "No such property";
}
} else {
return "No such contact";
}

// Only change code above this line
}

Justin Woodward
@jwoo92
Jul 11 2016 01:54
@falconpunch12 you are very close.
João Ricardo Lhullier Lugão
@jlugao
Jul 11 2016 01:56
lol... I went back to check and I solved using slice... and concatenating the rest of the word to the end... it looks horrible, but in the real world I'd go with regex and replace too
Justin Woodward
@jwoo92
Jul 11 2016 01:59
@jlugao i think it looks great. always more than one way to solve a puzzle :)
Clayharms
@Clayharms
Jul 11 2016 02:00
Could someone help me with "Increment" in javascript?
João Ricardo Lhullier Lugão
@jlugao
Jul 11 2016 02:00
@jwoo92 yeah, I figured that this lesson was about algorithm thinking and not efficiency... however it is always nice to avoid loops and such in the real world
@Clayharms how can we help?
Olly Sholotan
@Ollysho
Jul 11 2016 02:00
@soheilhm put three ticks and then your code. The format wil be easier to read
Justin Woodward
@jwoo92
Jul 11 2016 02:01
@jlugao that is exactly right, you can always come back and find a more simple solution later.
Clayharms
@Clayharms
Jul 11 2016 02:01

var myVar = 87;

// Only change code below this line
myVar = myVar + 1;

I'm supposed to use i++;

Justin Woodward
@jwoo92
Jul 11 2016 02:01
This message was deleted
Clayharms
@Clayharms
Jul 11 2016 02:02
I'm not sure how to use "i++;" to turn 87 to 88
João Ricardo Lhullier Lugão
@jlugao
Jul 11 2016 02:02
@Clayharms myVar++;
Clayharms
@Clayharms
Jul 11 2016 02:02
@jlugao thanks a bunch!
CamperBot
@camperbot
Jul 11 2016 02:02
clayharms sends brownie points to @jlugao :sparkles: :thumbsup: :sparkles:
:cookie: 265 | @jlugao |http://www.freecodecamp.com/jlugao
João Ricardo Lhullier Lugão
@jlugao
Jul 11 2016 02:02
you can use the ++ operator with any variable, not just i
Clayharms
@Clayharms
Jul 11 2016 02:02
oh ok, thanks that helps a lot @jlugao
CamperBot
@camperbot
Jul 11 2016 02:03
clayharms sends brownie points to @jlugao :sparkles: :thumbsup: :sparkles:
:warning: clayharms already gave jlugao points
Justin Woodward
@jwoo92
Jul 11 2016 02:03
@Clayharms this will make count = count = 1;
var count = 0;
count++;
Chad Hurley
@ChadDean82
Jul 11 2016 02:03
Ok My camp Friends anyone know what I have going on here that is not jiving right?
var myStr = "FirstLine\n\SecondLine\rThirdLine\";
Diego Mayer
@Chrono79
Jul 11 2016 02:04
var myStr = "FirstLine\n\\SecondLine\rThirdLine\\"; @ChadDean82
You're not escaping it well, you need a backslash after SecondLine (escaped) and don't need the backslash at the end
Chad Hurley
@ChadDean82
Jul 11 2016 02:04
Escape Sequences in Strings
goyalruchi90
@goyalruchi90
Jul 11 2016 02:04
help difftwoarray
CamperBot
@camperbot
Jul 11 2016 02:04
no wiki entry for: difftwoarray
goyalruchi90
@goyalruchi90
Jul 11 2016 02:04
help Diff Two Arrays
CamperBot
@camperbot
Jul 11 2016 02:04

:point_right: algorithm diff two arrays [wiki]

Algorithm Diff Two Arrays

: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:

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

Relevant Links

:pencil: read more about algorithm diff two arrays on the FCC Wiki

João Ricardo Lhullier Lugão
@jlugao
Jul 11 2016 02:05
@jwoo92 just solved the geolocation problem I just had to put https:// before codepen's link
Archangelpak
@Archangelpak
Jul 11 2016 02:05

var a = 3;
var b = 17;
var c = 12;

// Only modify code below this line

var a =+ a + 12;
var b =+ 9 + b;
var c = c += 7;

Justin Woodward
@jwoo92
Jul 11 2016 02:05
@jlugao that is what i was saying when i mentioned https. it gets annoying though doing it that way.
Steve Gregg
@sgregg85
Jul 11 2016 02:06
I am doing the "Friendly Date Range" Challenge and I keep getting an error that says "https://repl.it/C9ca/6" but every other site runs the code fine without an error, https://repl.it/C9ca/6. Can anyone help me find out why FCC won't take my code
Archangelpak
@Archangelpak
Jul 11 2016 02:06

var a = 3;
var b = 17;
var c = 12;

// Only modify code below this line


var a =+ a + 12;
var b =+ 9 + b;
var c = c += 7;
Chad Hurley
@ChadDean82
Jul 11 2016 02:06
@Chrono79 var myStr = "FirstLine\n\SecondLine\rThirdLine\";
Archangelpak
@Archangelpak
Jul 11 2016 02:06
pls help guys
Steve Gregg
@sgregg85
Jul 11 2016 02:07
Error says "SyntaxError: Unexpected token }"
João Ricardo Lhullier Lugão
@jlugao
Jul 11 2016 02:07
gonna finish this some other time thou... is late and I have to work tomorrow...
thanks againd for the help @jwoo92
CamperBot
@camperbot
Jul 11 2016 02:07
jlugao sends brownie points to @jwoo92 :sparkles: :thumbsup: :sparkles:
:warning: jlugao already gave jwoo92 points
Chad Hurley
@ChadDean82
Jul 11 2016 02:07
like that cause that poped a lot of errors
Diego Mayer
@Chrono79
Jul 11 2016 02:07
@ChadDean82 remove the backslash before the last "
and you need another backslash after SecondLine, 2 backslashes = 1 escaped backslash, \r = carriage return, so you need 3 backslashes together
João Ricardo Lhullier Lugão
@jlugao
Jul 11 2016 02:07
@Archangelpak the syntax is += not =+
Justin Woodward
@jwoo92
Jul 11 2016 02:07
@jlugao anytime, good luck.
Ara Yaghsizian
@MurphyPicard
Jul 11 2016 02:08
I'm a little lost on step 173
João Ricardo Lhullier Lugão
@jlugao
Jul 11 2016 02:08
@Archangelpak a += 3 is the same as a = a + 3
Chad Hurley
@ChadDean82
Jul 11 2016 02:08
@Archangelpak Your var 9 need's to be put in its right place to match the rest. if that is where You are getting the error
Steve Gregg
@sgregg85
Jul 11 2016 02:09
I am doing the "Friendly Date Range" Challenge and I keep getting an error on FCC that says "SyntaxError: Unexpected token }" but every other site runs the code fine without an error such as https://repl.it/C9ca/6. Can anyone help me find out why FCC won't take my code
Diego Mayer
@Chrono79
Jul 11 2016 02:09
@MurphyPicard there are no steps, those are brownie points, state the challenge name
Chad Hurley
@ChadDean82
Jul 11 2016 02:09
@Chrono79 thank YOu
CamperBot
@camperbot
Jul 11 2016 02:09
chaddean82 sends brownie points to @chrono79 :sparkles: :thumbsup: :sparkles:
:star2: 1467 | @chrono79 |http://www.freecodecamp.com/chrono79
Randy Goldsmith
@Dueldrawer8
Jul 11 2016 02:11
how do i add transparency or fade the background a little more behind the text?
http://codepen.io/duel_drawer8/pen/xOLErV/
Ara Yaghsizian
@MurphyPicard
Jul 11 2016 02:12
On step 173, first I have to add a number to the end of an array, I believe with the arr.push(item) method. Then I have to remove the first element of the array and I thought they were asking me to use arr.shift() but it says arr.shift is not a function.
I'm confused
Archangelpak
@Archangelpak
Jul 11 2016 02:12
@ChadDean82 I dont get any errors it just have a cross on this task You should use the += operator for each variable
Randy Goldsmith
@Dueldrawer8
Jul 11 2016 02:12
anyone?
Diego Mayer
@Chrono79
Jul 11 2016 02:12
@MurphyPicard paste your code
Ara Yaghsizian
@MurphyPicard
Jul 11 2016 02:13
function nextInLine(arr, item) {
// Your code here
arr = arr.push(item);
arr.shift();
return arr[0]; // Change this line
}
Aiden
@AidenMead
Jul 11 2016 02:13
@Dueldrawer8 you can use opacity in css
Diego Mayer
@Chrono79
Jul 11 2016 02:13
@MurphyPicard arr.push(item) returns something, the new length of the array, that's a number, so if you overwrite arr with that, a number hasn't a shift method
Aiden
@AidenMead
Jul 11 2016 02:13
in the css, add "opacity: 0.5;" to the img
or really any value between 0.0 and 1.0
Dylan
@dhcodes
Jul 11 2016 02:14
@sgregg85 seems to be the one at line 46, can't figure out why
Norvin Burrus
@ndburrus
Jul 11 2016 02:14
@MurphyPicard how are you handling the outcome desired?
Randy Goldsmith
@Dueldrawer8
Jul 11 2016 02:14
@AidenMead its not set as an img element..its set as a background: url()
Ara Yaghsizian
@MurphyPicard
Jul 11 2016 02:14
Write a function nextInLine which takes an array (arr) and a number (item) as arguments. Add the number to the end of the array, then remove the first element of array. The nextInLine function should then return the element that was removed.
Dylan
@dhcodes
Jul 11 2016 02:14
@MurphyPicard give it a diff name
Ara Yaghsizian
@MurphyPicard
Jul 11 2016 02:14
Thats the instructions
Aiden
@AidenMead
Jul 11 2016 02:15
@Dueldrawer8 should still apply
Diego Mayer
@Chrono79
Jul 11 2016 02:15

@MurphyPicard

@MurphyPicard arr.push(item) returns something, the new length of the array, that's a number, so if you overwrite arr with that, a number hasn't a shift method

You don't need to do arr = arr.push(item);

Chad Hurley
@ChadDean82
Jul 11 2016 02:15
@Archangelpak let Me take a closer look real quik.
Ara Yaghsizian
@MurphyPicard
Jul 11 2016 02:16
doesn't push just make the array longer
Randy Goldsmith
@Dueldrawer8
Jul 11 2016 02:16
@AidenMead i think i need to use rgba somehow.. i want to fade the background without fading the text
Aiden
@AidenMead
Jul 11 2016 02:16
@Dueldrawer8 how's you css written for the background image?
Diego Mayer
@Chrono79
Jul 11 2016 02:16
@MurphyPicard don't overwrite arr with arr.push, just use push
Archangelpak
@Archangelpak
Jul 11 2016 02:17
@ChadDean82 sure
Chad Hurley
@ChadDean82
Jul 11 2016 02:18
@ChadDean82 @Archangelpak ok Your c code in correct You should make the others look the same ex being 3 + 12 = 15
Ara Yaghsizian
@MurphyPicard
Jul 11 2016 02:18
function nextInLine(arr, item) {
// Your code here
arr.push(item);
return arr[0]; // Change this line
}
better
Aiden
@AidenMead
Jul 11 2016 02:18
@Dueldrawer8 thanks! for some reason I forgot you had posted that earlier, let me take a look for a moment
CamperBot
@camperbot
Jul 11 2016 02:18
aidenmead sends brownie points to @dueldrawer8 :sparkles: :thumbsup: :sparkles:
:cookie: 409 | @dueldrawer8 |http://www.freecodecamp.com/dueldrawer8
Diego Mayer
@Chrono79
Jul 11 2016 02:18
@MurphyPicard another thing:
return arr[0]; after using shift, won't return the element removed because it isn't part of the array anymore
read this: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/shift
Chad Hurley
@ChadDean82
Jul 11 2016 02:19
@Archangelpak as Your c = 19
Archangelpak
@Archangelpak
Jul 11 2016 02:20
@ChadDean82 let me try
Michael Hansen
@mmhansen
Jul 11 2016 02:20
hey, I just finished the 'check for palindromes challange and I'd love to see other's code
Randy Goldsmith
@Dueldrawer8
Jul 11 2016 02:20
@AidenMead ok
Ara Yaghsizian
@MurphyPicard
Jul 11 2016 02:23
I feel like I don't understand the question. First I am supposed to make the array one item longer right? Then I am supposed to remove the first item in the array, MAYBE. Then I am supposed to return the first item in the array... the new array or the old array?
Write a function nextInLine which takes an array (arr) and a number (item) as arguments. Add the number to the end of the array, then remove the first element of array. The nextInLine function should then return the element that was removed.
Diego Mayer
@Chrono79
Jul 11 2016 02:24

@MurphyPicard

Write a function nextInLine which takes an array (arr) and a number (item) as arguments. Add the number to the end of the array, then remove the first element of array. The nextInLine function should then return the element that was removed.

The element that was removed is the one you removed with shift

Matt
@TheeMattOliver
Jul 11 2016 02:24
@Ikarus11 hey there, this is how I did it. It may be seen as naive or remedial but I was just psyched to get it done!
function palindrome(str) {

  var re = /[^A-Za-z0-9]/g; //Removing spaces from the argument passed to palindrome using RegExp

  var lowRegStr = str.toLowerCase().replace(re, ''); //converting all letters to lowercase and replacing with the RegExp

  var reverseString = lowRegStr.split('').reverse().join(''); //chaining three functions to split lowRegStr into an array, reverse the array, then rejoin into a string

 return lowRegStr === reverseString;
}

var output = palindrome("My age is 0, 0 si ega ym.");
Ara Yaghsizian
@MurphyPicard
Jul 11 2016 02:24
ok the first number in the old array
Aiden
@AidenMead
Jul 11 2016 02:24
@Dueldrawer8 i see what you're saying, the img and text is seen as one element, so it will only allow you to edit the opacity of the element as a whole.
Diego Mayer
@Chrono79
Jul 11 2016 02:25
@MurphyPicard have you read about shift and what it returns?
The shift() method removes the first element from an array and returns that element.
Aiden
@AidenMead
Jul 11 2016 02:25
rgba format does the same, views it as a single element
Ara Yaghsizian
@MurphyPicard
Jul 11 2016 02:25
I thought shift removes the first item in an array
Diego Mayer
@Chrono79
Jul 11 2016 02:25
yes, it does, but it also returns it, so you don't need to store it before using shift
Ara Yaghsizian
@MurphyPicard
Jul 11 2016 02:26

function nextInLine(arr, item) {
// Your code here
arr.push(item);

return arr.shift(); // Change this line
}

Diego Mayer
@Chrono79
Jul 11 2016 02:26
:+1:
Ara Yaghsizian
@MurphyPicard
Jul 11 2016 02:27
gracias @Chrono79
Diego Mayer
@Chrono79
Jul 11 2016 02:27
no problem
Ara Yaghsizian
@MurphyPicard
Jul 11 2016 02:27
I thought I had to take off the first number first
I apprecaite it
Diego Mayer
@Chrono79
Jul 11 2016 02:27
always read MDN docs when learning about a new method to see what it does
Ara Yaghsizian
@MurphyPicard
Jul 11 2016 02:28
also, how do I stop all these pop ups of every message
Diego Mayer
@Chrono79
Jul 11 2016 02:28
in the chat?
Ara Yaghsizian
@MurphyPicard
Jul 11 2016 02:28
I see what you write here but theres also a pop up
Randy Goldsmith
@Dueldrawer8
Jul 11 2016 02:29
@AidenMead hmm.. thanks anyway
CamperBot
@camperbot
Jul 11 2016 02:29
dueldrawer8 sends brownie points to @aidenmead :sparkles: :thumbsup: :sparkles:
:cookie: 191 | @aidenmead |http://www.freecodecamp.com/aidenmead
Diego Mayer
@Chrono79
Jul 11 2016 02:29
if it's full screen, upper right corner the icon right of the star: Room settings - Notifications
Ara Yaghsizian
@MurphyPicard
Jul 11 2016 02:29
I put only notify me when Im directly mentioned, is that correct?
Diego Mayer
@Chrono79
Jul 11 2016 02:29
I use that
Ara Yaghsizian
@MurphyPicard
Jul 11 2016 02:30
ok thanks again
Archangelpak
@Archangelpak
Jul 11 2016 02:31
thank you very muchg
I solve it
Diego Mayer
@Chrono79
Jul 11 2016 02:31
that config works per room, so if you enter another one, you have to set that value again in the new room @MurphyPicard
Aiden
@AidenMead
Jul 11 2016 02:32
@Dueldrawer8 easiest thing I can think is to create a separate div that surrounds your header text, with a unique id, and set the background img properties just to that div, with the header text inside, but that way the opacity would be applied only to the background img with the unique id.
Ara Yaghsizian
@MurphyPicard
Jul 11 2016 02:33
Oh ok I didn't know that, I was getting hundreds of popups lol
Randy Goldsmith
@Dueldrawer8
Jul 11 2016 02:34
@AidenMead i just added a border and used rgba
i don't particulary like the boxes surrounding but i guess its what i have to do for now
soheilhm
@soheilhm
Jul 11 2016 02:34
I solved it
Randy Goldsmith
@Dueldrawer8
Jul 11 2016 02:34
what do you think? i may round the cornors
tylerprosper
@removed~tylerprosper
Jul 11 2016 02:38

Ok I've finally gotten my function to work but I'm still iffy on completely understanding it.

Can anyone clarify it for me I have a few questions


// 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 (prop === "tracks" && value !== "") {
   if(collection[id][prop]) {
    collection[id][prop].push(value);
   }
   else {
    collection[id][prop]=[value];
   }
  } else if (value !== "") {
    collection[id][prop] = value;
  } else {
    delete collection[id][prop];
  }

  return collection;
}

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

What exactly is happening with the first else statement

Archangelpak
@Archangelpak
Jul 11 2016 02:40
does free codecamp supports angular js course?
ronaldrdguez
@ronaldrdguez
Jul 11 2016 02:41
@Dueldrawer8 I would try a different color than yellow, or maybe keep the yellow but change the position lower to have it against the black of the background pic. front end We….. <- hard to read.
Randy Goldsmith
@Dueldrawer8
Jul 11 2016 02:42
@ronaldrdguez yes i was just experimenting.. i want to keep it all white
maybe even turn it to a dark-medium red- maroon color
@ronaldrdguez i may surround that logo with a border as well and fade it
Ara Yaghsizian
@MurphyPicard
Jul 11 2016 02:45
Is this incorrect in any way?

function trueOrFalse(wasThatTrue) {

// Only change code below this line.
if (true) {
return "Yes, that was true";
}
return "No, that was false";
}

ronaldrdguez
@ronaldrdguez
Jul 11 2016 02:46
@Dueldrawer8 Ok, as long as its readable : )
@MurphyPicard Looks like it, it always returns true.
Ara Yaghsizian
@MurphyPicard
Jul 11 2016 02:51
// Example
function ourTrueOrFalse(isItTrue) {
if (isItTrue) {
return "Yes, it's true";
}
return "No, it's false";
}
I was trying to copy this example
Charles Sexton
@Grimlek
Jul 11 2016 02:52

truncateString("A-tisket a-tasket A green and yellow basket", "A-tisket a-tasket A green and yellow basket".length + 2) should return "A-tisket a-tasket A green and yellow basket".

This problem runs twice and it causes my code to fail. I can't figure out why. I pass all the problems but this one. Can anyone help? Is this a bug?

Ara Yaghsizian
@MurphyPicard
Jul 11 2016 02:53
oh I wasnt supposed to write true
DJ
@qualitymanifest
Jul 11 2016 02:53
@MurphyPicard you're supposed to use the wasThatTrue variable that was passed into your function
@Grimlek paste your code
Ara Yaghsizian
@MurphyPicard
Jul 11 2016 02:53
@qualitymanifest TY I just realised that
CamperBot
@camperbot
Jul 11 2016 02:53
murphypicard sends brownie points to @qualitymanifest :sparkles: :thumbsup: :sparkles:
:star2: 1264 | @qualitymanifest |http://www.freecodecamp.com/qualitymanifest
Charles Sexton
@Grimlek
Jul 11 2016 02:54
function truncate(str, num) {
var newStr = '';
if (str.length > num) {
newStr = str.slice(0, num - 3) + '...';
return newStr;
}
return str;
}
Ara Yaghsizian
@MurphyPicard
Jul 11 2016 02:54
How do you send brownie points? I'll send you a couple for sure
Brian
@BrianCodes33
Jul 11 2016 02:54
function mutation(arr) {
  var test = arr[0].toLowerCase();
  var target = arr[1].toLowerCase();
  for (var i=0; i<test.length; i++) {
   if (target.indexOf(test[i]) < 0) 
     return false;
   } 
     return true;
}


mutation(["hello", "hey"]);
what am i doing wrong
Charles Sexton
@Grimlek
Jul 11 2016 02:55

output for problem above with some console logs.....

num length = 43
str length = 43
num length = 45
str length = 43
newStr = A-tisket a-tasket A green and yellow basket
newStr = A-tisket a-tasket A green and yellow baske...

problem four is the only one that fails....
Diego Mayer
@Chrono79
Jul 11 2016 02:56
@MurphyPicard
DJ
@qualitymanifest
Jul 11 2016 02:56
@Grimlek that's not your failing test though? the ones that fail are truncateString("A-", 1) and truncateString("Absolutely Longer", 2)
Diego Mayer
@Chrono79
Jul 11 2016 02:57
This message was deleted
CamperBot
@camperbot
Jul 11 2016 02:57
no wiki entry for: brownies
Diego Mayer
@Chrono79
Jul 11 2016 02:57
help brownie points
CamperBot
@camperbot
Jul 11 2016 02:57

:point_right: brownie points [wiki]

Brownie Points

The number beside your picture on Free Code Camp tells you how many Brownie Points you have.

A user profile picture next to a with Brownie Points score

There are two ways you can get Brownie Points:

  1. Complete challenges - you get one point per challenge you complete
  2. Help other campers in chat - each time you help another camper and they thank you (by typing "thanks @yourname"), you will get a point

Brownie Points help you look like the kind of person who codes a lot, shares relevant links, and helps people.

They also add to your Streak.

:pencil: read more about brownie points on the FCC Wiki

Ara Yaghsizian
@MurphyPicard
Jul 11 2016 02:58
thanks @qualitymanifest thanks @camperbot
CamperBot
@camperbot
Jul 11 2016 02:58
murphypicard sends brownie points to @qualitymanifest and @camperbot :sparkles: :thumbsup: :sparkles:
:warning: murphypicard already gave qualitymanifest points
:star2: 2039 | @camperbot |http://www.freecodecamp.com/camperbot
Diego Mayer
@Chrono79
Jul 11 2016 02:58
@BrianCodes33 you have your test and target reversed in the indexOf maybe, also in the loop condition. you could change them there or when you create them before
Charles Sexton
@Grimlek
Jul 11 2016 02:59
@qualitymanifest your right give me two seconds to change
Ara Yaghsizian
@MurphyPicard
Jul 11 2016 02:59
I didn't think they were real lol. I learned something today :-)
DJ
@qualitymanifest
Jul 11 2016 03:00

truncateString("A-", 1) should return A... but instead returns ... per the instructions:

if the given maximum string length num is less than or equal to 3, then the addition of the three dots does not add to the string length in determining the truncated string.

如风
@rufeng2015
Jul 11 2016 03:00
I do not know how this handwritten codes。Who can help me Well
goyalruchi90
@goyalruchi90
Jul 11 2016 03:01
help Wherefore art thou
CamperBot
@camperbot
Jul 11 2016 03:01

:point_right: algorithm wherefore art thou [wiki]

Algorithm Wherefore Art Thou

: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:

Write an algorithm that will take an array for the first argument and return an array with all the objects that matches all the properties and values in the Object passed as second parameter.

Relevant Links

:pencil: read more about algorithm wherefore art thou on the FCC Wiki

Charles Sexton
@Grimlek
Jul 11 2016 03:06
I was able to get it
Zina Astafyeva
@tragetraje
Jul 11 2016 03:06
help Factorialize a Number
CamperBot
@camperbot
Jul 11 2016 03:06

:point_right: algorithm factorialize a number [wiki]

Algorithm Factorialize A Number

Recursion

: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:

:pencil: read more about algorithm factorialize a number on the FCC Wiki

Charles Sexton
@Grimlek
Jul 11 2016 03:06
thank you anyways....
Florencia
@flopywood
Jul 11 2016 03:06
Hello, everyone! I need some help with a challenge. Can anyone help me? I'm doing the Record Collection challenge and I think something is missing from my code to complete it but I don't know exactly what. Here is my code"
function updateRecords(id, prop, value) {

    if (prop != "tracks" && value !== "") {
      value = collection[id][prop];  
    }

    else if (prop == "tracks" && value !== "") {
      collection[id][prop].push(value);
    }

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

  return collection;
}
Zina Astafyeva
@tragetraje
Jul 11 2016 03:07
Hi @flopywood you're doing fine just take a look at the directions and the order of your statements
Florencia
@flopywood
Jul 11 2016 03:07
@tragetraje ok thanks!
CamperBot
@camperbot
Jul 11 2016 03:07
flopywood sends brownie points to @tragetraje :sparkles: :thumbsup: :sparkles:
:cookie: 268 | @tragetraje |http://www.freecodecamp.com/tragetraje
Zina Astafyeva
@tragetraje
Jul 11 2016 03:07
@flopywood you should first create an array and then push the value to it
Florencia
@flopywood
Jul 11 2016 03:08
@tragetraje you mean I have to add another else if statement?
Zina Astafyeva
@tragetraje
Jul 11 2016 03:08
no, refactor your code
Florencia
@flopywood
Jul 11 2016 03:08
@tragetraje ok, let me thing
think
如风
@rufeng2015
Jul 11 2016 03:08
@goyalruchi90 I was thinking how to write this stuff, no idea.
Diego Mayer
@Chrono79
Jul 11 2016 03:09
@flopywood this isn't right: value = collection[id][prop]; it should be the other way around
Florencia
@flopywood
Jul 11 2016 03:10
oh yes? why??? I always thought that was fine. Could you explain it to me?
@Chrono79
OMG YOU GUYS I'M ONLY ONE CROSS AWAY FROM COMPLETING IT!!!
Diego Mayer
@Chrono79
Jul 11 2016 03:11
@flopywood assignation goes from right to left, that way you're storing collection[id][prop] in value
Florencia
@flopywood
Jul 11 2016 03:11
@Chrono79 ahhh that makes sense. yeah, I got it
silver537
@silver537
Jul 11 2016 03:11
@flopywood also check if your objects has the property. If not, add one.
Brian
@BrianCodes33
Jul 11 2016 03:11
@Chrono79 so < 0 is falsy for checking strings
Diego Mayer
@Chrono79
Jul 11 2016 03:13
@BrianCodes33
function mutation(arr) {
  var test = arr[0].toLowerCase(); //change here arr[0] and arr[1] or below test for target, your choice
  var target = arr[1].toLowerCase();
  for (var i=0; i<test.length; i++) {
   if (target.indexOf(test[i]) < 0) //here you're checking if all the letters of hello are in hey and the challenge ask you to do it the other way around
     return false;
   } 
     return true;
}


mutation(["hello", "hey"]);
Florencia
@flopywood
Jul 11 2016 03:14
@silver537 thanks
CamperBot
@camperbot
Jul 11 2016 03:14
flopywood sends brownie points to @silver537 :sparkles: :thumbsup: :sparkles:
:cookie: 389 | @silver537 |http://www.freecodecamp.com/silver537
Diego Mayer
@Chrono79
Jul 11 2016 03:15
@BrianCodes33 testing indexOf against <0 or === -1 is the same (<0 is shorter)
Zina Astafyeva
@tragetraje
Jul 11 2016 03:17
does anybody know a good resource to read about recursion and recursive functions?
Florencia
@flopywood
Jul 11 2016 03:18
@tragetraje yes, go to mozilla, or go to sitepoint and sign up. they have a library of free eboks about different topics including javascript
Zina Astafyeva
@tragetraje
Jul 11 2016 03:19
@flopywood tons of resources, just some of them are clear and anothers are not so friendly for the beginners
Florencia
@flopywood
Jul 11 2016 03:20
I like the book I got from sitepoint because it's called javacript from beginner to ninja
Zina Astafyeva
@tragetraje
Jul 11 2016 03:20
ok, thanks @flopywood, will have a look at this one, I've heard about this one I guess, is it free?
CamperBot
@camperbot
Jul 11 2016 03:20
tragetraje sends brownie points to @flopywood :sparkles: :thumbsup: :sparkles:
:cookie: 214 | @flopywood |http://www.freecodecamp.com/flopywood
Florencia
@flopywood
Jul 11 2016 03:21
@tragetraje yes, I signed up and was directed to a library with free books
ok, guys, I need help
Zina Astafyeva
@tragetraje
Jul 11 2016 03:22
how are you going? have u done what they've told you?
Florencia
@flopywood
Jul 11 2016 03:22
@tragetraje yes but I don't know what else to do
function updateRecords(id, prop, value) {

    if (prop != "tracks" && value !== "" ) {
      collection[id][prop] = value;  
    }

    else if (prop == "tracks" && value !== "") {
      collection[id][prop].push(value);
    }

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

    else {
      collection[id][prop].add(value);
    }

  return collection;
}
Zina Astafyeva
@tragetraje
Jul 11 2016 03:25
Ok, essentially, what values can any prop take..? it can be blank and not blank...
silver537
@silver537
Jul 11 2016 03:25
@flopywood on your else if youre pushing into a nonexistent property. I believe its tracks? Look at your last object. It doesnt have tracks. Play with your code focusing only on that object.
Diego Mayer
@Chrono79
Jul 11 2016 03:26

@flopywood
delete this:

    else {
      collection[id][prop].add(value);
    }

you don't need it

Zina Astafyeva
@tragetraje
Jul 11 2016 03:26
I'd start thinking this way, describe the steps with if else for both cases..
if blank ==> delete, else ==> describe the rest of the stepse..
Florencia
@flopywood
Jul 11 2016 03:27
ok
dine
done
Zina Astafyeva
@tragetraje
Jul 11 2016 03:28
This message was deleted
and if it isn't
This message was deleted
and think about options for
prop !== "tracks"
I'd suggest start with reordering your code first reading the exercise's directions..
silver537
@silver537
Jul 11 2016 03:33
Zina.... what are you talking about? 0.o
Florencia
@flopywood
Jul 11 2016 03:33
ok
but it works
i'm only one cross away
silver537
@silver537
Jul 11 2016 03:33
@flopywood post your update.
Florencia
@flopywood
Jul 11 2016 03:34
function updateRecords(id, prop, value) {

    if (prop !== "tracks" && value !== "" ) {
      collection[id][prop] = value;  
    }

    else if (prop == "tracks" && value !== "") {
      collection[id][prop].push(value);
    }

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

    else {
      collection[id][prop].add(value);
    }

  return collection;
}
silver537
@silver537
Jul 11 2016 03:35
Didn't change anything. What part do you not understand?
Florencia
@flopywood
Jul 11 2016 03:35
@silver537 After updateRecords(5439, "tracks", "Take a Chance on Me"), tracks should have "Take a Chance on Me" as the last element.
that's the one the system says is wrong
silver537
@silver537
Jul 11 2016 03:36
Did you kook at the object? Notice tracks is not a property there. How do you create an array in an object?
Florencia
@flopywood
Jul 11 2016 03:38
pushing it
Diego Mayer
@Chrono79
Jul 11 2016 03:38
@flopywood you can only use push with an array, push is an array method
Florencia
@flopywood
Jul 11 2016 03:39
then do or bracket notation
oh wait
it doesn't exist
so i have to use
hasOwnProperty ?
silver537
@silver537
Jul 11 2016 03:42
Yup
Florencia
@flopywood
Jul 11 2016 03:42
ok
now let me think
silver537
@silver537
Jul 11 2016 03:43
That returns a boolean value true is it has the property, false if it doesnt. Check ifit does NOT (!) have the property. If not, create an array onside your object.
If it does, your code will run with no problem. Thats if you have the rest of the code correct.
Florencia
@flopywood
Jul 11 2016 03:45
ok so if it doesn;t have the property, is false and I create it adding it
Robert
@Brayn7
Jul 11 2016 03:45
can anyone give me some tips to improve this code? warning... it is a successful answer to a challenge. so dont look if you dont want it ruined http://codepen.io/Brayn/pen/jAGzQB?editors=0001
silver537
@silver537
Jul 11 2016 03:45
Yes
Florencia
@flopywood
Jul 11 2016 03:46
@silver537 I did this:
else if (collection[id].hasOwnProperty("tracks")) {
      collection[id][prop].push(value);
    }
silver537
@silver537
Jul 11 2016 03:48
No that part was fine before the changes. You would have to add a new if statement to check for the property.
Brian
@BrianCodes33
Jul 11 2016 03:48
someone mind helping me with the Seek and Destroy algorithm
silver537
@silver537
Jul 11 2016 03:49
Post code sir
Florencia
@flopywood
Jul 11 2016 03:52
@silver537 is not working
i will have to chekc my code
crying
christianws
@christianws
Jul 11 2016 03:53
Florencia
@flopywood
Jul 11 2016 03:53
but i thought it was fine :(
christianws
@christianws
Jul 11 2016 03:53
25 second pomodoro timer :)
silver537
@silver537
Jul 11 2016 03:56
Ill help you in a bit. Let me finish showering lol. I had troouble with that one too.
Florencia
@flopywood
Jul 11 2016 03:58
like, I understand what's wrong but I feel so stuck because I look at my code and I think it's ok but it clearly isn't
John Timoteo
@Tesla93
Jul 11 2016 04:05
hey everyone can someone help me, I keep failing to get escape sequences in strings right, it keeps coming back as one line var myStr= "FirstLine\n\SecondLine\\rThridLine";
bradulz
@bradulz
Jul 11 2016 04:09
@BrianCodes33 post code sir
dhuddleston
@dhuddleston
Jul 11 2016 04:09
@Brayn7 Quick tip: If you change the last line to console.log(sumPrimes(10));you can see the output in the console window. :)
silver537
@silver537
Jul 11 2016 04:09
\n
Robert
@Brayn7
Jul 11 2016 04:11
@dhuddleston :smile: nice!
edison sim
@Edisonsim
Jul 11 2016 04:20
how do i add question to my quiz box if i using javascript to set my question in it?
silver537
@silver537
Jul 11 2016 04:21
What?
edison sim
@Edisonsim
Jul 11 2016 04:21
document.getElementById?
silver537
@silver537
Jul 11 2016 04:21
.textcontent = .....
edison sim
@Edisonsim
Jul 11 2016 04:23
Coz it say i need to use function and those getElementById/classname and tagname to do the project -.- but idk how to start lol
Olly Sholotan
@Ollysho
Jul 11 2016 04:23
Hey! For some reason my code is ignoring my global identifier could anyone tell me if something is wrong?
.replace(/^\w/g, '')
It only removes one instance of an underscore instead of all of them
Like my goal is that anything that isn't good old fashion text should be replaced with a blank
Will
@Will-is-Coding
Jul 11 2016 04:27
@Ollysho I'm fairly sure \wallows alpha numeric and underscores
Try using one allowing only alphabet and numbers, instead of the \W specifier.
Christian Johanson
@cjamesjoh
Jul 11 2016 04:28
This message was deleted
Olly Sholotan
@Ollysho
Jul 11 2016 04:29
Ahh okay.... @Will-is-Coding thanks!
CamperBot
@camperbot
Jul 11 2016 04:29
ollysho sends brownie points to @will-is-coding :sparkles: :thumbsup: :sparkles:
:cookie: 471 | @will-is-coding |http://www.freecodecamp.com/will-is-coding
Will
@Will-is-Coding
Jul 11 2016 04:30
Play around in www.regexr.com
@Ollysho
Christian Johanson
@cjamesjoh
Jul 11 2016 04:31
This message was deleted
Olly Sholotan
@Ollysho
Jul 11 2016 04:33
Oh wow this is such a great took thanks man
Christian Johanson
@cjamesjoh
Jul 11 2016 04:33

I am working on the Record Collection challenge. I am able to get some of the requirements done but the others seem to not work. I have no idea what is wrong with my code. The parts i am struggling with is when value === " " and it is supposed to delete the corresponding property and when i am supposed to add a value to an existing property.// 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 (value === " ") {
delete collection[id][prop];
}

else if (prop !=="tracks" && value !== " ") {
collection[id][prop] = value;
}
else if (prop === "tracks" && collection[id].hasOwnProperty("tracks") === false && value !== " ") {
collection[id].tracks = [] ;
collection[id].tracks.push(value);
}
else if (prop === "tracks" && value !== " " && collection.id.hasOwnProperty(prop) === true) {
collection[id].tracks.push(value);
}

return collection;
}

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

Indhu
@Indhusethu
Jul 11 2016 04:42
help me with this code
CamperBot
@camperbot
Jul 11 2016 04:42
no wiki entry for: me with this code
Indhu
@Indhusethu
Jul 11 2016 04:42

var Car = function() {
// this is a private variable
var speed = 10;

// these are public methods
this.accelerate = function(change) {
speed += change;
};

this.decelerate = function() {
speed -= 5;
};

this.getSpeed = function() {
return speed;
};
};

var Bike = function() {

var gear;
};
this.getGear=function(){
return gear;

};
this.setGear=function(){
return gear;
};
var myCar = new Car();

var myBike = new Bike();

Will
@Will-is-Coding
Jul 11 2016 04:43
@cjamesjoh You want value === "" not value === " " for all the times you check it. You seem to check it at all the right places.
Mustafijur rahman
@Dinar717
Jul 11 2016 04:44
@Indhusethu what do u want to do?
Indhu
@Indhusethu
Jul 11 2016 04:44
what is my mistake ??
silver537
@silver537
Jul 11 2016 04:44
@cjamesjoh on your last else if, youre using donotation.
Will
@Will-is-Coding
Jul 11 2016 04:44
@cjamesjoh collection.id.hasOwnProperty(prop) you also have a typo here, as you have it right everywhere else that you refer to the collection
Subramanya Chakravarthy
@chakrihacker
Jul 11 2016 04:47
@Indhusethu you closed bike function early take a look @ car function and try again it will work
supertrek
@supertrek
Jul 11 2016 04:47

Hello World

Tried to google and still with

Error Msg:
myStr should have encoded text with the proper escape sequences and no spacing.

MyCode:
var myStr = "\ \n \r \";

CamperBot
@camperbot
Jul 11 2016 04:47

welcome to FreeCodeCamp @supertrek!

Indhu
@Indhusethu
Jul 11 2016 04:48
but for public methods i should close the bracket ?? isn't it? @chakrihacker
Subramanya Chakravarthy
@chakrihacker
Jul 11 2016 04:48
@Indhusethu Take a closer look at paranthesis and initialize gear tosome number 1
Indhu
@Indhusethu
Jul 11 2016 04:48
ok @chakrihacker
Subramanya Chakravarthy
@chakrihacker
Jul 11 2016 04:49
@Indhusethu in setgear function you need to change gear value same as car accelerate function
Indhu
@Indhusethu
Jul 11 2016 04:49
ok:) @chakrihacker
silver537
@silver537
Jul 11 2016 04:50
@d-suarez youre not type the sentence they want you to use.
Indhu
@Indhusethu
Jul 11 2016 04:51

var Bike = function(){
var gear=1;
this.setGear=function(change){
gear+=change;
};
this.getGear=function(){
gear-=0;
};
var myCar = new Car();

var myBike = new Bike();
};

am i right now??
Subramanya Chakravarthy
@chakrihacker
Jul 11 2016 04:52
yes and you can change gear-=0 to gear
Indhu
@Indhusethu
Jul 11 2016 04:52
ok
Subramanya Chakravarthy
@chakrihacker
Jul 11 2016 04:53
and return it like return gear
Indhu
@Indhusethu
Jul 11 2016 04:53
i'm not getting correct,getting lots of errors
Asfan Ayaz
@AsfanAyaz1
Jul 11 2016 04:54

To test your learning, you will create a solution "from scratch". Place your code between the indicated lines and it will be tested against multiple test cases.

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.

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

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

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

Subramanya Chakravarthy
@chakrihacker
Jul 11 2016 04:54
in getgear use return gear;
Indhu
@Indhusethu
Jul 11 2016 04:54
yeah i used tat only

var Bike = function(){
var gear=1;
this.setGear=function(change){
gear+=change;
};
this.getGear=function(){
return gear;
};
var myCar = new Car();

var myBike = new Bike();
};

Subramanya Chakravarthy
@chakrihacker
Jul 11 2016 04:55
put these two lines at the end
var myCar = new Car();
var myBike = new Bike();
they must be outside of the function
if they are inside you can't call them
Christian Johanson
@cjamesjoh
Jul 11 2016 04:55
@Will-is-Coding Thanks. The changes you suggested helped.
CamperBot
@camperbot
Jul 11 2016 04:55
cjamesjoh sends brownie points to @will-is-coding :sparkles: :thumbsup: :sparkles:
:cookie: 473 | @will-is-coding |http://www.freecodecamp.com/will-is-coding
Asfan Ayaz
@AsfanAyaz1
Jul 11 2016 04:56
kindly hel me
help
CamperBot
@camperbot
Jul 11 2016 04:56

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

Will
@Will-is-Coding
Jul 11 2016 04:56
@cjamesjoh No problem, so it passed?
Indhu
@Indhusethu
Jul 11 2016 04:56
ok,i got half correct @chakrihacker
Subramanya Chakravarthy
@chakrihacker
Jul 11 2016 04:56
@Indhusethu what do you mean by half correct?
send the url
Indhu
@Indhusethu
Jul 11 2016 04:57
i'm getting an output partially
wait
@chakrihacker
Christian Johanson
@cjamesjoh
Jul 11 2016 04:58
@Will-is-Coding Yes. I fixed the " " to "" and fixed the typo and switched a few parts to bracket notation.
Will
@Will-is-Coding
Jul 11 2016 04:58
Good good
Subramanya Chakravarthy
@chakrihacker
Jul 11 2016 04:59

var Bike = function() {

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

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

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

};

@Indhusethu
Indhu
@Indhusethu
Jul 11 2016 05:00
ok @chakrihacker
Robert Richey
@0x0936
Jul 11 2016 05:00

@AsfanAyaz1 click the reset button, then pay close attention to this part of the challenge description:

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

assign to fahrenheit the value from the expression celsius times 9/5 plus 32

Indhu
@Indhusethu
Jul 11 2016 05:02
thank you @chakrihacker
CamperBot
@camperbot
Jul 11 2016 05:02
indhusethu sends brownie points to @chakrihacker :sparkles: :thumbsup: :sparkles:
:cookie: 252 | @chakrihacker |http://www.freecodecamp.com/chakrihacker
Subramanya Chakravarthy
@chakrihacker
Jul 11 2016 05:03
@Indhusethu try to understand the problem
bradulz
@bradulz
Jul 11 2016 05:04
for(var i = 0;i<word.length;i++)
  {
    var letter= word.charAt(i);
    if(String(letter) === String(letter).toUpperCase)
    arr.push(i);

  }
Why won't this return an arr of all capital letters in a string?
Robert Richey
@0x0936
Jul 11 2016 05:06
@bradulz the touppercase method needs parens () to be called
bradulz
@bradulz
Jul 11 2016 05:07
@oxide94Git oh thanks Im dumb
CamperBot
@camperbot
Jul 11 2016 05:07
bradulz sends brownie points to @oxide94git :sparkles: :thumbsup: :sparkles:
:cookie: 284 | @oxide94git |http://www.freecodecamp.com/oxide94git
brandon1496
@brandon1496
Jul 11 2016 05:07
hiiiiiiii can someone help me with the "Comparisons with the Logical Or Operator"? in the javascript section?
supertrek
@supertrek
Jul 11 2016 05:08
Hello World
Tried to google and still with
Error Msg:
myStr should have encoded text with the proper escape sequences and no spacing.
MyCode:
var myStr = "\ \n \r \";
CamperBot
@camperbot
Jul 11 2016 05:08

welcome to FreeCodeCamp @supertrek!

Mustafijur rahman
@Dinar717
Jul 11 2016 05:08
@brandon1496 yes, whats your problem?
Robert Richey
@0x0936
Jul 11 2016 05:08
@bradulz and arr.push(i) is always just pushing a number
Mustafijur rahman
@Dinar717
Jul 11 2016 05:08
@supertrek give the url of your page
Robert Richey
@0x0936
Jul 11 2016 05:09
@bradulz perhaps you intended to push letter
bradulz
@bradulz
Jul 11 2016 05:09
@oxide94Git oh yeah I meant to say it was the index not the letter. Sorry about that
Mustafijur rahman
@Dinar717
Jul 11 2016 05:09
@supertrek you need to use the words too
supertrek
@supertrek
Jul 11 2016 05:10
sorry m8 please can you rephrase
Mustafijur rahman
@Dinar717
Jul 11 2016 05:10
FirstLine\n\\SecondLine\\\rThirdLine
Subramanya Chakravarthy
@chakrihacker
Jul 11 2016 05:10
@supertrek combine two ifs into one
can someone please help?
Subramanya Chakravarthy
@chakrihacker
Jul 11 2016 05:11
@brandon1496 combine 2 ifs into one
supertrek
@supertrek
Jul 11 2016 05:11
this is my code
var myStr = "\ \n \r \";
brandon1496
@brandon1496
Jul 11 2016 05:11
i know that lol but i cant seem to get it
Subramanya Chakravarthy
@chakrihacker
Jul 11 2016 05:11
try this
if (val<10 || val > 20) {
return "Outside";
}
and remove other if
brandon1496
@brandon1496
Jul 11 2016 05:12
doesnt work

function testLogicalOr(val) {
// Only change code below this line

if (val < 10 || val > 20) {
return "Inside";
}
// Only change code above this line
return "Outside";
}

// Change this value to test
testLogicalOr(15);

supertrek
@supertrek
Jul 11 2016 05:13
Mustafijur pls can you write the line
Robert Richey
@0x0936
Jul 11 2016 05:13

@supertrek

Assign the following three lines of text into the single variable myStr using escape sequences.

FirstLine
\SecondLine\
ThirdLine

DJ
@qualitymanifest
Jul 11 2016 05:13
@brandon1496 i think you need to use && not ||
supertrek
@supertrek
Jul 11 2016 05:13
sorry don;t understand
bradulz
@bradulz
Jul 11 2016 05:13
oh so apparently you can target a strings character by using stringname[index] instead of stringname.CharAt? Is that a thing?
DJ
@qualitymanifest
Jul 11 2016 05:14
@brandon1496 if val is greater than 10 AND less than 20, as opposed to if val is greater than 10 OR less than 20
supertrek
@supertrek
Jul 11 2016 05:14
var myStr = "\ \n \r \";
Robert Richey
@0x0936
Jul 11 2016 05:14
@supertrek lets do this in small steps
supertrek
@supertrek
Jul 11 2016 05:14
ok
John Timoteo
@Tesla93
Jul 11 2016 05:14
would someone mind helping me figure this out? whenever I write a string with an escape sequence \n or \r it still gets printed on the same line regardless if I use codepen or sublime text editor this is my code var myStr= "FirstLine\n\SecondLine\\rThirdLine" but what comes out is FirstLine \SecondLine\ ThirdLine
Robert Richey
@0x0936
Jul 11 2016 05:14
@supertrek assign 'FirstLine' to myStr
Indhu
@Indhusethu
Jul 11 2016 05:15
how to add a number to an array??
Mustafijur rahman
@Dinar717
Jul 11 2016 05:15
@supertrek var myStr="FirstLine\n\\SecondLine\\\rThirdLine"
Subramanya Chakravarthy
@chakrihacker
Jul 11 2016 05:15
@supertrek change to outside for if
Indhu
@Indhusethu
Jul 11 2016 05:15
using map function
supertrek
@supertrek
Jul 11 2016 05:15
var myStr = "Firstline";
Subramanya Chakravarthy
@chakrihacker
Jul 11 2016 05:15
and insde for end
brandon1496
@brandon1496
Jul 11 2016 05:15
the challenge says i have to use || once
Abhishek Baliyan
@abhishekdevinfo
Jul 11 2016 05:15
@Indhusethu arr.push()
Indhu
@Indhusethu
Jul 11 2016 05:16
using map function @abhishekdevinfo
Subramanya Chakravarthy
@chakrihacker
Jul 11 2016 05:16
@supertrek

function testLogicalOr(val) {
// Only change code below this line

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

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

// Change this value to test
testLogicalOr(15);

Robert Richey
@0x0936
Jul 11 2016 05:16
@supertrek 'FirstLine' capitalization matters
brandon1496
@brandon1496
Jul 11 2016 05:17
@chakrihacker thank u
CamperBot
@camperbot
Jul 11 2016 05:17
brandon1496 sends brownie points to @chakrihacker :sparkles: :thumbsup: :sparkles:
:cookie: 253 | @chakrihacker |http://www.freecodecamp.com/chakrihacker
supertrek
@supertrek
Jul 11 2016 05:17
sorry don't understand
Subramanya Chakravarthy
@chakrihacker
Jul 11 2016 05:17
@supertrek try to read problem multiple times
Abhishek Baliyan
@abhishekdevinfo
Jul 11 2016 05:17
i just completed the Basic algorithm Scripting in java script if any one want help than ask me
Robert Richey
@0x0936
Jul 11 2016 05:17
@supertrek I'm trying to get you to write myStr = "FirstLine" the 'L' is capitalized. You wrote a lowercase 'l'
supertrek
@supertrek
Jul 11 2016 05:18
ok
Indhu
@Indhusethu
Jul 11 2016 05:18
is there anyone ?? who know this answer??
Subramanya Chakravarthy
@chakrihacker
Jul 11 2016 05:18
@indhu read map function in w3schools.com
Robert Richey
@0x0936
Jul 11 2016 05:18
@supertrek now add to that string a newline escape sequence
Mustafijur rahman
@Dinar717
Jul 11 2016 05:18
@Indhusethu of what?
Subramanya Chakravarthy
@chakrihacker
Jul 11 2016 05:19
you will understand
supertrek
@supertrek
Jul 11 2016 05:19
var myStr = "FirstLine";
Indhu
@Indhusethu
Jul 11 2016 05:19
how to add a number to each value in a variable
@Dinar717
ok @chakrihacker
Mustafijur rahman
@Dinar717
Jul 11 2016 05:19
@Indhusethu use for loop
Robert Richey
@0x0936
Jul 11 2016 05:20
@supertrek you may need to put your code inside backticks `your code here `
Indhu
@Indhusethu
Jul 11 2016 05:20
ok @Dinar717
Subramanya Chakravarthy
@chakrihacker
Jul 11 2016 05:20
prob link @Indhusethu
Mustafijur rahman
@Dinar717
Jul 11 2016 05:20
or map function @Indhusethu
Robert Richey
@0x0936
Jul 11 2016 05:20
@supertrek it should look like this myStr = "FirstLine\n"
silver537
@silver537
Jul 11 2016 05:21
Why help anymore? Just give them the code to copy and paste.
Mustafijur rahman
@Dinar717
Jul 11 2016 05:21
@supertrek
solution:
var myStr="FirstLine\n\\SecondLine\\\rThirdLine"
Robert Richey
@0x0936
Jul 11 2016 05:21
@Dinar717 really? I'm patiently trying to help supertek and you post the answer a second time?
silver537
@silver537
Jul 11 2016 05:21
My point exactly
This guy should be banned.
supertrek
@supertrek
Jul 11 2016 05:22
Thanks robert and mustafijur
Abhishek Baliyan
@abhishekdevinfo
Jul 11 2016 05:23
@Indhusethu did u fully understand the map
Indhu
@Indhusethu
Jul 11 2016 05:23
@chakrihacker where it is in w3schools??
Subramanya Chakravarthy
@chakrihacker
Jul 11 2016 05:23
@Indhusethu why did you add push again
supertrek
@supertrek
Jul 11 2016 05:23
Robert appreciate everyone is trying to help and point us newbies in the right direction
Subramanya Chakravarthy
@chakrihacker
Jul 11 2016 05:24
Mustafijur rahman
@Dinar717
Jul 11 2016 05:24
@Indhusethu just return val+3;
Indhu
@Indhusethu
Jul 11 2016 05:24
yes @abhishekdevinfo
Mustafijur rahman
@Dinar717
Jul 11 2016 05:24
and assign timesThree to new value.
Indhu
@Indhusethu
Jul 11 2016 05:24
ok @Dinar717
Nelius Knight
@NeliusKnight
Jul 11 2016 05:25
Can i get some input onto whats going on with my golf game code?
```

function golfScore(par, strokes) {
  // Only change code below this line
    if (strokes == par - 3) {
    return "Hole-In-One";
  } else if (strokes <= par - 2) {
    return "Eagle";
  } else if (strokes == par - 1) {
    return "Birdie";
  } else if (strokes == par) {
    return "Par"; 
  } else if (strokes == par + 1) {
    return "Bogey"; 
  } else if (strokes == par + 2) {
    return "Double Bogey";
  } else if (strokes >= par + 3) {
    return "Go Home!"; 
  } else {
}  
  return "NaN";




  // Only change code above this line
}

// Change these values to test
golfScore(4, 9);
Indhu
@Indhusethu
Jul 11 2016 05:26
ok @chakrihacker
Rohan Mohammad
@reolander
Jul 11 2016 05:26
function lookUpProfile(firstName, prop){
// Only change code below this line

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

  if(contacts[i]["firstName"] === firstName && contacts[i].hasOwnProperty(prop))
    return contacts[i][prop];

  else if(! contacts[i].hasOwnProperty(prop))
    return "No such property";

  else if (contacts[i]["firstName"] !== firstName)
    return "No such contact";

 } 


// Only change code above this line
}
^what is wrong with this code
silver537
@silver537
Jul 11 2016 05:27
@NeliusKnight the last return is out side the else sratement
Abhishek Baliyan
@abhishekdevinfo
Jul 11 2016 05:28
@Indhusethu but in your map challenge u use push and assign the value in wrong variable
Joseph
@revisualize
Jul 11 2016 05:28
@rohan222 How many times is your loop looping?
Mustafijur rahman
@Dinar717
Jul 11 2016 05:29
@Indhusethu yes @abhishekdevinfo is right!
Indhu
@Indhusethu
Jul 11 2016 05:30
ok i will see to it
@abhishekdevinfo @Dinar717
unknowntheory
@unknowntheory
Jul 11 2016 05:30
hi guys I'm currently on Return Largest Numbers in a string and wanted feedback if i'm going about it the right way.
so my thought process so far is to 1) make the array into a string and combining it back by using .join().split(' ') 2) sum the array parts by using arr.reduce. any thoughts on this would be appreciated.
Joseph
@revisualize
Jul 11 2016 05:30
@unknowntheory I used a map.
silver537
@silver537
Jul 11 2016 05:31
@unknowntheory or you can use the sort ().pop ()
Joseph
@revisualize
Jul 11 2016 05:31
It is best to use Math.max()
silver537
@silver537
Jul 11 2016 05:32
Sort your areay smallest to bigfest. Then pop the last element out.
Mustafijur rahman
@Dinar717
Jul 11 2016 05:32
@unknowntheory yes Math.max() is best
Indhu
@Indhusethu
Jul 11 2016 05:32
can you send me the map challenge link please?? @abhishekdevinfo
Rohan Mohammad
@reolander
Jul 11 2016 05:32
@revisualize I still have no idea about the no. of loops
unknowntheory
@unknowntheory
Jul 11 2016 05:32
@revisualize , @silver537 and @Dinar717 thanks guys ill look into it
CamperBot
@camperbot
Jul 11 2016 05:32
:cookie: 404 | @dinar717 |http://www.freecodecamp.com/dinar717
unknowntheory sends brownie points to @revisualize and @silver537 and @dinar717 :sparkles: :thumbsup: :sparkles:
:cookie: 390 | @silver537 |http://www.freecodecamp.com/silver537
:star2: 1411 | @revisualize |http://www.freecodecamp.com/revisualize
Rohan Mohammad
@reolander
Jul 11 2016 05:32

//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(contacts[i]["firstName"] === firstName && contacts[i].hasOwnProperty(prop))
    return contacts[i][prop];

  else if(! contacts[i].hasOwnProperty(prop))
    return "No such property";

  else if (contacts[i]["firstName"] !== firstName)
    return "No such contact";

 } 


// Only change code above this line
}

// Change these values to test your function
lookUpProfile("Harry", "likes");
unknowntheory
@unknowntheory
Jul 11 2016 05:33
thank you guys ill look into using map
Rohan Mohammad
@reolander
Jul 11 2016 05:33
^Here is the complete code
silver537
@silver537
Jul 11 2016 05:33
Dont use math.max. its too simple.
Markus Kiili
@Masd925
Jul 11 2016 05:33
@rohan222 Your code can return no such contact after checking just one contact.
Indhu
@Indhusethu
Jul 11 2016 05:33
ok :+1: @abhishekdevinfo
Joseph
@revisualize
Jul 11 2016 05:33
@rohan222 You did NOT answer any of my questions.
Indhu
@Indhusethu
Jul 11 2016 05:33
i do not understand this one
Joseph
@revisualize
Jul 11 2016 05:33
@rohan222 How many times is your loop looping?
Indhu
@Indhusethu
Jul 11 2016 05:34
array using map
@Indhusethu var newArray = oldArray.map(x => x + 3);
Indhu
@Indhusethu
Jul 11 2016 05:36
oh,it will be better if the instructions are accurate
thankyou @revisualize
CamperBot
@camperbot
Jul 11 2016 05:36
indhusethu sends brownie points to @revisualize :sparkles: :thumbsup: :sparkles:
:star2: 1412 | @revisualize |http://www.freecodecamp.com/revisualize
Rohan Mohammad
@reolander
Jul 11 2016 05:36
@revisualize Just once. it returns no such contact for Harry, Likes.
@Masd925 exactly! How do I rectify the error?
Indhu
@Indhusethu
Jul 11 2016 05:38

var timesThree=newArray.map(function(val){
var newArray=oldArray.map(x=x+3);
return val * 3;
});

var newArray = oldArray;

Dolan
@dguh
Jul 11 2016 05:38
hey guys! im working on my twitch api right now but i am having some trouble with getting the ajax to iterate through my array. if any one has some suggestions that would be extremely helpful! http://codepen.io/dguh/pen/kXGLwY?editors=1011
Indhu
@Indhusethu
Jul 11 2016 05:38
am i right with this code
silver537
@silver537
Jul 11 2016 05:38
@revisualize dont do that. No matter how long it takes, they have to figure it out. Never give the answer in code.
Markus Kiili
@Masd925
Jul 11 2016 05:38
@rohan222 When your loop runs out, you know there was no such contact.
Abhishek Baliyan
@abhishekdevinfo
Jul 11 2016 05:38
@Indhusethu
Indhu
@Indhusethu
Jul 11 2016 05:39
yes @abhishekdevinfo
Abhishek Baliyan
@abhishekdevinfo
Jul 11 2016 05:39

var oldArray = [1,2,3,4,5];

// Only change code below this line.

var newArray = oldArray.map(function(val){
  return val + 3;
});
this is simplest
Indhu
@Indhusethu
Jul 11 2016 05:39
oh ok @abhishekdevinfo
Abhishek Baliyan
@abhishekdevinfo
Jul 11 2016 05:39
ok
Indhu
@Indhusethu
Jul 11 2016 05:40
but still i'm not getting it
unknowntheory
@unknowntheory
Jul 11 2016 05:40
ok I just re-read the problem and I realized I was misinterpreting the problem all along. I was thinking it wanted the sum of each multi-dimensional array and wanted to see what was the largest.
Indhu
@Indhusethu
Jul 11 2016 05:40
@abhishekdevinfo
Joseph
@revisualize
Jul 11 2016 05:40
@silver537 Don't do what.. I wasn't talking to you. I didn't even know you were having issues.
unknowntheory
@unknowntheory
Jul 11 2016 05:40
what was the largest multi dimensional array.
Abhishek Baliyan
@abhishekdevinfo
Jul 11 2016 05:40
@Indhusethu which portion
Indhu
@Indhusethu
Jul 11 2016 05:41
You should add three to each value in the array. this is my error
Abhishek Baliyan
@abhishekdevinfo
Jul 11 2016 05:41
@Indhusethu in this line var newArray = oldArray.map(function(val){ the val is now each element of an array
Indhu
@Indhusethu
Jul 11 2016 05:42
yeah
Rohan Mohammad
@reolander
Jul 11 2016 05:42
@Masd925 but even for Kristian, lastName it shows no contact. Shouldn't the the first if statement get executed and return Vos i.e. kristian's last name?
Abhishek Baliyan
@abhishekdevinfo
Jul 11 2016 05:42
@Indhusethu and then for each value u return return val + 3;
by adding 3
Indhu
@Indhusethu
Jul 11 2016 05:42
why is tat i'm not getting ??
@abhishekdevinfo
Abhishek Baliyan
@abhishekdevinfo
Jul 11 2016 05:43
when the map function run it will start with 1 then 2 then then 4 abd soo on according to array elements
Indhu
@Indhusethu
Jul 11 2016 05:44

var newArray=oldArray.map(function(val){
return val + 3;
});

var newArray = oldArray;
Is my code correct?

@abhishekdevinfo
Abhishek Baliyan
@abhishekdevinfo
Jul 11 2016 05:44
then in function when u return val + 3 its means
first the val value is 1 so
return 1 + 3
why u add this line var newArray = oldArray;
Indhu
@Indhusethu
Jul 11 2016 05:45
i think tat will not work out
return 1+3
Abhishek Baliyan
@abhishekdevinfo
Jul 11 2016 05:46
why u add this line var newArray = oldArray; in your code
Indhu
@Indhusethu
Jul 11 2016 05:47
i should add timesThree right?
Markus Kiili
@Masd925
Jul 11 2016 05:47
@rohan222 Yes, it should return "Vos".
Abhishek Baliyan
@abhishekdevinfo
Jul 11 2016 05:48
u already done this line var newArray = oldArray; work in this line var newArray=oldArray.map(function(val){
@Indhusethu
Indhu
@Indhusethu
Jul 11 2016 05:50
hmmm @abhishekdevinfo
can you understand what i'm asking?? @abhishekdevinfo
Abhishek Baliyan
@abhishekdevinfo
Jul 11 2016 05:50
@Indhusethu when u add the 3 to val and then return to map then the return value will assign in newArray by newArray=oldArray.map(function(val){
Indhu
@Indhusethu
Jul 11 2016 05:50
how to add a number using map?
Abhishek Baliyan
@abhishekdevinfo
Jul 11 2016 05:51
ok
Subramanya Chakravarthy
@chakrihacker
Jul 11 2016 05:52
@Indhusethu try to execute the example code
of map function
understand it
Indhu
@Indhusethu
Jul 11 2016 05:53
yes,i'm still seeing tat example which you gave
Subramanya Chakravarthy
@chakrihacker
Jul 11 2016 05:53
nope in fcc when you read the problem there will be some code written try to execute that
Indhu
@Indhusethu
Jul 11 2016 05:53
page not found @chakrihacker
Subramanya Chakravarthy
@chakrihacker
Jul 11 2016 05:54
give me ur url
Subramanya Chakravarthy
@chakrihacker
Jul 11 2016 05:54
var oldArray = [1, 2, 3];
var timesFour = oldArray.map(function(val){
  return val * 4;
});
console.log(timesFour); // returns [4, 8, 12]
console.log(oldArray); // returns [1, 2, 3]
execute that code in console
of repl
1.you are taking oldArray and mapping it
Indhu
@Indhusethu
Jul 11 2016 05:55
i did this at first itself,
Abhishek Baliyan
@abhishekdevinfo
Jul 11 2016 05:55
when u using map u have to use a function in the map
so map(function)
in function u have to take values
so [1,2,3].map(function(val) {}
then u have to define what u want to do with each the values
so [1,2,3].map(function(val) { val = val + 3;}
then u have to return the value
[1,2,3].map(function(val) { val = val + 3; return val;}
@Indhusethu
Subramanya Chakravarthy
@chakrihacker
Jul 11 2016 05:55
2.you are writing a function that takes val
Indhu
@Indhusethu
Jul 11 2016 05:56
but i could not get it
yes @chakrihacker

var oldArray = [1,2,3,4,5];

// Only change code below this line.
var timesThree=oldArray.map(function(val){
return val + 3;
});
console.log(timesThree);
console.log(oldArray);
var newArray = oldArray;

Subramanya Chakravarthy
@chakrihacker
Jul 11 2016 05:57
var threeTimes = oldArray.map(function(val){
  return val + 3;
});

var newArray = threeTimes;
Rohan Mohammad
@reolander
Jul 11 2016 05:57
@revisualize @Masd925 I have completed the challenge :)
Thanks for your time.
Abhishek Baliyan
@abhishekdevinfo
Jul 11 2016 05:57
@Indhusethu tell me one thing first why u use the last line in your code var newArray = oldArray;
Subramanya Chakravarthy
@chakrihacker
Jul 11 2016 05:58
change newArray = threeTimes instead oldArray
Indhu
@Indhusethu
Jul 11 2016 05:58
it was given already in the code @abhishekdevinfo
Subramanya Chakravarthy
@chakrihacker
Jul 11 2016 05:58
@Indhusethu you have to change the code
Abhishek Baliyan
@abhishekdevinfo
Jul 11 2016 05:59
@Indhusethu i mean what u understand by this line
Indhu
@Indhusethu
Jul 11 2016 05:59
yes,now i understand :smile:
thank you @chakrihacker @abhishekdevinfo
CamperBot
@camperbot
Jul 11 2016 05:59
indhusethu sends brownie points to @chakrihacker and @abhishekdevinfo :sparkles: :thumbsup: :sparkles:
:warning: indhusethu already gave chakrihacker points
:cookie: 276 | @abhishekdevinfo |http://www.freecodecamp.com/abhishekdevinfo
Abhishek Baliyan
@abhishekdevinfo
Jul 11 2016 06:00
@Indhusethu Anytime
Indhu
@Indhusethu
Jul 11 2016 06:00
assigning new array to the oldArray @abhishekdevinfo
Subramanya Chakravarthy
@chakrihacker
Jul 11 2016 06:00
oh god it takes you this much time to understand this line
Indhu
@Indhusethu
Jul 11 2016 06:00
i did not see that line actually @chakrihacker
Subramanya Chakravarthy
@chakrihacker
Jul 11 2016 06:00
sometimes happens especially in javascript
Indhu
@Indhusethu
Jul 11 2016 06:01
hmmm @chakrihacker
Subramanya Chakravarthy
@chakrihacker
Jul 11 2016 06:01
atleast did u understand map function
@Indhusethu
Abhishek Baliyan
@abhishekdevinfo
Jul 11 2016 06:01

@chakrihacker no ur wrong that line means assinging oldArray to new arry var oldArray = [1,2,3,4,5];

var newArray = oldArray;

and when u have the newArray why u assign the old values in newArray
that was the prob

Indhu
@Indhusethu
Jul 11 2016 06:01
yes @chakrihacker
ok, @abhishekdevinfo
Subramanya Chakravarthy
@chakrihacker
Jul 11 2016 06:02
@abhishekdevinfo what's the mistake
Abhishek Baliyan
@abhishekdevinfo
Jul 11 2016 06:05
@chakrihacker actually @Indhusethu is done eveything right but in last line he/she assign the oldArray value to newArray so the whole work will loss
Indhu
@Indhusethu
Jul 11 2016 06:06
yes,you are right @abhishekdevinfo
Abhishek Baliyan
@abhishekdevinfo
Jul 11 2016 06:07
@Indhusethu :smile:
Kevin
@KevinBruland
Jul 11 2016 06:07
help pairwise
CamperBot
@camperbot
Jul 11 2016 06:07

:point_right: algorithm pairwise [wiki]

Algorithm Pairwise

: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 program should look for pairs of numbers in the array whose sum equal the second argument arg. Then instead of adding those numbers up, their indices are to be added.

Remember that arrays start at index 0 and go from there so from [1,4,2,3,0,5] if we switch to their indices it would be [0,1,2,3,4,5]. Then, we add indices 1 + 2 + 3 + 5 and we get 11. That is what we need to return.

Relevant Links

:pencil: read more about algorithm pairwise on the FCC Wiki

Bogdan
@Bogdan032
Jul 11 2016 06:15
Guys, can anyone explain to me what switch statements are used for. I just did one and they feel really useless
Abhishek Baliyan
@abhishekdevinfo
Jul 11 2016 06:15
@Indhusethu @chakrihacker when u complete the front-end in fcc and got some projects except fcc projects to do. if u want a person to help in your projects if u dont mind let me know, i will join
@Bogdan032 ok do u know the if else statement
Subramanya Chakravarthy
@chakrihacker
Jul 11 2016 06:16
@abhishekdevinfo sure
Bogdan
@Bogdan032
Jul 11 2016 06:16
Yes i do
Markus Kiili
@Masd925
Jul 11 2016 06:17
@Bogdan032 Switch is too ugly to use, in my opinion. I have never made one voluntarily.
Abhishek Baliyan
@abhishekdevinfo
Jul 11 2016 06:17
so in if statement
u have to use condition like if(val > 10)
@Bogdan032
so in switch statemant instead of writing full condtion u write only val like switch (val) {
Bogdan
@Bogdan032
Jul 11 2016 06:19
Oh i see. So It's like an easier if else statement?
Abhishek Baliyan
@abhishekdevinfo
Jul 11 2016 06:20
yes but the case values are tested with strict equality (===).
like if(val === 10)
Vikash Saini
@Enigma10
Jul 11 2016 06:20
about @chakrihacker
CamperBot
@camperbot
Jul 11 2016 06:20
:cookie: 253 | @chakrihacker |http://www.freecodecamp.com/chakrihacker
Bogdan
@Bogdan032
Jul 11 2016 06:20
Ok that makes sense. Thanks for explaining :D
Vikash Saini
@Enigma10
Jul 11 2016 06:20
about @Indhusethu
CamperBot
@camperbot
Jul 11 2016 06:20
:cookie: 119 | @indhusethu |http://www.freecodecamp.com/indhusethu
Abhishek Baliyan
@abhishekdevinfo
Jul 11 2016 06:20
Anytime
Subramanya Chakravarthy
@chakrihacker
Jul 11 2016 06:21
about @Enigma10
CamperBot
@camperbot
Jul 11 2016 06:21
:cookie: 314 | @enigma10 |http://www.freecodecamp.com/enigma10
Subramanya Chakravarthy
@chakrihacker
Jul 11 2016 06:21
:smile:
Abhishek Baliyan
@abhishekdevinfo
Jul 11 2016 06:21
about @Enigma10
CamperBot
@camperbot
Jul 11 2016 06:21
:cookie: 314 | @enigma10 |http://www.freecodecamp.com/enigma10
Abhishek Baliyan
@abhishekdevinfo
Jul 11 2016 06:21
:+1:
Vikash Saini
@Enigma10
Jul 11 2016 06:22
;)
Subramanya Chakravarthy
@chakrihacker
Jul 11 2016 06:23
help @Enigma10
CamperBot
@camperbot
Jul 11 2016 06:23
no wiki entry for: @enigma10
Abhishek Baliyan
@abhishekdevinfo
Jul 11 2016 06:23
@Enigma10 tell me one thing did u locked your fcc account
Vikash Saini
@Enigma10
Jul 11 2016 06:23
@abhishekdevinfo yes
Abhishek Baliyan
@abhishekdevinfo
Jul 11 2016 06:24
ohh whats the point to lock
is your code are too tricky :smile:
Vikash Saini
@Enigma10
Jul 11 2016 06:25
@abhishekdevinfo i want to unlock it after getting front-end certificate
Abhishek Baliyan
@abhishekdevinfo
Jul 11 2016 06:25
hahah
hmm
Vikash Saini
@Enigma10
Jul 11 2016 06:26
@abhishekdevinfo which i think i will get within in next 15-20 days :)
Abhishek Baliyan
@abhishekdevinfo
Jul 11 2016 06:26
thats good same as here
then what will u do after
back-end , job, freelancer, or projects
Vikash Saini
@Enigma10
Jul 11 2016 06:28
@abhishekdevinfo next targets are next two certificates
@abhishekdevinfo i am here for certificate .
i know back-end
Abhishek Baliyan
@abhishekdevinfo
Jul 11 2016 06:29
one thing i really like in your pen
when the quote change the color also change
Vikash Saini
@Enigma10
Jul 11 2016 06:29
@abhishekdevinfo this one is not mine
Abhishek Baliyan
@abhishekdevinfo
Jul 11 2016 06:30
This message was deleted
Vikash Saini
@Enigma10
Jul 11 2016 06:31
@abhishekdevinfo i just add line by line freecodecamp code to check how this work
Abhishek Baliyan
@abhishekdevinfo
Jul 11 2016 06:31
BTW what's u do except fcc i mean any other course or degree
Vikash Saini
@Enigma10
Jul 11 2016 06:32
@abhishekdevinfo i am b.tech (IT) student and my 7thsam is going to start
Abhishek Baliyan
@abhishekdevinfo
Jul 11 2016 06:32
ohh last year
Vikash Saini
@Enigma10
Jul 11 2016 06:33
@abhishekdevinfo but i want to work as freelancer
Abhishek Baliyan
@abhishekdevinfo
Jul 11 2016 06:33
great
Indhu
@Indhusethu
Jul 11 2016 06:33

var singleVal=array.reduce(function(previousVal,currentVal){
return previousVal+currentVal;
},0);

singleVal=array;

Vikash Saini
@Enigma10
Jul 11 2016 06:33
@Indhusethu code format
Indhu
@Indhusethu
Jul 11 2016 06:33
can anyone find my mistake??
Vikash Saini
@Enigma10
Jul 11 2016 06:33
code format
Abhishek Baliyan
@abhishekdevinfo
Jul 11 2016 06:33
i also like freelancer
do work whereever u want
Vikash Saini
@Enigma10
Jul 11 2016 06:34
help code format
CamperBot
@camperbot
Jul 11 2016 06:34

: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

Subramanya Chakravarthy
@chakrihacker
Jul 11 2016 06:34
singleval = array
Vikash Saini
@Enigma10
Jul 11 2016 06:34
@Indhusethu help code format
Abhishek Baliyan
@abhishekdevinfo
Jul 11 2016 06:34
@Indhusethu why u again write the last line
Indhu
@Indhusethu
Jul 11 2016 06:35
: confused:
@abhishekdevinfo
can'tg et you? @Enigma10
Abhishek Baliyan
@abhishekdevinfo
Jul 11 2016 06:36

@Indhusethu i already told u that this line singleVal=array; will not good
this means that u assign array in singleVal

so whats the meaning of doing this

var singleVal=array.reduce(function(previousVal,currentVal){
return previousVal+currentVal;
},0);

Vikash Saini
@Enigma10
Jul 11 2016 06:36
@Indhusethu put your code between ```
Indhu
@Indhusethu
Jul 11 2016 06:36
ok @Enigma10
Vikash Saini
@Enigma10
Jul 11 2016 06:37
@Indhusethu post your code again
Indhu
@Indhusethu
Jul 11 2016 06:38

' ' 'var array = [4,5,6,7,8];
var singleVal = 0;

// Only change code below this line.
var singleVal=array.reduce(function(previousVal,currentVal){
return previousVal+currentVal;
},0);

singleVal=sum[items,array];
'''

CamperBot
@camperbot
Jul 11 2016 06:38
:bulb: to format code use backticks! ``` more info
Vikash Saini
@Enigma10
Jul 11 2016 06:38
@Indhusethu ```
@Indhusethu your code
@Indhusethu ```
Markus Kiili
@Masd925
Jul 11 2016 06:39
@Indhusethu Remember that the assignment operator = evaluates the right hand side and assigns the value to the variable on the left hand side. Your last line overwrites the value that you got from the reduce.
Abhishek Baliyan
@abhishekdevinfo
Jul 11 2016 06:39
write ```js then shift+enter then paste your code then ctrl + / then enter
@Indhusethu
Subramanya Chakravarthy
@chakrihacker
Jul 11 2016 06:39
use the button 1
@Indhusethu
oops before 1 key there is another key ```
Indhu
@Indhusethu
Jul 11 2016 06:40

```var array = [4,5,6,7,8];
var singleVal = 0;

// Only change code below this line.
var singleVal=array.reduce(function(previousVal,currentVal){
return previousVal+currentVal;
},0);

singleVal=sum[items,array];
```

Abhishek Baliyan
@abhishekdevinfo
Jul 11 2016 06:41
write ```js then shift+enter then paste your code then ctrl + / then enter
Indhu
@Indhusethu
Jul 11 2016 06:41
ok @Masd925
Abhishek Baliyan
@abhishekdevinfo
Jul 11 2016 06:43
@Indhusethu your code is correct except this line singleVal=sum[items,array];
dont use it
Indhu
@Indhusethu
Jul 11 2016 06:44
what should i assign in that??
Abhishek Baliyan
@abhishekdevinfo
Jul 11 2016 06:46
nothing
Vikash Saini
@Enigma10
Jul 11 2016 06:46
@Indhusethu you don't have to assign anything there .
Abhishek Baliyan
@abhishekdevinfo
Jul 11 2016 06:46
This message was deleted
Vikash Saini
@Enigma10
Jul 11 2016 06:47
@Indhusethu

var array = [4,5,6,7,8];
var singleVal = 0;

// Only change code below this line.

singleVal =  array.reduce(function(previousVal, currentVal) {
  return previousVal + currentVal;
}, 0);
Abhishek Baliyan
@abhishekdevinfo
Jul 11 2016 06:47
why us assigning u alredy do that
var singleVal = array......
here
@Indhusethu
Indhu
@Indhusethu
Jul 11 2016 06:48
but i'm getting an error still
Abhishek Baliyan
@abhishekdevinfo
Jul 11 2016 06:48
thats not possible paste your code
Indhu
@Indhusethu
Jul 11 2016 06:48

var array = [4,5,6,7,8];
var singleVal = 0;

// Only change code below this line.
var singleVal = array.reduce(function(previousVal, currentVal) {
return previousVal - currentVal;
}, 0);

Abhishek Baliyan
@abhishekdevinfo
Jul 11 2016 06:49
remove var from 4th line
Kenzo Mendoza
@KenzoM
Jul 11 2016 06:49
hi all
can anyone outside from US confirm that the unit on my weather app is set to Celcius?
Abhishek Baliyan
@abhishekdevinfo
Jul 11 2016 06:49
u already defined the singleVal then why define again @Indhusethu
Kenzo Mendoza
@KenzoM
Jul 11 2016 06:50
also any feedback on my weather app will also be appreciated :)
Abhishek Baliyan
@abhishekdevinfo
Jul 11 2016 06:50
ya its working correct @Neotriz
Indhu
@Indhusethu
Jul 11 2016 06:50
yes @abhishekdevinfo :)
thank you @abhishekdevinfo @Enigma10
CamperBot
@camperbot
Jul 11 2016 06:51
indhusethu sends brownie points to @abhishekdevinfo and @enigma10 :sparkles: :thumbsup: :sparkles:
:cookie: 315 | @enigma10 |http://www.freecodecamp.com/enigma10
:warning: indhusethu already gave abhishekdevinfo points
Kenzo Mendoza
@KenzoM
Jul 11 2016 06:51
@abhishekdevinfo awesome, thanks for the input
CamperBot
@camperbot
Jul 11 2016 06:51
neotriz sends brownie points to @abhishekdevinfo :sparkles: :thumbsup: :sparkles:
:cookie: 277 | @abhishekdevinfo |http://www.freecodecamp.com/abhishekdevinfo
Abhishek Baliyan
@abhishekdevinfo
Jul 11 2016 06:51
h.png
see in pic @Neotriz
Vikash Saini
@Enigma10
Jul 11 2016 06:52
@abhishekdevinfo ubuntu great!!
@abhishekdevinfo b.tech student
@abhishekdevinfo ?????
Abhishek Baliyan
@abhishekdevinfo
Jul 11 2016 06:52
yes
Kenzo Mendoza
@KenzoM
Jul 11 2016 06:52
@abhishekdevinfo I am curious about the temperature itself. It doesnt look right
does 29 degree on both low and high temperature look right to you?
Fatah N
@fatahn
Jul 11 2016 06:53
Hey guys, can any one understand my code to able to help in the Roman Numerical Converter. I tried using my own way here is a repl.it
function convertToRoman(num) {
  var roman = '';
  var breakNum = '';
  var _num = num.toString().slice(0);
  var splitNum = _num.split('');
  var format = [{M: 1000}, {D: 500}, {C: 100}, {L: 50}, {X: 10}, {V: 5}, {I: 1}];

  var romanSymbol = function(x){
    var symbol = '0';
    var multiple = '';
    for (var j = 0; j < format.length;j++){
      for( var prop in format[j]){
        symbol = format[j][prop];
        if(x === symbol){
          roman += prop;
         }
        else if(x < 1000 && x > symbol){  
          multiple = x / symbol ;
          if( multiple < 5 && multiple > 2){
            roman += prop.repeat(multiple);
          }
          else if( multiple < 3){
            roman += prop.repeat(multiple);
          }
        }
        else if(x > 1000) {
          multiple = x / symbol ;
          roman += prop.repeat(multiple);
          x -= 1000 * multiple;
        }
      }
    }
  }; 
  console.log(splitNum);
  for (var i = 0; i < splitNum.length; i++){
   breakNum = Number(splitNum[i]) * Math.pow(10, (splitNum.length - (i + 1)));
    romanSymbol(breakNum);
  }  
    return roman;
}
convertToRoman(2);
Indhu
@Indhusethu
Jul 11 2016 06:53
you both are b.tech?? @Enigma10 @abhishekdevinfo
Abhishek Baliyan
@abhishekdevinfo
Jul 11 2016 06:53
@Neotriz ohh i did not see that
Vikash Saini
@Enigma10
Jul 11 2016 06:54
@Indhusethu i am
Abhishek Baliyan
@abhishekdevinfo
Jul 11 2016 06:54
@Indhusethu yes b.tech student
@Enigma10 yes
Indhu
@Indhusethu
Jul 11 2016 06:54
which year?? @Enigma10
me too,same pinch
Vikash Saini
@Enigma10
Jul 11 2016 06:54
@abhishekdevinfo which year
Indhu
@Indhusethu
Jul 11 2016 06:54
i completed
Abhishek Baliyan
@abhishekdevinfo
Jul 11 2016 06:54
3
Vikash Saini
@Enigma10
Jul 11 2016 06:55
@Indhusethu going to 4th year
Indhu
@Indhusethu
Jul 11 2016 06:55
searching for job now
Abhishek Baliyan
@abhishekdevinfo
Jul 11 2016 06:55
yes
Indhu
@Indhusethu
Jul 11 2016 06:55
fine
@abhishekdevinfo @Enigma10
Abhishek Baliyan
@abhishekdevinfo
Jul 11 2016 06:55
basically in 4
Vikash Saini
@Enigma10
Jul 11 2016 06:55
@abhishekdevinfo which college
Abhishek Baliyan
@abhishekdevinfo
Jul 11 2016 06:55
but i like FCC more than my collage study
Indhu
@Indhusethu
Jul 11 2016 06:55
best of luck both of you for your future!!
Vikash Saini
@Enigma10
Jul 11 2016 06:55
Thanks
Indhu
@Indhusethu
Jul 11 2016 06:55
me too @abhishekdevinfo
Abhishek Baliyan
@abhishekdevinfo
Jul 11 2016 06:56
JSS Noida
Indhu
@Indhusethu
Jul 11 2016 06:56
@Enigma10 its difficult to say in public
the colllege name
Abhishek Baliyan
@abhishekdevinfo
Jul 11 2016 06:57
Jss Academy of technical education
Indhu
@Indhusethu
Jul 11 2016 06:57
ok @abhishekdevinfo
Abhishek Baliyan
@abhishekdevinfo
Jul 11 2016 06:58
i really dont like my collage and i know that i will only get any job bcoz of fcc
@Enigma10 whats your collage name
@Indhusethu and your also
Indhu
@Indhusethu
Jul 11 2016 07:00
yes,waste of 4yrs
in college
Dolan
@dguh
Jul 11 2016 07:01
could someone help me get my code to iterate through the rest of my array? it's only working with the first element\
Abhishek Baliyan
@abhishekdevinfo
Jul 11 2016 07:01
@Indhusethu @Enigma10 i think u both dont want to share
no problem
@dguh whats your code
Indhu
@Indhusethu
Jul 11 2016 07:02
ok @abhishekdevinfo
Subramanya Chakravarthy
@chakrihacker
Jul 11 2016 07:04
@Indhusethu , @Enigma10 it's really waste of 4 years, literally wasting time and money
Abhishek Baliyan
@abhishekdevinfo
Jul 11 2016 07:05
@dguh according to my knowledge its look good
Indhu
@Indhusethu
Jul 11 2016 07:05
ha ha @chakrihacker
and you ?? @chakrihacker
Subramanya Chakravarthy
@chakrihacker
Jul 11 2016 07:06
I am a dropout
Dolan
@dguh
Jul 11 2016 07:06
why doesn't the offline message come up for the other channels?
@abhishekdevinfo
Indhu
@Indhusethu
Jul 11 2016 07:06
your course of study??
Abhishek Baliyan
@abhishekdevinfo
Jul 11 2016 07:06
sometimes i think why i dont know the fcc in 4 years ago @Indhusethu @chakrihacker @Enigma10
Subramanya Chakravarthy
@chakrihacker
Jul 11 2016 07:06
I din't feel I am learning anything
Indhu
@Indhusethu
Jul 11 2016 07:06
you guys have known this atleast now
@abhishekdevinfo
Subramanya Chakravarthy
@chakrihacker
Jul 11 2016 07:06
@abhishekdevinfo because it started in 2014
Indhu
@Indhusethu
Jul 11 2016 07:07
is it?? @chakrihacker
Subramanya Chakravarthy
@chakrihacker
Jul 11 2016 07:07
I learned a lot by self rather than in college
yes
Indhu
@Indhusethu
Jul 11 2016 07:07
yes,it has saved many lives,thank you fcc:)
Abhishek Baliyan
@abhishekdevinfo
Jul 11 2016 07:07
@dguh sir really dont know i only check the array and the use of array but i dont know ajax and other think
Subramanya Chakravarthy
@chakrihacker
Jul 11 2016 07:08
:smile:
@Indhusethu you don't learn anything useful in real world if you are in college
Dolan
@dguh
Jul 11 2016 07:08
@abhishekdevinfo thnx for trying
CamperBot
@camperbot
Jul 11 2016 07:08
dguh sends brownie points to @abhishekdevinfo :sparkles: :thumbsup: :sparkles:
:cookie: 278 | @abhishekdevinfo |http://www.freecodecamp.com/abhishekdevinfo
Abhishek Baliyan
@abhishekdevinfo
Jul 11 2016 07:09
when i look in fcc i thought i waste my lots of money and time in collage
Indhu
@Indhusethu
Jul 11 2016 07:09
yeah,tat's true @chakrihacker
Abhishek Baliyan
@abhishekdevinfo
Jul 11 2016 07:09
@chakrihacker @Indhusethu
Indhu
@Indhusethu
Jul 11 2016 07:09
same thought @abhishekdevinfo
Abhishek Baliyan
@abhishekdevinfo
Jul 11 2016 07:10
self learning is best and the best think i like about internet is every thing is available in it u dont have to go to collage
@Indhusethu @chakrihacker
Subramanya Chakravarthy
@chakrihacker
Jul 11 2016 07:10
yes
Abhishek Baliyan
@abhishekdevinfo
Jul 11 2016 07:13
i have something to share with u
i see soo many peoples who make a great portfolio site of a group of members and every member is good in differnt stuff like app dev, front-end, back,end etc
@chakrihacker @Indhusethu
i just want some good peoples to join with me or join me to there projects so we will make great things
Subramanya Chakravarthy
@chakrihacker
Jul 11 2016 07:15
pair programming..
what's your idea