These are chat archives for FreeCodeCamp/HelpJavaScript

14th
Nov 2016
Alan Barr
@alanmbarr
Nov 14 2016 00:00
in between the function() parens you need to pass an argument
function(setthegearnumberhere)
Romano P
@romanopagnan
Nov 14 2016 00:00
@StasVitvitskiy you need an argument for the function
in between the parenthesis
Alan Barr
@alanmbarr
Nov 14 2016 00:00
then assign that to your private variable like romano is saying
Walid Ashri
@walidashri
Nov 14 2016 00:01
@JohnnyBizzel R u there?
Stas Vitvitskiy
@StasVitvitskiy
Nov 14 2016 00:02
@alanmbarr @romanopagnan thanks guys
CamperBot
@camperbot
Nov 14 2016 00:02
stasvitvitskiy sends brownie points to @alanmbarr and @romanopagnan :sparkles: :thumbsup: :sparkles:
:cookie: 280 | @romanopagnan |http://www.freecodecamp.com/romanopagnan
:cookie: 300 | @alanmbarr |http://www.freecodecamp.com/alanmbarr
Alan Barr
@alanmbarr
Nov 14 2016 00:02
yw!
Steve Brockley
@stevebrockley
Nov 14 2016 00:03
please help me with the Jello World challenge! What is wrong here?

// Setup
var myStr = "Jello World";

// Only change code below this line
myStr = "Hello World";
myStr[0] = "H"; // Fix Me

Walid Ashri
@walidashri
Nov 14 2016 00:04
@stevebrockley last line
Alan Barr
@alanmbarr
Nov 14 2016 00:04
strings are immutable in javascript so you need to do something different
Romano P
@romanopagnan
Nov 14 2016 00:04
@stevebrockley you are changing a correct string :)
Steve Brockley
@stevebrockley
Nov 14 2016 00:06
the example is:
var myStr = "Bob";
myStr = "Job";
Seth Church
@iEnder
Nov 14 2016 00:07
@stevebrockley look into .split()
Steve Brockley
@stevebrockley
Nov 14 2016 00:07
I thought that this is what I did. I will try to look into .split @pkmn9060
Romano P
@romanopagnan
Nov 14 2016 00:08
@stevebrockley you should find a way to transform that string into an array...
Steve Brockley
@stevebrockley
Nov 14 2016 00:09
ok @romanopagnan I'll look at the link
I don't understand how I'm supposed to know how to use string split at this point as it's never come up or been explained though
Alan Barr
@alanmbarr
Nov 14 2016 00:12
I feel ya Steve, you run into a bunch of these things enough though you build up your toolbox but for sure some assignments are not super clear where to start
there is more than one way to do these too split isn't the only answer
Romano P
@romanopagnan
Nov 14 2016 00:13
@stevebrockley what is the name of the exercise? i want to see where it is located on the map
Steve Brockley
@stevebrockley
Nov 14 2016 00:13
I got this far without coming against something I'd never encountered before. What other way could I look at? or do I need to tack the split at this point?
@romanopagnan 152 understand string immutability
Johnny
@JohnnyBizzel
Nov 14 2016 00:14
@walidashri Yes
Romano P
@romanopagnan
Nov 14 2016 00:16
@stevebrockley well in this case the instruction is Correct the assignment to myStr to achieve the desired effect., so you don't really need to use split, just change the assignment :)
Steve Brockley
@stevebrockley
Nov 14 2016 00:17
the example they give seems straight ahead, but I was unsuccessful trying to apply it to the challenge. @romanopagnan I thought of that, except they don't want you to change code above their line
or do you mean something else?
Romano P
@romanopagnan
Nov 14 2016 00:17
reassign the new value above the line
Steve Brockley
@stevebrockley
Nov 14 2016 00:18
ok I'll try that out
Romano P
@romanopagnan
Nov 14 2016 00:19
your code was actually right, it's the myStr[0] = "H"; that was wrong
Steve Brockley
@stevebrockley
Nov 14 2016 00:19
not getting anywhere. What did I do wrong here: myStr = "Hello World"; should fix it right?
so you're saying keep my code and change that part?
Romano P
@romanopagnan
Nov 14 2016 00:19
yes
that's the answer
myStr = "Hello World";
does it say it's wrong?
MoNag1
@MoNag1
Nov 14 2016 00:20
// Setup
var myStr = "Jello World";

// Only change code below this line
myStr = ["J","e","l","l","o"," ","W","o","r","l","d"];

myStr[0] = "H";
myStr = myStr.toString().replace(/,/g,"");
this is what I had done for that challenge lol
it was before I learnt split so I manually split it lol
Romano P
@romanopagnan
Nov 14 2016 00:20
@MoNag1 lol
Steve Brockley
@stevebrockley
Nov 14 2016 00:21
@romanopagnan ya it says it's wrong
Romano P
@romanopagnan
Nov 14 2016 00:21
just myStr = "Hello World";, nothing else
Steve Brockley
@stevebrockley
Nov 14 2016 00:21
@MoNag1 that's crazy! There's no way that they'd expect us to know that at this point
Alan Barr
@alanmbarr
Nov 14 2016 00:22
it's more about understanding that strings are immutable
Romano P
@romanopagnan
Nov 14 2016 00:22
// Setup
var myStr = "Jello World";

// Only change code below this line

myStr = "Hello World"; // Fix Me
__mifflin__
@cdrainxv
Nov 14 2016 00:22
@stevebrockley: They already mentioned that strings are immutable… you can’t change it unless you reassign it altogether… or transform it into an array.
Romano P
@romanopagnan
Nov 14 2016 00:22
that's all
Alan Barr
@alanmbarr
Nov 14 2016 00:22
that you need to do some manipulation instead of mystr[0] = H; which won't change mystr being different than Jello World
Steve Brockley
@stevebrockley
Nov 14 2016 00:23

@romanopagnan so this is what I did: // Setup
var myStr = "Jello World";

// Only change code below this line
myStr = "Hello World";
myStr[0] = "H"; // Fix Me

Romano P
@romanopagnan
Nov 14 2016 00:23
@stevebrockley take away the mystr[0] part
Steve Brockley
@stevebrockley
Nov 14 2016 00:23
ok
Romano P
@romanopagnan
Nov 14 2016 00:24
just myStr = "Hello World";
Steve Brockley
@stevebrockley
Nov 14 2016 00:24
@romanopagnan ok that works! Thanks although I'm not really sure what the challenge was at this point lol
CamperBot
@camperbot
Nov 14 2016 00:24
stevebrockley sends brownie points to @romanopagnan :sparkles: :thumbsup: :sparkles:
:cookie: 282 | @romanopagnan |http://www.freecodecamp.com/romanopagnan
MoNag1
@MoNag1
Nov 14 2016 00:25
@stevebrockley I think it's more about getting the concept through that strings are immutable, you know that now so I think it got its point across
Romano P
@romanopagnan
Nov 14 2016 00:25
@stevebrockley lol. it was to make REALLY clear that you can't change strings
Steve Brockley
@stevebrockley
Nov 14 2016 00:25
damn right it got it's point across! I couldn't change it. Really confusing challenge with its example though lol
worst so far in my opinion
thanks @MoNag1 and @alanmbarr too
CamperBot
@camperbot
Nov 14 2016 00:26
:cookie: 320 | @monag1 |http://www.freecodecamp.com/monag1
stevebrockley sends brownie points to @monag1 and @alanmbarr :sparkles: :thumbsup: :sparkles:
:cookie: 301 | @alanmbarr |http://www.freecodecamp.com/alanmbarr
MoNag1
@MoNag1
Nov 14 2016 00:27
:thumbsup:
Steve Brockley
@stevebrockley
Nov 14 2016 00:27
That took me way too long to do basically nothing lol
Alan Barr
@alanmbarr
Nov 14 2016 00:28
yeah it's annoying but saves you pain in the future
js has some weird gotchas
Aldair
@ald1413
Nov 14 2016 00:31
Hello, can anyone check my code? Its for the Caesar Cipher challenge
function rot13(str) { // LBH QVQ VG!
  var result = [];
  for (var i = 0; i < str.length; i++) {
if (str[i].charCodeAt() >= 65 || str[i].charCodeAt() <= 77) {
var word = str[i].charCodeAt() - 13;
result.push(String.fromCharCode(word));
}
  else if (str[i].charCodeAt() >= 78 || str[i].CharCOdeAt() <=90) {
var word2= str[i].charCodeAt() + 13;
    result .push(String.fromCharCode(word2));
  }
} return result; 
}
// Change the inputs below to test
rot13("SERR PBQR PNZC");
Moisés Man
@moigithub
Nov 14 2016 00:34
result is an array.. probably u should return a string instead @ald1413
Aldair
@ald1413
Nov 14 2016 00:35
Ive tried to change it into a string but it doesnt work
Alan Barr
@alanmbarr
Nov 14 2016 00:35
did you join it?
Aldair
@ald1413
Nov 14 2016 00:36
Is my logic right tho, I often have trouble with that
Moisés Man
@moigithub
Nov 14 2016 00:36
probably instead of OR || yu should use AND &&
to specify ur ranges...
Aldair
@ald1413
Nov 14 2016 00:37
ohh i see!
__mifflin__
@cdrainxv
Nov 14 2016 00:37
@ald1413: You want characters ranging from 65 - 90 to transform/translate. Return the characters not in the range as is.
Aldair
@ald1413
Nov 14 2016 00:42
Now ive tried this
```
  if (str[i].charCodeAt() >= 65 && str[i].charCodeAt() <= 90) {
    var word = str[i].charCodeAt() - 13;
    result.push(String.fromCharCode(word));
  }
the result is not a function now
Moisés Man
@moigithub
Nov 14 2016 00:45
copy ur code on https://repl.it/languages/javascript ...save ... then post a link to test :D
Justin Stauffer
@justindstauffer
Nov 14 2016 00:49
how do you enter code like that into chat
i have a question about this problem i am working on
Aldair
@ald1413
Nov 14 2016 00:49
under esc
Moisés Man
@moigithub
Nov 14 2016 00:50
'''
CamperBot
@camperbot
Nov 14 2016 00:50
:bulb: to format code use backticks! ``` more info
Moisés Man
@moigithub
Nov 14 2016 00:50
click that more info link @justindstauffer
Justin Stauffer
@justindstauffer
Nov 14 2016 00:50
ok thank you
thats the link sorry about the comments haha
Moisés Man
@moigithub
Nov 14 2016 00:52
ok.. u changed ur variable to a string ... var result = ""
string do NOT have push method..so error u get
if u wann ause strings.. u can concatenate.. just result = result + newString
Charles
@charlessmith259
Nov 14 2016 00:53
@moigithub do you know react?
Moisés Man
@moigithub
Nov 14 2016 00:53
i finished all curricula 2 or 3 months ago then got boored took a 2 or 3 month break. so i just keep poping in here fromtime to time.. probably already forgot :P (lack of practice )
Charles
@charlessmith259
Nov 14 2016 00:54
@moigithub damn, you remember a little bit of react router?
Greg Duncan
@GregatGit
Nov 14 2016 00:54
@ald1413 you can't push to string
Moisés Man
@moigithub
Nov 14 2016 00:55
probably.. i remember something.. or probably not :P.. just ask @charlessmith259
Justin Stauffer
@justindstauffer
Nov 14 2016 00:55

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

function checkObj(checkProp) {
// Your Code Here
var checkk = myObj.hasOwnProperty(checkProp);
if (checkk){
return myObj.checkProp;
}
else {
return "Not Found";
}
}

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

ok didnt work how i wanted lol
Moisés Man
@moigithub
Nov 14 2016 00:56
shift enter after backticks.. backticks must be on its own line @justindstauffer
also 3 backticks at the end
checkprop is a variable... so NO dot notation with variables return myObj.checkProp; <--- @justindstauffer
Greg Duncan
@GregatGit
Nov 14 2016 00:57
@ald1413 try var result = []; and join('') at the end
Justin Stauffer
@justindstauffer
Nov 14 2016 00:57
yea that is my issue...
Joseph
@revisualize
Nov 14 2016 00:58
@justindstauffer Dot Notation is a String Literal. Example: myObj.name; is the same as myObj["name"]; and as we all know quotes define strings. If you want to use a variable for accessing the value of object properties you cannot use Dot Notation. You have to use Bracket Notation.
Justin Stauffer
@justindstauffer
Nov 14 2016 00:58
how do i return the value of checkProp if it is a property
Charles
@charlessmith259
Nov 14 2016 00:58
@moigithub so I am trying to redirect my app using index redirect
<Router history={hashHistory}>
   <Route path="/" component={App}>
      <IndexRedirect to={this.state.data[0].name} /> // This has to be fetched from server
      <Route path=":category" component={App} />
     </Route>
   </Router>
Justin Stauffer
@justindstauffer
Nov 14 2016 00:58
@revisualize ok thank you ill try it
CamperBot
@camperbot
Nov 14 2016 00:58
justindstauffer sends brownie points to @revisualize :sparkles: :thumbsup: :sparkles:
:star2: 2303 | @revisualize |http://www.freecodecamp.com/revisualize
Justin Stauffer
@justindstauffer
Nov 14 2016 01:00
ok thank you very much. I get it now and have passed the problem.
Michael Karpinski
@karpimpski
Nov 14 2016 01:00
hey, I set up this simple script to add an event listener when iterating through an array, but only the last element's listener works.
function roll(diceQuantity){
    document.querySelector('#dice_area').innerHTML = "";
    var rolledDice = [];
    for(var i = 0; i < diceQuantity; i++){
        document.querySelector('#dice_area').innerHTML += "<div class='die'></div>";
        var num = Math.floor((Math.random() * 6) + 1);
        var currentDie = document.querySelectorAll('.die')[i];
        currentDie.innerHTML = num;
        rolledDice.push(currentDie);
    }

    for(var j = 0; j < rolledDice.length; j++){
        rolledDice[j].addEventListener('click', function(){
            alert(this.innerHTML);
        });
    }
}

document.querySelector('#roll').addEventListener('click', function(){
    roll(6);
});
Jess Xuan
@jesskxuan
Nov 14 2016 01:01

ahhh can someone guide me in the right direction…
profile lookup exercise:

  for (i = 0; i < contacts.length; i++) {
    var data = "";
    if (firstName == contacts[i].firstName && contacts[i][prop]) {
      data += contacts[i][prop];
    } else if (firstName == contacts[i].firstName && !contacts[i][prop]) {
        data += "No such property";
    } else {
      data += "No such contact";
    }
    console.log(data); // for me
    return data;
  }

failing for lookUpProfile("Kristian", "lastName"); but passes lookUpProfile("Akira", "likes"); ?
not sure if using empty variable to store is even correct…?

Aldair
@ald1413
Nov 14 2016 01:02
@GregatGit Thanks for that!
I still have trouble returning numbers instead of letters but let me see what i can try
CamperBot
@camperbot
Nov 14 2016 01:02
:cookie: 783 | @gregatgit |http://www.freecodecamp.com/gregatgit
ald1413 sends brownie points to @gregatgit :sparkles: :thumbsup: :sparkles:
Jeff Shapiro
@Jeff-Shapiro
Nov 14 2016 01:02
@jesskxuan nice site you have! who made it for you?
Joseph
@revisualize
Nov 14 2016 01:02
@jesskxuan So, you have a few problems.
Greg Duncan
@GregatGit
Nov 14 2016 01:02
@jesskxuan you need to leave the loop once you find the property your after, not keep looking
Jess Xuan
@jesskxuan
Nov 14 2016 01:03
@Jeff-Shapiro oop my personal folio site? Its just self coded and designed! no cms haha thanks!
Engineer-Kingdom
@Engineer-Kingdom
Nov 14 2016 01:04
blob
Joseph
@revisualize
Nov 14 2016 01:04
@jesskxuan If the firstName doesn't match contacts[0]["firstName"] you're forcing the code to concatenate data.
Engineer-Kingdom
@Engineer-Kingdom
Nov 14 2016 01:04
the results are all correct why cant pass
Joseph
@revisualize
Nov 14 2016 01:04
@Engineer-Kingdom Remove your quote escapes
Engineer-Kingdom
@Engineer-Kingdom
Nov 14 2016 01:05
@revisualize ok thanks lol
CamperBot
@camperbot
Nov 14 2016 01:05
engineer-kingdom sends brownie points to @revisualize :sparkles: :thumbsup: :sparkles:
:star2: 2304 | @revisualize |http://www.freecodecamp.com/revisualize
Jess Xuan
@jesskxuan
Nov 14 2016 01:06
@revisualize ah yes I see now… I'll have another play around! Thanks! how do i even send brownie points eek
CamperBot
@camperbot
Nov 14 2016 01:06
jesskxuan sends brownie points to @revisualize :sparkles: :thumbsup: :sparkles:
:star2: 2305 | @revisualize |http://www.freecodecamp.com/revisualize
Jess Xuan
@jesskxuan
Nov 14 2016 01:06
ah robots save the day thanks y'all
Moisés Man
@moigithub
Nov 14 2016 01:06

@charlessmith259 not sure about this... but.. i think all ur "paths" need to be predefined before use IndexRedirect..
example:

<Route path="/" component={App}>
  <IndexRedirect to="/welcome" />
  <Route path="welcome" component={Welcome} />
  <Route path="about" component={About} />
</Route>

/welcome is defined as route on this example
or..probably im wrong :P

@charlessmith259 what {this.state.data[0].name} return ? there are any component to handle that data ?? probably u can use a parametrized(not sure if this is english word :P ) component
ie: <Route path ="/mypath/:name" component={handleDataComponent} />
and make links like <Link to=\/mypath/${this.state.data[0].name`}>boo</Link>`
bobajeff87
@bobajeff87
Nov 14 2016 01:21
need some help with a freeCodeCamp assignment
Sheldon07
@Sheldon07
Nov 14 2016 01:24
can someone help me with the Word Blanks code assignment please :)
John Tendik
@JohnTendik
Nov 14 2016 01:25
@jesskxuan return your data after the loop otherwise after the first loop it will stop
after as in outside of the for loop,
Treylerp
@Treylerp
Nov 14 2016 01:26

// Example
var changed = 0;

function change(num) {
return (num + 5) / 3;
}

changed = change(10);

// Setup
var processed = 0;

function processArg(num) {
return (num + 3) / 5;
}
// Only change code below this line
var processed = 2;

how do i make processedArg
assign processArg to processed
John Tendik
@JohnTendik
Nov 14 2016 01:27
@Treylerp do processArg(processed);
processed then becomes the (num) arguement
return (2+3) /5
Justin Vernon
@Jvernz
Nov 14 2016 01:31
For Falsy Bouncer, why is my code not splicing "null" or "false"?
for (var i = 0; i<arr.length;i++) {

   if (Boolean(arr[i]) === false) {
     arr.splice(i, 1);
   }
 }


 return arr;
}

bouncer([1, null, NaN, 2, undefined]);
Treylerp
@Treylerp
Nov 14 2016 01:31
@JohnTendik I tried that i cant figure it out
Keith
@keithneese
Nov 14 2016 01:31

I can't seem to figure out what I'm doing wrong on the golf challenge. This is what I've got so far:

function golfScore(par, strokes) {
// Only change code below this line
if (strokes === 1){
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 {
return "Go Home!";
}

// Only change code above this line
}

// Change these values to test
golfScore(5, 4);

Somia ♡
@somiajagadish
Nov 14 2016 01:36
Hiii anyone need help?
Justin Vernon
@Jvernz
Nov 14 2016 01:38
 for (var i = 0; i<arr.length;i++) {

   if (Boolean(arr[i]) === false || arr[i] === null || arr[i] === false) {
     arr.splice(i, 1);
     i--;

   }
 }


 return arr;
}

bouncer([1, null, NaN, 2, undefined]);
I'm trying to figure out why my code now works. I initially didn't decrement i after the splice so "null" didn't get spliced.
does Boolean[NaN] = null?
Moisés Man
@moigithub
Nov 14 2016 01:40
Boolean(null) return false
Boolean(false) return false...
soo || arr[i] === null || arr[i] === false isnt needed
Tony Miri
@TonyMiri
Nov 14 2016 01:41
@somiajagadish I do
Justin Vernon
@Jvernz
Nov 14 2016 01:41
@moigithub I see that now. I was trying to figure out why my output (before adding i--;) was [1, null, 2]
Moisés Man
@moigithub
Nov 14 2016 01:42
cuz splice mutates the array (remove elements ).. but ur i (loop variable) keep increasing.. so it skip some elements.. thats why addin i---; fix the index
Tony Miri
@TonyMiri
Nov 14 2016 01:42
I'm not sure what is going on with reduce() right here. In the console it's showing the correct values in the beginning, but when reduce starts to iterate it starts showing undefined.
function checkCashRegister(price, cash, cid) {
  // Check if there is enough money in the drawer
  // Check if there is the exact amount of money in the drawer
  // Return the correct change sorted highest to lowest
  var changeDue = cash - price;
  var drawerTotal = Array.from(cid);

  drawerTotal = drawerTotal.reduce(function (first, second, array) {

    console.log(first[1], second[1])
    var total = first[1] + second[1];
    return total;


  });

  console.log(drawerTotal);
}

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

checkCashRegister(19.50, 20.00, [["PENNY", 1.01], ["NICKEL", 2.05], ["DIME", 3.10], ["QUARTER", 4.25], ["ONE", 90.00], ["FIVE", 55.00], ["TEN", 20.00], ["TWENTY", 60.00], ["ONE HUNDRED", 100.00]]);
Justin Vernon
@Jvernz
Nov 14 2016 01:43
@moigithub I get that, but if null is arr1, and arr[0] doesn't get spliced, why would it not run the if statement on arr1?
Moisés Man
@moigithub
Nov 14 2016 01:48
@Jvernz [1, null, NaN, 2, undefined]
i start on 0
arr[0] is 1 ...not false.. keep i increase to 1
arr[1] is null ... IS false... array mutate.. i increase to 2
arr[2] is 2 (is not nan cuz array already mutated cuz splice.. so u have [1, NaN, 2, undefined]
... etc.. so ur code should return [1,NaN, 2] <-- probably cuz formating the FCC test return [1,null,2]
Somia ♡
@somiajagadish
Nov 14 2016 01:48
myStr[0] = "H";
What do they want me to fix?

In JavaScript, String values are immutable, which means that they cannot be altered once created.

For example, the following code:

var myStr = "Bob";
myStr[0] = "J";

cannot change the value of myStr to "Job", because the contents of myStr cannot be altered. Note that this does not mean that myStr cannot be changed, just that the individual characters of a string literal cannot be changed. The only way to change myStr would be to assign it with a new string, like this:

var myStr = "Bob";
myStr = "Job";
myStr[0] = "H";
Romano P
@romanopagnan
Nov 14 2016 01:49
@Jvernz since falsy values are evaluated as false by Boolean() you also could have done return arr.filter(Boolean)
Somia ♡
@somiajagadish
Nov 14 2016 01:49
they gave me this
balakrishnafreecodecampcoder
@balakrishnafreecodecampcoder
Nov 14 2016 01:49
hey guys need help with this code...
Jeff Shapiro
@Jeff-Shapiro
Nov 14 2016 01:49
@somiajagadish in general they're immutable
balakrishnafreecodecampcoder
@balakrishnafreecodecampcoder
Nov 14 2016 01:49

// Setup
var testObj = {
"an entree": "hamburger",
"my side": "veggies",
"the drink": "water"
};

// Only change code below this line

var entreeValue = testObj; // Change this line
var drinkValue = testObj; // Change this line
entreeValue["an entree"]
drinkValue['the drink'];

Justin Vernon
@Jvernz
Nov 14 2016 01:49
@moigithub I see so it's just a formatting thing. Thanks!
CamperBot
@camperbot
Nov 14 2016 01:49
jvernz sends brownie points to @moigithub :sparkles: :thumbsup: :sparkles:
:star2: 2189 | @moigithub |http://www.freecodecamp.com/moigithub
Justin Vernon
@Jvernz
Nov 14 2016 01:50
@romanopagnan I couldn't figure out how to use .filter so I went a different route. Going to look up some videos on how to use it. Or maybe I'll figure it out on Seek & Destroy!
Jeff Shapiro
@Jeff-Shapiro
Nov 14 2016 01:50
@FatTone225 happy to help wanna chat private. all the chatter annoys me thats all
Somia ♡
@somiajagadish
Nov 14 2016 01:50
@Jeff-Shapiro what do they want me to change?
Jeff Shapiro
@Jeff-Shapiro
Nov 14 2016 01:50
@somiajagadish your method of reasearch
Somia ♡
@somiajagadish
Nov 14 2016 01:50
huh
Romano P
@romanopagnan
Nov 14 2016 01:51
@somiajagadish read the instruction, it's very simple :) just reassign the correct value to mystr
Somia ♡
@somiajagadish
Nov 14 2016 01:51
okay.
Justin Vernon
@Jvernz
Nov 14 2016 01:52
So for Seek and Destroy, I want to use the arguments object to return any additional arguments after the array, and apply the filter using those arguments.
Moisés Man
@moigithub
Nov 14 2016 01:54
yes @Jvernz
Romano P
@romanopagnan
Nov 14 2016 01:54
@Jvernz it takes a function as argument and returns only values that that functions returns as true. since Boolean(falsy value) returns false, these values are filtered out
Justin Vernon
@Jvernz
Nov 14 2016 01:54
@romanopagnan I see. I think I tried that. Maybe got the syntax wrong. Thanks though, I'll check it out!
CamperBot
@camperbot
Nov 14 2016 01:54
:cookie: 291 | @romanopagnan |http://www.freecodecamp.com/romanopagnan
jvernz sends brownie points to @romanopagnan :sparkles: :thumbsup: :sparkles:
Justin Vernon
@Jvernz
Nov 14 2016 01:57
@moigithub Should I store each additional argument into an array?
Moisés Man
@moigithub
Nov 14 2016 01:58
depends on ur code... u could.. saw some ppl store on another array.. other just loop
Justin Vernon
@Jvernz
Nov 14 2016 01:59
I'm doing a loop and storing in an array as well. I hope I learn to simplify things eventually :worried:
Walid Ashri
@walidashri
Nov 14 2016 02:00
@keithneese you got your help?
Justin Vernon
@Jvernz
Nov 14 2016 02:01
I don't understand how I'm supposed to use filter. Can I not use filter inside of a function?
function destroyer(arr) {
  // Remove all the values
  var ansArr = [];
  for (i = 1; i<arguments.length;i++) {
    ansArr[i-1] = arguments[i];
  }

  var filtered = arr.filter();
  return filtered;
}

destroyer([1, 2, 3, 1, 2, 3], 2, 3);
Jemma Tiongson
@jemmamariex3
Nov 14 2016 02:01
hello! anyone know of the syntax to make an string split, turn into an array and then make it ignoreCase? something like this: var res = str.split("").ignoreCase();
@Jvernz why don't you do a for loop and then push what you need to "filter" into an array?
Moisés Man
@moigithub
Nov 14 2016 02:03
filter function syntax requires/uses a function as argument.. that function will determine if keep or discard the element
Justin Vernon
@Jvernz
Nov 14 2016 02:03
@jemmamariex3 That's what I'm doing
@moigithub Okay. I just don't know how to format the syntax for this. Do I need to create a separate function?
Jemma Tiongson
@jemmamariex3
Nov 14 2016 02:04
well.. more like ansArr.push(arguments[i]);
just a suggestion ><
Justin Vernon
@Jvernz
Nov 14 2016 02:04
@jemmamariex3 Oh I see what you're saying
@jemmamariex3 thanks!
CamperBot
@camperbot
Nov 14 2016 02:04
jvernz sends brownie points to @jemmamariex3 :sparkles: :thumbsup: :sparkles:
:cookie: 61 | @jemmamariex3 |http://www.freecodecamp.com/jemmamariex3
Jemma Tiongson
@jemmamariex3
Nov 14 2016 02:04
@Jvernz of course!
Moisés Man
@moigithub
Nov 14 2016 02:05
function onlyBiggerThan3 ( num ) {
  if num>3 return true
  else return false;
}

a= [1,2,3,4,5,6,7];
result = a.filter(onlyBiggerThan3);  // <-- will return [4,5,6,7]
Justin Vernon
@Jvernz
Nov 14 2016 02:05
@moigithub I'm just concerned with how I'm supposed to use destroyer(arr) to get the input
and then put that input into a filter
Moisés Man
@moigithub
Nov 14 2016 02:06
what filter does is pick one by one each array value..and apply the function to it
if the function return true.. the element is keeped.. else discarted
Justin Vernon
@Jvernz
Nov 14 2016 02:06
Right
Coy Sanders
@coymeetsworld
Nov 14 2016 02:07
@jemmamariex3 why do you want to ignore the case?
Moisés Man
@moigithub
Nov 14 2016 02:11
@jemmamariex3 using regex u can use /i flag to ignore cases... else
just convert ur string toLowerCase or toUppercase.. then u only need to deal with upper OR lower
balakrishnafreecodecampcoder
@balakrishnafreecodecampcoder
Nov 14 2016 02:12

var testObj = {
"an entree": "hamburger",
"my side": "veggies",
"the drink": "water"
};

var entreeValue = testObj;
var drinkValue = testObj;
entreeValue["an entree"];
drinkValue['the drink']; i am getting

error
Coy Sanders
@coymeetsworld
Nov 14 2016 02:12
what are you trying to do @balakrishnafreecodecampcoder ?
balakrishnafreecodecampcoder
@balakrishnafreecodecampcoder
Nov 14 2016 02:12
can anyone fix the error pls.
@coymeetsworld ,,Accessing Objects Properties with Bracket Notation
anhvubui
@anhvubui3949
Nov 14 2016 02:13
help var myStr = 'FristLine\n \SecondLine\ \rThirdLine';
CamperBot
@camperbot
Nov 14 2016 02:13
no wiki entry for: var mystr fristlinen secondline rthirdline
Coy Sanders
@coymeetsworld
Nov 14 2016 02:13
the last 2 lines don't do anything @balakrishnafreecodecampcoder
as far as entreeValue and drinkValue you're not setting them to testObj
Jemma Tiongson
@jemmamariex3
Nov 14 2016 02:14
@coymeetsworld oh I'm working on this codewar problem where all vowels are pushed into an array and the rest if pushed into another. i have to return the new string the only thing is that the last word of the string is "LOL" so i need to remove "O" but keep the caps
Coy Sanders
@coymeetsworld
Nov 14 2016 02:14
@balakrishnafreecodecampcoder you need to merge those two lines together you're on right track though
Jemma Tiongson
@jemmamariex3
Nov 14 2016 02:15
@moigithub yeah i tried that. but the solution to code wars is transforming "This website is for losers LOL!" to "Ths wbst s fr lsrs LL!". when you remove the vowels.
c0d0er
@c0d0er
Nov 14 2016 02:16
@toianw thanks
CamperBot
@camperbot
Nov 14 2016 02:16
c0d0er sends brownie points to @toianw :sparkles: :thumbsup: :sparkles:
:cookie: 418 | @toianw |http://www.freecodecamp.com/toianw
Coy Sanders
@coymeetsworld
Nov 14 2016 02:16
@jemmamariex3 hmm im not sure what that means, you're saying you have an array of vowels and array of consonants?
and you need to merge them together to make a phrase?
Alan Barr
@alanmbarr
Nov 14 2016 02:17
Jemma are you stuck on filtering the vowels?
Jemma Tiongson
@jemmamariex3
Nov 14 2016 02:18
@coymeetsworld yeah! so the string is passed into a function that loops through the split letter of the string and pushes the letter into one of two empty arrays. if its a vowel: vowelArr , other: otherArr. the only thing is that the last word 'LOL' are all in caps so i need to be able to still split the string and then ignore the cases. i was wondering if anyone knew the proper syntax to do that :O
@alanmbarr i guess its filtering ><
Coy Sanders
@coymeetsworld
Nov 14 2016 02:19
and you need to preserve whether or not its a capital letter still @jemmamariex3 ? like the 2 capital Ls need to be in otherArr and the capital O needs to be in vowelArr?
if so then I would use regex to figure that out, if its not working maybe theres something wrong with the setup
Jemma Tiongson
@jemmamariex3
Nov 14 2016 02:20

@coymeetsworld heres my code:

var vowelArr = [];
var otherArr =[];
function disemvowel(str) {
var res = str.split("").ignoreCase();
for(var i = 0; i<str.length;i++){
if(res[i] == 'a' || res[i] == 'e' || res[i] == 'i' || res[i] == 'o' ||res[i] == 'u'){
vowelArr.push(res[i]);
}
else{
otherArr.push(res[i]);
}
}
return otherArr;
}

disemvowel("This website is for losers LOL!");

balakrishnafreecodecampcoder
@balakrishnafreecodecampcoder
Nov 14 2016 02:20
@coymeetsworld i am not getting thou can you help me out .
Coy Sanders
@coymeetsworld
Nov 14 2016 02:20
@jemmamariex3 yeah so you could keep doing those if statements and include capital letters, so you would have 10 conditions
Jemma Tiongson
@jemmamariex3
Nov 14 2016 02:20
@coymeetsworld it works except for 'LOL' since its in uppercase
Moisés Man
@moigithub
Nov 14 2016 02:20
@jemmamariex3 nvm :D
Coy Sanders
@coymeetsworld
Nov 14 2016 02:20
but that is kind of ugly, so regex would be a better way to go
Moisés Man
@moigithub
Nov 14 2016 02:21
str.replace(/aeiou/ig,'') <-- should do
Jemma Tiongson
@jemmamariex3
Nov 14 2016 02:21
@moigithub thanks for trying :)
CamperBot
@camperbot
Nov 14 2016 02:21
jemmamariex3 sends brownie points to @moigithub :sparkles: :thumbsup: :sparkles:
:star2: 2190 | @moigithub |http://www.freecodecamp.com/moigithub
Justin Vernon
@Jvernz
Nov 14 2016 02:21
I'd love to see some people's code for Seek and Destroy.
Jemma Tiongson
@jemmamariex3
Nov 14 2016 02:22
@moigithub thanks! ill try that :)
CamperBot
@camperbot
Nov 14 2016 02:22
jemmamariex3 sends brownie points to @moigithub :sparkles: :thumbsup: :sparkles:
:warning: jemmamariex3 already gave moigithub points
Justin Vernon
@Jvernz
Nov 14 2016 02:22
I know I have the first part correct, but it's the return part that's blowing my mind.
Jemma Tiongson
@jemmamariex3
Nov 14 2016 02:23
@moigithub that didn't work out :(
Coy Sanders
@coymeetsworld
Nov 14 2016 02:23
that should work @jemmamariex3
Moisés Man
@moigithub
Nov 14 2016 02:23
did u added return ?
Jemma Tiongson
@jemmamariex3
Nov 14 2016 02:24
@coymeetsworld @moigithub ill show you what i did. correct me if i used it wrong lol
Moisés Man
@moigithub
Nov 14 2016 02:24
u could also (with ur code ) do
if(res[i].toLowerCase() == 'a' || res[i].toLowerCase() == 'e' ... etc
Jemma Tiongson
@jemmamariex3
Nov 14 2016 02:25

@coymeetsworld

@moigithub

var vowelArr = [];
var otherArr =[];
function disemvowel(str) {
var res = str.replace(/aeiou/ig,'');
for(var i = 0; i<str.length;i++){
if(res[i] == 'a' || res[i] == 'e' || res[i] == 'i' || res[i] == 'o' ||res[i] == 'u'){
vowelArr.push(res[i]);
}
else{
otherArr.push(res[i]);
}
}
return otherArr;
}

disemvowel("This website is for losers LOL!");

codewars is very particular with how it turns out. so 'LOL' needs to stay capitalized but still be able to remove 'O'

Coy Sanders
@coymeetsworld
Nov 14 2016 02:25
so the replace method will remove all the vowels
so you wouldn't need that for loop
Moisés Man
@moigithub
Nov 14 2016 02:26
function disemvowel(str) {
   var res = str.replace(/aeiou/ig,'');
   return res;
}
disemvowel("This website is for losers LOL!");
Jemma Tiongson
@jemmamariex3
Nov 14 2016 02:26
OOOOOOO @coymeetsworld okay now i see what you're saying. Thanks!
CamperBot
@camperbot
Nov 14 2016 02:26
jemmamariex3 sends brownie points to @coymeetsworld :sparkles: :thumbsup: :sparkles:
:star2: 1527 | @coymeetsworld |http://www.freecodecamp.com/coymeetsworld
Coy Sanders
@coymeetsworld
Nov 14 2016 02:26
@moigithub just want to give her everything? :)
np @jemmamariex3 good luck
Moisés Man
@moigithub
Nov 14 2016 02:26
:P
Jemma Tiongson
@jemmamariex3
Nov 14 2016 02:26
@coymeetsworld @moigithub :/ that one didn't work either. it just returned the same string
:'(
Moisés Man
@moigithub
Nov 14 2016 02:27
the code abvove ?
Jemma Tiongson
@jemmamariex3
Nov 14 2016 02:27
yeah :(
Coy Sanders
@coymeetsworld
Nov 14 2016 02:27
take your time with it @jemmamariex3 try to figure out what the regex is doing
Jemma Tiongson
@jemmamariex3
Nov 14 2016 02:27
will do :)
Coy Sanders
@coymeetsworld
Nov 14 2016 02:27
you can use console.log to debug too if you're not aware of it
Juan Angelogianopulos
@angelogianopulos
Nov 14 2016 02:27
Hello guys does somebody mind helping me out with this code?
Moisés Man
@moigithub
Nov 14 2016 02:27
ahh forgot brackets @jemmamariex3
Coy Sanders
@coymeetsworld
Nov 14 2016 02:27
so you can look at the state of strings/arrays/whatever while your code is running
Juan Angelogianopulos
@angelogianopulos
Nov 14 2016 02:27
switch (val){
case 1:
case 2:
case 3:
answer = "low";
break;
case 4:
case 5:
case 6:
answer = "Mid";
break;
case 7:
case 8:
case 9:
answer = "High";
break;
}
Jemma Tiongson
@jemmamariex3
Nov 14 2016 02:28
I'm using repl.it so it spits out the results as i change it :D
Moisés Man
@moigithub
Nov 14 2016 02:28
regex is wrong forgot the brackets
should be /[aeiou]/ instead
brackets on regex mean any of those characters in that list
without mean exactly as that string literal
Juan Angelogianopulos
@angelogianopulos
Nov 14 2016 02:28
it renders properly but the first 3 answers won't check
Alan Barr
@alanmbarr
Nov 14 2016 02:28
need the square brackets in the regex
Justin Vernon
@Jvernz
Nov 14 2016 02:28
function destroyer(arr) {
  // Remove all the values
  var x = 0;
  var ansArr = [];
  for (var i = 1; i<arguments.length;i++) {
    ansArr.push(arguments[i]);
  }

  return arr.filter(function(remove) {
  return ansArr.indexOf(remove) === -1;
  });
}

destroyer([2, 3, 1, 2, 3], 2, 3);
There is 0 chance I would have figured out how to do that last part. I found a solution for it because I couldn't find a way to complete the challenge. I have no idea what the last part of the code means, format wise.
Jemma Tiongson
@jemmamariex3
Nov 14 2016 02:29
@moigithub got it :) thanks
CamperBot
@camperbot
Nov 14 2016 02:29
jemmamariex3 sends brownie points to @moigithub :sparkles: :thumbsup: :sparkles:
:warning: jemmamariex3 already gave moigithub points
Alan Barr
@alanmbarr
Nov 14 2016 02:29
@Jvernz the return return part?
Justin Vernon
@Jvernz
Nov 14 2016 02:30
@alanmbarr correct
Alan Barr
@alanmbarr
Nov 14 2016 02:30
Ok so filter is a function that takes a function as a parameter. basically you say hey filter I want you to say true or false to whatever i give you
in the function you passed in your say indexOf the item remove === -1
so you only get back whatever matches true for that logic
iterate over each item in your array and apply that logic to each item one by one returning a new array with only the items that match and -1 means not found
so you are not returning anything that is found i.e. indexOf returns 0 or greater
Justin Vernon
@Jvernz
Nov 14 2016 02:32
I get the index of part. What I don't get is 1) I never would have known I could return { return }.
2) I dont get what "remove" is inside (function(remove)). Am I creating a new function?
Alan Barr
@alanmbarr
Nov 14 2016 02:33
the top level return is the functions return method sending back an array of whatever
the remove is one item in the array
Justin Vernon
@Jvernz
Nov 14 2016 02:33
I mean, is remove just a name?
like it could say anything
Alan Barr
@alanmbarr
Nov 14 2016 02:34
[1,2,3,4,5].filter(function(item,index,array){
return item > 2;
});
in the filter, map, reduce functions the first item in the function is an item in your array you are iterating on
you can name it whatever
the second is the index of your iteration
the third is the original array you are operating on
Justin Vernon
@Jvernz
Nov 14 2016 02:35
Okay that makes a little more sense. Most solutions I saw said this was 1/5 difficulty, but figuring out that last part would have NEVER happened for me
Moisés Man
@moigithub
Nov 14 2016 02:35
remove its the parameter name of ur inside function
u could create a separated function.. or use a inline function (like ur current code)
also.. ur current code have an anonymous function (no name)
Patrick Lippert
@mayhawstudios
Nov 14 2016 02:36
I'm using Heap's algorithm for the "No Repeats" challenge but the script breaks the tester
Justin Vernon
@Jvernz
Nov 14 2016 02:36
@alanmbarr @moigithub Thanks for the help btw
CamperBot
@camperbot
Nov 14 2016 02:36
jvernz sends brownie points to @alanmbarr and @moigithub :sparkles: :thumbsup: :sparkles:
:cookie: 303 | @alanmbarr |http://www.freecodecamp.com/alanmbarr
:warning: jvernz already gave moigithub points
Justin Vernon
@Jvernz
Nov 14 2016 02:36
@moigithub What do you mean anonymouns function?
Moisés Man
@moigithub
Nov 14 2016 02:36
cuz it doesnt have a name :P
Patrick Lippert
@mayhawstudios
Nov 14 2016 02:37
I figured out why it was broken from the last time I used it and the algorithm works in codepen, but breaks in FCC
Justin Vernon
@Jvernz
Nov 14 2016 02:37
Oh I see what you're saying, remove is a parameter not a name
Moisés Man
@moigithub
Nov 14 2016 02:37
yep yep
Alan Barr
@alanmbarr
Nov 14 2016 02:37
function bigNums(){} vs [1,2,3,4,5].filter(function(e,i,a){return e});
bigNums is named function
vs i just through in an unnamed function in my filter
also called a lambda in other languages
Justin Vernon
@Jvernz
Nov 14 2016 02:37
I see
So in the example you just gave (function(e,i,a,){return e});
what would that do
Alan Barr
@alanmbarr
Nov 14 2016 02:38
returns true for each element in the array
so you get the same array back
Justin Vernon
@Jvernz
Nov 14 2016 02:39
Man this stuff is way over my head. Makes me feel dumb lol
Alan Barr
@alanmbarr
Nov 14 2016 02:39
it's a concept called functional programming its a bit weird at first but saves some pain
Justin Vernon
@Jvernz
Nov 14 2016 02:39
Thanks a bunch for your help. You guys are great. Even if I don't completely understand, I understand more now than I did before. @alanmbarr @moigithub
CamperBot
@camperbot
Nov 14 2016 02:39
jvernz sends brownie points to @alanmbarr and @moigithub :sparkles: :thumbsup: :sparkles:
:warning: jvernz already gave alanmbarr points
:warning: jvernz already gave moigithub points
Alan Barr
@alanmbarr
Nov 14 2016 02:40
because you can do normal for loops fine but when you are mutating data you can cause side effects
which causes bugs in code
if you do things in a functional manner its easy to reason about you send things in and you get new things out
Justin Vernon
@Jvernz
Nov 14 2016 02:41
That makes sense. It'll be a while til I have a practical understanding of it though
Alan Barr
@alanmbarr
Nov 14 2016 02:42
use map when you want to transform an array in some manner and get the same amount of elements back, filter to remove certain elements, reduce to turn all elements into one thing and .forEach for iterating similar to the regular for loop
Justin Vernon
@Jvernz
Nov 14 2016 02:43
@alanmbarr Simple explanation, I'm taking notes!
Alan Barr
@alanmbarr
Nov 14 2016 02:43
be sure to use a javascript REPL it makes it way easy to experiment with this stuff
Justin Vernon
@Jvernz
Nov 14 2016 02:45
@alanmbarr I will. going to go home and work on this stuff there. Thanks for the help so far!
CamperBot
@camperbot
Nov 14 2016 02:45
jvernz sends brownie points to @alanmbarr :sparkles: :thumbsup: :sparkles:
:warning: jvernz already gave alanmbarr points
David Santana
@Davidjrsantana
Nov 14 2016 02:45

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

a = a + 1;
b = b + 5;
c = c + " String!"; saying i should not contain undefined and should have a value of i am a string

hi help me ~
Ogundele Olumide
@Lumexralph
Nov 14 2016 02:49
@Davidjrsantana i don't understand your question?
Alan Barr
@alanmbarr
Nov 14 2016 02:49
David is the casing exactly the same?
also undefined means that no value was set for a variable
David Santana
@Davidjrsantana
Nov 14 2016 02:50
@alanmbarr i'll check on the casing right now
Ogundele Olumide
@Lumexralph
Nov 14 2016 02:50
@Davidjrsantana maybe you should take a close look at the "S" starting the "String" is it to be in upper or lowewrcase?
@Davidjrsantana cos your code seems pretty fine to me
David Santana
@Davidjrsantana
Nov 14 2016 02:51
@alanmbarr wow it was the i thatneeded to be capitalize , thanks bruv
CamperBot
@camperbot
Nov 14 2016 02:51
davidjrsantana sends brownie points to @alanmbarr :sparkles: :thumbsup: :sparkles:
:cookie: 304 | @alanmbarr |http://www.freecodecamp.com/alanmbarr
Ogundele Olumide
@Lumexralph
Nov 14 2016 02:51
@eyeA can you paste the code here?
Alan Barr
@alanmbarr
Nov 14 2016 02:51
yeah i hate that stuff drives one batty
David Santana
@Davidjrsantana
Nov 14 2016 02:51
@Lumexralph i was not capitalize lol
Ogundele Olumide
@Lumexralph
Nov 14 2016 02:52
@alanmbarr :smile:
Ryan Copeland
@ryan6627
Nov 14 2016 02:53
does anyone know what the hell Record Collection is asking? I feel like I could write the code, but when I look at all the google solutions, it seems like the order of what they tell you they want and the order in which they wrote the code are in the wrong places
Alan Barr
@alanmbarr
Nov 14 2016 02:53
i've rewritten many programs over minor bugs like that. debugging strategies come in handy very quickly
Ogundele Olumide
@Lumexralph
Nov 14 2016 02:54
@ryan6627 :smile:
@ryan6627 how about you write what you're to do
Ryan Copeland
@ryan6627
Nov 14 2016 02:54
@Lumexralph I could really do without the sarcasm
I'm saying the order in which they tell you to do something doesn't seem right with the solutions I"m looking at
Ogundele Olumide
@Lumexralph
Nov 14 2016 02:55
@ryan6627 didn't mean it that way, sorry
@ryan6627 it doesn't have to be that way, there are many ways to solve a problem in programming
Ryan Copeland
@ryan6627
Nov 14 2016 02:57
even so some of it still doesn't look right. for example
"If prop isn't "tracks" and value isn't empty (""), update or set the value for that record album's property."
I would've done
if (prop !== "tracks && value !== "") { , but this website starts with something else https://www.snip2code.com/Snippet/961150/FreeCode-Camp-record-collection-checkpoi/
eyeseau
@eyea
Nov 14 2016 03:00
@Lumexralph thanks~ I'm trying to solve this problem now~
CamperBot
@camperbot
Nov 14 2016 03:00
eyea sends brownie points to @lumexralph :sparkles: :thumbsup: :sparkles:
:cookie: 436 | @lumexralph |http://www.freecodecamp.com/lumexralph
Ogundele Olumide
@Lumexralph
Nov 14 2016 03:02
@ryan6627 it doesn't matter the major thing is if you understand what they did in the code
if(value !== ""){ collection[id][prop]= value; } remember that this first line is also part of what you're to look for in the challenge
@eyeA i couldn't read most of what are i saw in your link, mostly chinese
pycraft
@pycraft
Nov 14 2016 03:06

//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
var result;

for (i = 0; i < 4; i++){
  if (contacts[i].firstName == firstName){
    if(contacts[i][prop]){
      result = contacts[i][prop];
    }else {
      result = "No such property";
    }
  }else {
    result = "No such contact";
  }
} return result;
// Only change code above this line
}

// Change these values to test your function
lookUpProfile("Sherlock", "likes");
can somebody help me with this?
Ellen
@sunsplat
Nov 14 2016 03:07
What is contacts?
oh nevermind i see, you defined it outside of the function
Ogundele Olumide
@Lumexralph
Nov 14 2016 03:08
@eyeA you have to return count + the string i.e count + " bet" not 5 + bet
@eyeA using a switch statement will make your challenge easier to solve
@pycraft your for loop
eyeseau
@eyea
Nov 14 2016 03:12
@Lumexralph yeah I'm trying ~
pycraft
@pycraft
Nov 14 2016 03:12
@Lumexralph what about my for loop?
Ogundele Olumide
@Lumexralph
Nov 14 2016 03:13
@pycraft you should compare i with the length of contacts, rememeber it's an array of objects
Eric K
@EricK425
Nov 14 2016 03:13
can someone help me with Profile Lookup challenge ?
Ryan Copeland
@ryan6627
Nov 14 2016 03:13
if(value !== ""){ collection[id][prop]= value; } remember that this first line is also part of what you're to look for in the challenge I understand what all the codes mean, but it looks completely scattered to me
as if they picked random bits of instruction and put it in there randomly
Eric K
@EricK425
Nov 14 2016 03:14

//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];
  }
  if (contacts[i].firstName!=firstName) {
    return "No such contact";
  }
  if (contacts[i].hasOwnProperty(prop)===false) {
    return "No such property";
  }
  }

// Only change code above this line
}

// Change these values to test your function
lookUpProfile("Sherlock", "likes");
pycraft
@pycraft
Nov 14 2016 03:14
@Lumexralph yup i changed it to i <contacts.length but that didnt solve my problem :(
Eric K
@EricK425
Nov 14 2016 03:14
here is my code.. when I have the 3 if statements only the bototm 2 conditions are satisfied.. when i have only the top if statement the top 3 conditions are satisfied
Ogundele Olumide
@Lumexralph
Nov 14 2016 03:18
@pycraft
if(contacts[i][prop]){
      result = contacts[i][prop];
    } //what should this place be doing?
Eric K
@EricK425
Nov 14 2016 03:18
@pycraft thats not a valid if statement.. its just indexing the object
Steve
@marioecg
Nov 14 2016 03:20

Hi, any insight in why my code does not work? It's for the findLongestWord bonfire"

function findLongestWord(str) {

newStr = str.split(" ");

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

    longestLength = 0;

    if (newStr[i].length > longestLength) {

        longestLength = newStr[i].length;

    }

}

return longestLength;
}

findLongestWord("The quick brown fox jumped over the lazy dog");

pycraft
@pycraft
Nov 14 2016 03:20
i assume that if statement returns true if there is the property at i object
Ogundele Olumide
@Lumexralph
Nov 14 2016 03:21
@pycraft you should be checking that against a value of that property but you only checked the value and the statement seems not to pass it,
Eric K
@EricK425
Nov 14 2016 03:21
@marioecg maybe may longestlength a var
Steve
@marioecg
Nov 14 2016 03:22
@EricK425 still nothing haha, console gives me #3 for longest string instead of 5.. :(
Ogundele Olumide
@Lumexralph
Nov 14 2016 03:22
@pycraft there's a method called myObject.hasOwnProperty(prop), which checks if a property exists in an object and returns a boolean
Eric K
@EricK425
Nov 14 2016 03:23
@Lumexralph do you mind looking at my code and seeing why it wont compare all my if statements.. it seems to skip the first one unless I take away the last 2 if statements then itll enter the first one
Steve
@marioecg
Nov 14 2016 03:23
@eir
@EricK425 got it! I put out the longestLenght variable outside the loop. Thanks
CamperBot
@camperbot
Nov 14 2016 03:23
marioecg sends brownie points to @erick425 :sparkles: :thumbsup: :sparkles:
Ogundele Olumide
@Lumexralph
Nov 14 2016 03:24
use that to check if a property exist so in this case if(contacts[i].hasOwnProperty(prop){ result = contacts[i][prop]; } @pycraft
CamperBot
@camperbot
Nov 14 2016 03:24
:cookie: 218 | @erick425 |http://www.freecodecamp.com/erick425
Ogundele Olumide
@Lumexralph
Nov 14 2016 03:24
@EricK425 taking a look now
Eric K
@EricK425
Nov 14 2016 03:24
@marioecg awesome
Jeff Shapiro
@Jeff-Shapiro
Nov 14 2016 03:25
@marioecg where's newStr declared?
Eric K
@EricK425
Nov 14 2016 03:27
I turned off my notifications and im still getting popups every second
Ogundele Olumide
@Lumexralph
Nov 14 2016 03:32
@EricK425 using return in a function exists the function
@EricK425 when the loop starts, the first condition it gets is the second if statement, it returns the value and exits the function that's why it's behaving that way
Eric K
@EricK425
Nov 14 2016 03:33
@Lumexralph that shouldnt matter though, plus it tells you to return.. the problem i have is when I delete or comment out the last two if statments, the first three conditions are satisfied for the challenge
@Lumexralph otherwise the last two confitions are satisfied
@Lumexralph its basically not entering the first if statement unless its the only one there, i dont think the return is effecting that
brenthildebrand
@brenthildebrand
Nov 14 2016 03:36

Hello, I was wondering if i could get some help with the Exact Change challenge. My solution works for all but one of the given examples. For some reason, for the one it fails it does so because it produces this weird long decimal(.00999999) when I believe it should be .01, which would trigger the last run through my while loop; I'm not sure why I get the decimal when I'm not doing any division or anything. Anyways the challenge is:

Design a cash register drawer function checkCashRegister() that accepts purchase price as the first argument (price), payment as the second argument (cash), and cash-in-drawer (cid) as the third argument. cid is a 2D array listing available currency. Return the string "Insufficient Funds" if cash-in-drawer is less than the change due. Return the string "Closed" if cash-in-drawer is equal to the change due. Otherwise, return change in coin and bills, sorted in highest to lowest order.

and my code with the example that fails by a penny is:

function checkCashRegister(price, cash, cid) {
  var change = [];
  var changeDue = cash - price;
  var totalCid = 0;

  var currencyType = [0.01, 0.05, 0.10, 0.25, 1, 5.0, 10.0, 20.0, 100.0];

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

  function returnTheCash(){

    for(var j = cid.length - 1; j >= 0; j--){
      if(changeDue === 0){
        return change;
      } else if(changeDue >= currencyType[j] && cid[j][1] > 0){

          var currentVal = [cid[j][0], currencyType[j]];

          changeDue -= currencyType[j];
          cid[j][1] -= currencyType[j];

          while(changeDue >= currencyType[j] && cid[j][1] > 0){
              currentVal[1] += currencyType[j];

              changeDue -= currencyType[j];
              cid[j][1] -= currencyType[j];
          }

        change.push(currentVal);

      }
    }

  }

    if(totalCid < changeDue){
    return "Insufficient Funds";
  } else if (totalCid === changeDue){
    return "Closed";
  } else {
    returnTheCash();
         if(changeDue >= 0.01){
           return "Insufficient Funds";
          }
  }

  return changeDue;
}


checkCashRegister(3.26, 100.00, [["PENNY", 1.01], ["NICKEL", 2.05], ["DIME", 3.10], ["QUARTER", 4.25], ["ONE", 90.00], ["FIVE", 55.00], ["TEN", 20.00], ["TWENTY", 60.00], ["ONE HUNDRED", 100.00]]);
Ogundele Olumide
@Lumexralph
Nov 14 2016 03:38
@EricK425 your loop iterates through everything in contacts, Sherlock is not the first objects in your contacts array, when the loop checks, the first true condition on index 0 is when the firstName != firstname...
{
        "firstName": "Akira",
        "lastName": "Laine",
        "number": "0543236543",
        "likes": ["Pizza", "Coding", "Brownie Points"]
    },   //this is the first element of the iteration and Akira is not equal to Sherlocks, it returns No such contact and exits and it ignores the first if statement because Sherlocks is not equal to Akira
Jeff Greenlee
@JeffGreenlee42
Nov 14 2016 03:40
Hey, is there way to use a debugger when running these FreeCodeCamp challenges?
James Alton
@TwoKind
Nov 14 2016 03:41

// Setup
var a;
var b = 2;

// Only change code below this line

a = b + 5;
b = a;

Someone able to explain that?
How did b not become 2 again?
Eric K
@EricK425
Nov 14 2016 03:41
@Lumexralph I changed the inputs and it still acts the same way, I changed it where the firstname is the first index in contacts and it still wont execute the first if statement
Diego Mayer
@Chrono79
Nov 14 2016 03:42
@TwoKind a is 7 (b + 5 is 2 + 5), why would b become 2?
James Alton
@TwoKind
Nov 14 2016 03:42
because var b =2?
nvm I overthinking it
Diego Mayer
@Chrono79
Nov 14 2016 03:43
@TwoKind you overwrote its value when you did b = a
James Alton
@TwoKind
Nov 14 2016 03:43
Just does not seem right.
Is overwriting good. Or is their a more efficient way?
Dont want to get into bad habbits
Diego Mayer
@Chrono79
Nov 14 2016 03:43
vars are meant to change their value
James Alton
@TwoKind
Nov 14 2016 03:45
so if I do a =7 and b = a. Then that over wrtites the vars
Diego Mayer
@Chrono79
Nov 14 2016 03:45
@TwoKind yes
James Alton
@TwoKind
Nov 14 2016 03:45
Ok thanks diego
Diego Mayer
@Chrono79
Nov 14 2016 03:45
no problem
Jeff Greenlee
@JeffGreenlee42
Nov 14 2016 03:45
Does anyone here use Atom?
Eric K
@EricK425
Nov 14 2016 03:47
@Lumexralph Do you see waht I mean?
Ogundele Olumide
@Lumexralph
Nov 14 2016 03:48
@EricK425 yeah, looking at it again
drammeh
@drammeh
Nov 14 2016 03:49
Convert Celsius to Fahrenheit
Any help
Tony Miri
@TonyMiri
Nov 14 2016 03:52
@brenthildebrand I'm working on that one right now too. It looks like javascript handles fractional numbers in a strange way because binary doesn't represent decimals accurately. So there are workarounds out there. http://stackoverflow.com/questions/11832914/round-to-at-most-2-decimal-places-in-javascript
drammeh
@drammeh
Nov 14 2016 03:52

function convertToF(celsius) {
var fahrenheit;
// Only change code below this line

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

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

Ogundele Olumide
@Lumexralph
Nov 14 2016 03:53
@EricK425
if (contacts[i]["firstName"] == firstName || contacts[i]["lastName"] == firstName) {
       if( contacts[i].hasOwnProperty(prop)) {
           return contacts[i][prop];          //return the value of that property
       }
       else {                                //to return No such property
           return "No such property";
       }
   }
@EricK425 the logic of the if statements seems to not work so I rearranged it a bit
Jeff Greenlee
@JeffGreenlee42
Nov 14 2016 03:55
Can anyone suggest the best way to run js through a debugger?
brenthildebrand
@brenthildebrand
Nov 14 2016 03:56
@FatTone225 interesting, but annoying. Thanks I will look into it.
CamperBot
@camperbot
Nov 14 2016 03:56
brenthildebrand sends brownie points to @fattone225 :sparkles: :thumbsup: :sparkles:
:cookie: 391 | @fattone225 |http://www.freecodecamp.com/fattone225
Ogundele Olumide
@Lumexralph
Nov 14 2016 03:56
@EricK425 hope it gets you what you want
Eric K
@EricK425
Nov 14 2016 03:56
@Lumexralph is it a bug in the website? shouldnt the if statements all run wehn their called
@Lumexralph thanks for your help big time
CamperBot
@camperbot
Nov 14 2016 03:56
erick425 sends brownie points to @lumexralph :sparkles: :thumbsup: :sparkles:
:cookie: 437 | @lumexralph |http://www.freecodecamp.com/lumexralph
Ogundele Olumide
@Lumexralph
Nov 14 2016 03:57
@EricK425 it's not a bug, try analysing your if statements in the loop and you'll see you got the logic a bit wrong
Eric K
@EricK425
Nov 14 2016 03:57
@Lumexralph ok
Ogundele Olumide
@Lumexralph
Nov 14 2016 03:57
@EricK425 glad I could help
Daniel Ip
@iptohip777
Nov 14 2016 03:58
Hello World! I'm Daniel. I heard about Free Code Camp from a couple of friends. I'm currently a hs student beginning JavaScript as a hobby so I can work toward an internship in the near future.
CamperBot
@camperbot
Nov 14 2016 03:58

welcome to FreeCodeCamp @iptohip777!

Jeff Greenlee
@JeffGreenlee42
Nov 14 2016 03:58
hmmm... ok.. I gather no one uses debuggers...
fine... I've got some code here.. what am I missing? or doing wrong?
Ogundele Olumide
@Lumexralph
Nov 14 2016 03:59
@drammeh what's the challenge? you're to use the formula of converting celsius to fahrenheit, apply that to your code . assign the answer to fahreneheit and return it
@iptohip777 hey, welcome
Jeff Greenlee
@JeffGreenlee42
Nov 14 2016 04:00
function updateRecords(id, prop, value) {
  if(prop == "tracks") {
    if (! (collection[id].hasOwnProperty("tracks"))) {
      collection[id].tracks = [""];
      collection[id].tracks.push(value);
    }  else {
      collection[id].tracks.push();
    }
  } else if (value === "") {
    delete collection[prop];
  } else {
    collection[id][prop] = value;
  }

  return collection;
}
```
Ryan Copeland
@ryan6627
Nov 14 2016 04:01
how are you guys cropping out code like that @JeffGreenlee42 ?
Jeff Greenlee
@JeffGreenlee42
Nov 14 2016 04:02
@ryan6627 Are you using Git? You sdhould see a couple of little icons on the right of your message window.
they describe keycommands for messageing..
Basically you type 3 backtics "```" then do a control or command shift enter
then 3 more back tics.. and then return back to messaging mode..
Ryan Copeland
@ryan6627
Nov 14 2016 04:04
the app?
Jeff Greenlee
@JeffGreenlee42
Nov 14 2016 04:04
Jeff Greenlee
@JeffGreenlee42
Nov 14 2016 04:06
@toianw ok.. I was hoping Atom would have one.. but the only good one is for node.js.. and I apparently do not have node installed.
Ryan Copeland
@ryan6627
Nov 14 2016 04:06
IDK what icons you're talking about. I see a chatbox icon above an M with a downward arrow next to the words I'm typing but no other special buttons
Ogundele Olumide
@Lumexralph
Nov 14 2016 04:07

@JeffGreenlee42

if (! (collection[id].hasOwnProperty("tracks"))) {
      collection[id].tracks = [""];  //do you mean to say an empty array? [ ] should be fine
      collection[id].tracks.push(value);

though I don't know the issue you're experiencing

Jeff Greenlee
@JeffGreenlee42
Nov 14 2016 04:07
@ryan6627 its the one labled "var code = "formatted".
@Lumexralph yeah .. I put the quotes in there because I thought maybe it had a problem with the empty brackets.. but I gather that is not the problem.
Ogundele Olumide
@Lumexralph
Nov 14 2016 04:08
@JeffGreenlee42 okay
so what's the problem?
Ryan Copeland
@ryan6627
Nov 14 2016 04:09
why is the "if(collection[id][prop])" making the code work? I don't understand the point in it. Isn't it basically saying "if the collection prop is true", do this? http://imgur.com/a/dyTMg
Jeff Greenlee
@JeffGreenlee42
Nov 14 2016 04:10
@Lumexralph the Challenge gives me some errors: "After updateRecords(2548, "artist", ""), artist should not be set" and I haven't figured out what is wrong with my code.
Ian
@toianw
Nov 14 2016 04:14
@JeffGreenlee42 This line is not quite right: delete collection[prop];
Ryan Copeland
@ryan6627
Nov 14 2016 04:15
are people being paid by FCC in this chat?
Jeff Greenlee
@JeffGreenlee42
Nov 14 2016 04:15
@toianw didn't we just finish a challenge teaching use that this is how to delete an object property?
Paid? .. paid? ha ha! that's good!
Ian
@toianw
Nov 14 2016 04:16
@JeffGreenlee42 you're not referencing the id
Ryan Copeland
@ryan6627
Nov 14 2016 04:16
i can tell lol
this is getting annoying
Jeff Greenlee
@JeffGreenlee42
Nov 14 2016 04:18
@toianw Thanks! Ah! Ok.. that's it.. Ok.. fixed that error! Now for the next! :)
CamperBot
@camperbot
Nov 14 2016 04:18
jeffgreenlee42 sends brownie points to @toianw :sparkles: :thumbsup: :sparkles:
:cookie: 419 | @toianw |http://www.freecodecamp.com/toianw
Ian
@toianw
Nov 14 2016 04:20
@ryan6627 it's saying if it is truthy. Any array is truthy
https://developer.mozilla.org/en-US/docs/Glossary/Truthy
OneRandomJamie
@OneRandomJamie
Nov 14 2016 04:27
Could someone help me with the Stand in Line ? For some reason
I can't even figure out the directions.
Conor Murphy
@cmurphy580
Nov 14 2016 04:29
Can anyone help me with the background when i do a search? Dang thing wont contain the search results. https://codepen.io/cmurphy580/pen/gLaamJ
Christopher Susi
@chrisandsuch
Nov 14 2016 04:31
Hey all, I seem to be stuck with getting this to pass: var myStr = "FirstLine\n\SecondLine\rThirdLine"; // any suggestions?
Ogundele Olumide
@Lumexralph
Nov 14 2016 04:31
@OneRandomJamie write out the instructions
@chrisandsuch what's the slash after \n for ? \n\
OneRandomJamie
@OneRandomJamie
Nov 14 2016 04:33

@Lumexralph In Computer Science a queue is an abstract Data Structure where items are kept in order. New items can be added at the back of the queue and old items are taken off from the front of the queue.

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.

Christopher Susi
@chrisandsuch
Nov 14 2016 04:33
FirstLine
\SecondLine\
ThirdLine
Jeff Greenlee
@JeffGreenlee42
Nov 14 2016 04:34
@toianw Thanks again! I had to change the order of my If statements.. but I passed! :)
CamperBot
@camperbot
Nov 14 2016 04:34
jeffgreenlee42 sends brownie points to @toianw :sparkles: :thumbsup: :sparkles:
:warning: jeffgreenlee42 already gave toianw points
Ogundele Olumide
@Lumexralph
Nov 14 2016 04:35
@chrisandsuch use \...to escape \
@chrisandsuch \\ double of it before SecondLine and after
Tony
@amarion20
Nov 14 2016 04:37
@OneRandomJamie I'm stuck in this one too
Greg Duncan
@GregatGit
Nov 14 2016 04:37
@cmurphy580 you have mess up your for loop (var i = 0; i < data[i].length; i++) you can't write data[i]
Christopher Susi
@chrisandsuch
Nov 14 2016 04:37
var myStr = "FirstLine\n\SecondLine\r\ThirdLine";
Ogundele Olumide
@Lumexralph
Nov 14 2016 04:38
@OneRandomJamie you should add item from the arguments passed to your arr, using arr.push(item), that will put items at the end of array
Christopher Susi
@chrisandsuch
Nov 14 2016 04:38
var myStr = "FirstLine\n \ SecondLine \rThirdLine"; // Change this line
Ogundele Olumide
@Lumexralph
Nov 14 2016 04:39
@OneRandomJamie after that remove the first element in the array, that can be done using shift() method of array, store it in a variable, which is the first element removed, then return it
Ed
@edyiot
Nov 14 2016 04:40
stuck at Word Blanks, can anyone point me in the right direction, please ? Don't know how to start the code

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

// Your code above this line
return result;
}

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

Ogundele Olumide
@Lumexralph
Nov 14 2016 04:41
@chrisandsuch did you get it?
@edyiot do you know how to concactenate strings?
Tony
@amarion20
Nov 14 2016 04:41
@Lumexralph I'm also stuck in the same one as @OneRandomJamie
this is what I have so far

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

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

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

Ogundele Olumide
@Lumexralph
Nov 14 2016 04:42
i.e joining strings together? @edyiot
Merryl
@MerrylArok
Nov 14 2016 04:42
Hello!Im trying to understand what "use strict"; and how does it help improve my performance?
Christopher Susi
@chrisandsuch
Nov 14 2016 04:43
@Lumexralph Yeah, thank you so much for the help with it
CamperBot
@camperbot
Nov 14 2016 04:43
chrisandsuch sends brownie points to @lumexralph :sparkles: :thumbsup: :sparkles:
Ogundele Olumide
@Lumexralph
Nov 14 2016 04:43
@amarion20 you should push item to arr not 6
CamperBot
@camperbot
Nov 14 2016 04:43
:cookie: 438 | @lumexralph |http://www.freecodecamp.com/lumexralph
Conor Murphy
@cmurphy580
Nov 14 2016 04:43
@GregatGit what's wrong with that? doesn't that call the particular string in the array
Ed
@edyiot
Nov 14 2016 04:43
@Lumexralph dayum, thanks!
CamperBot
@camperbot
Nov 14 2016 04:43
edyiot sends brownie points to @lumexralph :sparkles: :thumbsup: :sparkles:
:cookie: 439 | @lumexralph |http://www.freecodecamp.com/lumexralph
Tony
@amarion20
Nov 14 2016 04:44
thanks @Lumexralph
CamperBot
@camperbot
Nov 14 2016 04:44
amarion20 sends brownie points to @lumexralph :sparkles: :thumbsup: :sparkles:
:cookie: 440 | @lumexralph |http://www.freecodecamp.com/lumexralph
Vidhi patel
@VidhiPatel5151
Nov 14 2016 04:44
any help me out
Greg Duncan
@GregatGit
Nov 14 2016 04:44
@cmurphy580 you can't use the i just there
Ogundele Olumide
@Lumexralph
Nov 14 2016 04:44
@MerrylArok use strict to me, helps in getting your code do exactly what you want it to do and giving you accurate results
Greg Duncan
@GregatGit
Nov 14 2016 04:45
@cmurphy580 it hasn't been initialised yet
Vidhi patel
@VidhiPatel5151
Nov 14 2016 04:45
hey any one no how to work fancybox image gallery i have create that phot gallery using the fancybox but popupin image show but close icon not display
$(document).ready(function () {
        $("#single_1").fancybox({
            helpers: {
                title: {
                    type: 'float'
                }
            }
        });

        $("#single_2").fancybox({
            openEffect: 'elastic',
            closeEffect: 'elastic',

            helpers: {
                title: {
                    type: 'inside'
                }
            }
        });

        $("#single_3").fancybox({
            openEffect: 'none',
            closeEffect: 'none',
            helpers: {
                title: {
                    type: 'outside'
                }
            }
        });

        $("#single_4").fancybox({
            helpers: {
                title: {
                    type: 'over'
                }
            }
        });
        $("#single_5").fancybox({
            helpers: {
                title: {
                    type: 'float'
                }
            }
        });
Greg Duncan
@GregatGit
Nov 14 2016 04:45
@cmurphy580 I think what should be there is data[1].length
Merryl
@MerrylArok
Nov 14 2016 04:46
@Lumexralph see this is what the docs tell me too, but im failing to understand what it means. I mean i wrote my code to perform what i need it to do right? How is this going to improve my code
Vidhi patel
@VidhiPatel5151
Nov 14 2016 04:46
blob
OneRandomJamie
@OneRandomJamie
Nov 14 2016 04:47

@Lumexralph function nextInLine(arr, item) {
arr.push(arr)

return item =arr.shift();
}

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

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

Merryl
@MerrylArok
Nov 14 2016 04:47
@Lumexralph is there any reading material that breaks down use strict so somone like me can actually understand what it means
Ogundele Olumide
@Lumexralph
Nov 14 2016 04:47
@OneRandomJamie push item to arr
OneRandomJamie
@OneRandomJamie
Nov 14 2016 04:48
@Lumexralph arr.push(arr)
Ed
@edyiot
Nov 14 2016 04:50
I lied, I didn't get it
Thought I got it
Ogundele Olumide
@Lumexralph
Nov 14 2016 04:50
@MerrylArok i think it comes down to preference but what happens in strict mode during code execution is slightly different from default mode
@OneRandomJamie arr.push(item)
@MerrylArok this might interest you and help understand http://ejohn.org/blog/ecmascript-5-strict-mode-json-and-more/
OneRandomJamie
@OneRandomJamie
Nov 14 2016 04:51
@Lumexralph Thank you
CamperBot
@camperbot
Nov 14 2016 04:51
onerandomjamie sends brownie points to @lumexralph :sparkles: :thumbsup: :sparkles:
:cookie: 441 | @lumexralph |http://www.freecodecamp.com/lumexralph
Ogundele Olumide
@Lumexralph
Nov 14 2016 04:51
@edyiot :smile: , i don't understand
Ed
@edyiot
Nov 14 2016 04:52
wordBlanks("dog", "big", "ran", "quickly") should contain all of the passed in words separated by non-word characters (and any additional words in your madlib).
I added them together with concat() but I don't get what I'm supposed to do after
Merryl
@MerrylArok
Nov 14 2016 04:57
@Lumexralph thanks that article definitely cleared things up. Is it advisable to use strict every piece of code to get "cleaner bug free" code? Or should i just limit it to certain functions? Whats the general consensus?
CamperBot
@camperbot
Nov 14 2016 04:57
merrylarok sends brownie points to @lumexralph :sparkles: :thumbsup: :sparkles:
:cookie: 442 | @lumexralph |http://www.freecodecamp.com/lumexralph
Ogundele Olumide
@Lumexralph
Nov 14 2016 04:57
@edyiot why don't you join them with space or a non word character, you concatenated all the arguments, right? why don't you use arguments.join(" ") or non word character
@MerrylArok i totally support strict-mode, it's cranky but it pays, for me
Conor Murphy
@cmurphy580
Nov 14 2016 04:59
@GregatGit alright i'll give it a try. thanks for the tip
CamperBot
@camperbot
Nov 14 2016 04:59
:cookie: 784 | @gregatgit |http://www.freecodecamp.com/gregatgit
cmurphy580 sends brownie points to @gregatgit :sparkles: :thumbsup: :sparkles:
Ed
@edyiot
Nov 14 2016 05:25
@Lumexralph finally got it, I got confused with +variable+
result += "My "+myAdjective+" "+myNoun+" "+myVerb+" really "+myAdverb+"";
forgot to add them and couldn't understand why it wasn't working. thanks!
c0d0er
@c0d0er
Nov 14 2016 05:26
@walidashri thanks
CamperBot
@camperbot
Nov 14 2016 05:26
c0d0er sends brownie points to @walidashri :sparkles: :thumbsup: :sparkles:
:cookie: 637 | @walidashri |http://www.freecodecamp.com/walidashri
Abhishek Kumar
@Mr-Kumar-Abhishek
Nov 14 2016 05:28
uhm... could someone suggest me how should i approach this challenge "Validate US Telephone Numbers" should I use this too ?? https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/String/match ?
Merryl
@MerrylArok
Nov 14 2016 05:39
am i missing something?
```
function palindrome(str) {
  // Good luck!
  var cleanStr=str.replace(/[^\da-zA-Z]+/g, "").toLowerCase();  
  var reverseStr= function(cleanStr){    
    for(var i=cleanStr.length-1,rev=""; i>=0;i--){
    rev+=cleanStr.charAt(i);}  
  return rev;};

  if(cleanStr===reverseStr){return true;}else{return false;}
}

palindrome("eye");
Jack Of All Trades International.
@JOATI
Nov 14 2016 05:50
WHat the hell did I miss with in my JS ..??:O :( it says a Semicolon but I can't figur out wher it said i missed 2 : http://codepen.io/JOATI/pen/PNOZzV
Walid Ashri
@walidashri
Nov 14 2016 05:58
@JOATI this is not valid coffee syntax
Jack Of All Trades International.
@JOATI
Nov 14 2016 05:59
thanks what syntax would I need to use then ..:O
Justin Vernon
@Jvernz
Nov 14 2016 06:11

function getIndexToIns(arr, num) {
  // Find my place in this sorted array.
  for (var i = 0;i<arr.length;i++) {
    if (num < arr[i]) {
      arr.splice(i, 0, num);

    }
  }
  return num;
}

getIndexToIns([40, 60], 50);
I feel like my code should be working for "Where do I belong" But I'm getting an infinite loop error
Nevermind I figured it out
Justin Vernon
@Jvernz
Nov 14 2016 06:22
Does sort have to be used on a function?
__mifflin__
@cdrainxv
Nov 14 2016 06:31
It would be recommended for cases like this:
getIndexToIns([80, 40, 60, 12], 50);
@Jvernz
Justin Vernon
@Jvernz
Nov 14 2016 06:31
@cdrainxv Yeah I found out how to use it. I just can't get the last checkbox now
getIndexToIns([2, 5, 10], 15) should return 3
function getIndexToIns(arr, num) {
  // Find my place in this sorted array.
  arr = arr.sort(function(a, b) {
    return a - b;});
  for (var i = 0;i<arr.length;i++) {
    if (num < arr[i]) {
      arr.splice(i, 0, num);
      return arr.indexOf(num);
    }
  }

     if (num < arr[arr.length-1]) {
      return arr.push(num).indexOf(num);
     }


}






getIndexToIns([2, 5, 10], 15);
nevermind figured out why
function getIndexToIns(arr, num) {
  // Find my place in this sorted array.
  arr = arr.sort(function(a, b) {
    return a - b;});
  for (var i = 0;i<arr.length;i++) {
    if (num < arr[i]) {
      arr.splice(i, 0, num);
      return arr.indexOf(num);
    }
  }

     if (num > arr[arr.length-1]) {
      return arr.push(num)-1;
     }

}

getIndexToIns([2, 5, 10], 15);
is my last return line cheating or is that good?
Markus Kiili
@Masd925
Nov 14 2016 06:36
@Jvernz The solution is much easier if you first push num into arr and then sort.
There is also a clever way to solve it without sorting at all.
Justin Vernon
@Jvernz
Nov 14 2016 06:36
@Masd925 I thought about doing that
If I reset my code, will my solution disappear?
__mifflin__
@cdrainxv
Nov 14 2016 06:37
@Jvernz: There’s no such thing as cheating… if it works and will continue to work… then great! :smile:. As you get better you maybe you can test it for performance… but not required.
Justin Vernon
@Jvernz
Nov 14 2016 06:37
@cdrainxv Thanks =)
CamperBot
@camperbot
Nov 14 2016 06:37
jvernz sends brownie points to @cdrainxv :sparkles: :thumbsup: :sparkles:
:cookie: 915 | @cdrainxv |http://www.freecodecamp.com/cdrainxv
__mifflin__
@cdrainxv
Nov 14 2016 06:38
@Jvernz: Just comment it out and add solution 2.
Walid Ashri
@walidashri
Nov 14 2016 06:38
@cdrainxv صاشف غخع اشرث يخىث هس ؤاثشف
Justin Vernon
@Jvernz
Nov 14 2016 06:38
@cdrainxv Good idea. I don't think of all these things lol. It's not natural yet
Walid Ashri
@walidashri
Nov 14 2016 06:38
@cdrainxv lol
@Jvernz if u rest and do some testing no problem but if got anther right solution it'll swipeout the first
Justin Vernon
@Jvernz
Nov 14 2016 06:41
Wow, can solve this thing in 3 lines by pushing first then sorting
__mifflin__
@cdrainxv
Nov 14 2016 06:41
@walidashri: I have never learned how to write in Arabic… I went to an English School my whole life… and I have forgotten Arabic… as there was no one to talk to who was/spoke Arabic… :disappointed: .
Walid Ashri
@walidashri
Nov 14 2016 06:41
@cdrainxv sorry for the arabic and I won't write the msg again
Justin Vernon
@Jvernz
Nov 14 2016 06:41
Spend 30 minutes trying to solve it with 14 lines, spend 1 minute restructuring to 3 lines
Walid Ashri
@walidashri
Nov 14 2016 06:42
@cdrainxv this was not even arabic :)
__mifflin__
@cdrainxv
Nov 14 2016 06:42
@walidashri: It didn’t even translate in google… it was Persian.
Markus Kiili
@Masd925
Nov 14 2016 06:42
@Jvernz The clever way is just to count arr elements <num.
Walid Ashri
@walidashri
Nov 14 2016 06:42
@Jvernz try it and till me :+1:
@cdrainxv I didn't notice that I was on Arabic layout until. the return :D
__mifflin__
@cdrainxv
Nov 14 2016 06:46
@walidashri: How many keyboard settings/layouts you got going on? :computer:
@walidashri: Also what did it mean? :point_up: November 13, 2016 11:38 PM
Justin Vernon
@Jvernz
Nov 14 2016 06:47
@Masd925 How would that work? I feel like that's what I initially tried
Markus Kiili
@Masd925
Nov 14 2016 06:48
@Jvernz You can find your spot in a length queue by counting the number of people shorter than you.
Simple for loop or .reduce() will do it.
Justin Vernon
@Jvernz
Nov 14 2016 06:48
@Masd925 That helps! thanks
CamperBot
@camperbot
Nov 14 2016 06:48
jvernz sends brownie points to @masd925 :sparkles: :thumbsup: :sparkles:
:star2: 2900 | @masd925 |http://www.freecodecamp.com/masd925
Jeff Greenlee
@JeffGreenlee42
Nov 14 2016 06:49
Ok... I appear to be having an issue addressing a sub array on line 35... can anyone see where I don't have this right?
function lookUpProfile(firstName, prop){
// Only change code below this line
  for (i=0; i < contacts.length; i++) {
    console.log(contacts[i].firstName);
    if(contacts[i].firstName == firstName) {
      if(contacts[i].hasOwnProperty(prop)) {
        return contacts[i][prop];
      } else {
        return "No such property";
      }
    }
    return "No Such contact";
  }
// Only change code above this line
}
Walid Ashri
@walidashri
Nov 14 2016 06:49
@cdrainxv three only :) I was writing in English
Jeff Greenlee
@JeffGreenlee42
Nov 14 2016 06:50
oops.. sorry doesn't record line numbers.. ummm first if statement
Justin Vernon
@Jvernz
Nov 14 2016 06:50
@Masd925 Holy crap. That's genius
Dmitry
@donchak1610
Nov 14 2016 06:51
__mifflin__
@cdrainxv
Nov 14 2016 06:53
@JeffGreenlee42: You want this:
return "No Such contact";
Outside of your loop.
Jeff Greenlee
@JeffGreenlee42
Nov 14 2016 06:54
@andrewpyen I think I missed your last query earlier this evening.. Did you firure out the blackjack challenge?
@cdrainxv Ok.. I'll try it.
Justin Vernon
@Jvernz
Nov 14 2016 06:58
String.prototype.charCodeAt()

String.fromCharCode()
are these absolutely necessary for caesars cipher?
Markus Kiili
@Masd925
Nov 14 2016 07:00
@Jvernz They make it easy.
Justin Vernon
@Jvernz
Nov 14 2016 07:01
@Masd925 I think I should make a loop to go through the string and make an if statement that changes the unicode number from one letter to the next
like from a to n
Markus Kiili
@Masd925
Nov 14 2016 07:02
@Jvernz Yes. You can loop or use iterator like .map().
Stefan
@st3fun1
Nov 14 2016 07:02
@Jvernz yes
Justin Vernon
@Jvernz
Nov 14 2016 07:02
@Masd925 ah i forgot about map, gotta look it up
Jeff Greenlee
@JeffGreenlee42
Nov 14 2016 07:02
@cdrainxv I tried your suggestion.. My only remaining test error is: ""Bob", "number" should return "No such contact"" - which means it never reaches that last statement!
Argh! I really wish I could get a debugger working.. So far my efforts to make one work have failed!
Justin Vernon
@Jvernz
Nov 14 2016 07:05
@Masd925 think I'll skip on map for now, the resources I look at to describe it don't help me very much
Markus Kiili
@Masd925
Nov 14 2016 07:07
@Jvernz Yes, you can refactor the solution later when you learn more.
__mifflin__
@cdrainxv
Nov 14 2016 07:07

@JeffGreenlee42: As per instructions:

"Bob", "number" should return "No such contact"

You have "No Such contact"
Dmitry
@donchak1610
Nov 14 2016 07:09
Hi again. I stuck, what's wrong ?

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

function checkObj(checkProp) {
if (myObj.hasOwnProperty(checkProp)){
return "pony";
}
else if (myObj.hasOwnProperty(checkProp)){
return "kitten";
}
else {
return "Not Found";
}
}

checkObj("pet");

Jeff Greenlee
@JeffGreenlee42
Nov 14 2016 07:09
Exactly.. That is the Test the challenge is throwing at the script. "Bob" is not in the array.. therefore it should reach that statement to return the "No such contact" strict. but it does not.. hence the error.
Ogundele Olumide
@Lumexralph
Nov 14 2016 07:12
@donchak1610 you're not to return the string, you're to return the value of that property in myObject
kevindalgleish
@kevindalgleish
Nov 14 2016 07:12
Hello, I am stuck at Stand in Line
Ogundele Olumide
@Lumexralph
Nov 14 2016 07:13
@donchak1610 i.e myObject [checkProp]
@donchak1610 you only need the first if statement
Conor Murphy
@cmurphy580
Nov 14 2016 07:14
does anyone know how to repeat a function on a different page? I'm trying to do this wikipedia viewer. I have an initial screen and a results screen with a search bar -- to make additional searches -- but the search bar on the second page doesn't work. Any tips or feedback would be appreciated.
https://codepen.io/cmurphy580/full/JbXzJE/
__mifflin__
@cdrainxv
Nov 14 2016 07:15
@JeffGreenlee42: You have s capitalized like No such contact… it should be No such contact… check again… I’ve pointed it out here :point_up: November 14, 2016 12:07 AM.
Jeff Greenlee
@JeffGreenlee42
Nov 14 2016 07:16
@cdrainxv Ha ha!!! Oh my god!!! I was looking for complicated logic errors.. turns out its a damned typo!!! :) Thanks!
CamperBot
@camperbot
Nov 14 2016 07:16
jeffgreenlee42 sends brownie points to @cdrainxv :sparkles: :thumbsup: :sparkles:
:cookie: 916 | @cdrainxv |http://www.freecodecamp.com/cdrainxv
Justin Vernon
@Jvernz
Nov 14 2016 07:17

@Masd925 I want to flip the character value around through the if statements. Is that possible?

function rot13(str) { // LBH QVQ VG!
  var letter = 'a';
  for (var i = 0;i<str.length;i++) {
    if (str.charCodeAt(i) <= 77) {
      str.charCodeAt(i + 13);
    }
    else if (str.charCodeAt(i) >= 78) {
      str.charCodeAtAt(i - 13);
    }
  }
  return str.charAt.charCodeAt(1)-13;

}

// Change the inputs below to test
rot13("SERR PBQR PNZC");

ignore the return line, was just testing

abbas ashraf mughal
@abbasashraf
Nov 14 2016 07:17
var num = 10++;
alert(7++);
alert(num);
that is not working why ??
__mifflin__
@cdrainxv
Nov 14 2016 07:17
@JeffGreenlee42: That will happen a lot… :smile:
Markus Kiili
@Masd925
Nov 14 2016 07:18
@Jvernz You need a result string or an array of characters.
Justin Vernon
@Jvernz
Nov 14 2016 07:19
@Masd925 Okay good idea
Conor Murphy
@cmurphy580
Nov 14 2016 07:20
@Masd925 Hey guy you seem to know a lot about this. Can you help me with this issue I posted earlier. does anyone know how to repeat a function on a different page? I'm trying to do this wikipedia viewer. I have an initial screen and a results screen with a search bar -- to make additional searches -- but the search bar on the second page doesn't work. Any tips or feedback would be appreciated.
https://codepen.io/cmurphy580/full/JbXzJE/
Justin Vernon
@Jvernz
Nov 14 2016 07:22
@Masd925 How do I assign the unicode value to a spot in my array?
arr[i] === str.charCodeAt();
doesn't work
Ogundele Olumide
@Lumexralph
Nov 14 2016 07:23
@abbasashraf var num = 10++, the value on right is assigned to num on left, 10++ is same as 10 = 10 + 1, even if it gets 11 from 10 + 1,it can't store it in 10 because it's not a variable and it'll return an error
tangwen
@xinbeimousha
Nov 14 2016 07:23
@abbasashraf you can not just alert(7++)
Markus Kiili
@Masd925
Nov 14 2016 07:25
@Jvernz
var arr = [];
for (var i=0; i<str.length; i++) {
    arr[i] = str.charCodeAt(i);
}
That works, but arr.push(str.charCodeAt(i)); is a safer way to add elements to an array.
Justin Vernon
@Jvernz
Nov 14 2016 07:27
@Masd925 nevermind I see what I did wrong. I had arr[i] === instead of arr[i] =
@Masd925 Thanks for your help so far btw
CamperBot
@camperbot
Nov 14 2016 07:27
jvernz sends brownie points to @masd925 :sparkles: :thumbsup: :sparkles:
:warning: jvernz already gave masd925 points
Conor Murphy
@cmurphy580
Nov 14 2016 07:29
@Masd925 nevermind my man i figured it out!
Gaurav Gada
@ggada
Nov 14 2016 07:33
How do I get arg1 and arg2 inside cache()
var complexFunction = function(arg1, arg2) { /* complex calculation in here */ };
var cachedFunction = cache(complexFunction);
Jeff Greenlee
@JeffGreenlee42
Nov 14 2016 07:33
Hey.. I have asked this before and only got one answer to it: Does any one know of any good way of using a debugger for JavaScript?
My only suggestion was for chrome.. but I tried that and it seemed really ugly and not a very good solution.
Gaurav Gada
@ggada
Nov 14 2016 07:34
@JeffGreenlee42 Hey probably check this out on how to use a testing framework: https://forum.freecodecamp.com/t/testing-your-own-code-using-mocha-and-chai-simple-example/44149?u=jacksonbates
Ogundele Olumide
@Lumexralph
Nov 14 2016 07:36
@0x-gg was thinking, if you could return them from function(arg1, arg2) , using arguments array-like object
Jeff Greenlee
@JeffGreenlee42
Nov 14 2016 07:37
@0x-gg .. yeah.. that looks great for a testing framework.. but .. hmmm.. what I really want to be able to do is run a step by step debugging experience ... so you can trace exactly where the logic in a code snippet goes south!
Justin Vernon
@Jvernz
Nov 14 2016 07:38
What's the command to convert unicode back into letters?
Markus Kiili
@Masd925
Nov 14 2016 07:38
@Jvernz String.fromCharCode()
Jeff Greenlee
@JeffGreenlee42
Nov 14 2016 07:38
I thought I would be able to do it in Atom.. but the only debugger I could find was one for node.js .. which I don't have installed.
Justin Vernon
@Jvernz
Nov 14 2016 07:39
@Masd925 Oh duh. Thanks!
CamperBot
@camperbot
Nov 14 2016 07:39
jvernz sends brownie points to @masd925 :sparkles: :thumbsup: :sparkles:
:warning: jvernz already gave masd925 points
Gaurav Gada
@ggada
Nov 14 2016 07:42

@Lumexralph

var complexFunction = function(arg1, arg2) { /* complex calculation in here */ };
var cachedFunction = cache(complexFunction);

cachedFunction('foo', 'bar'); // complex function should be executed
cachedFunction('foo', 'bar'); // complex function should not be invoked again, instead the cached result should be returned
cachedFunction('foo', 'baz'); // should be executed, because the method wasn't invoked before with these argument

trying to code a caching function. i don't think i can return anything from complexFunction.. is there some way I could get the arguments inside cache() ?

Justin Vernon
@Jvernz
Nov 14 2016 07:44
@Masd925 How do I get string.fromCharCode() to work with an array/string containing the numbers? another loop?
Markus Kiili
@Masd925
Nov 14 2016 07:45
String.fromCharCode.apply(null,[67,68,69]); // 'CDE'
@Jvernz
With that trick you can transform an array of charcodes into a string.
Justin Vernon
@Jvernz
Nov 14 2016 07:46
@Masd925 lol
function rot13(str) { // LBH QVQ VG!
  var arr = [];
  var answer = '';
  var string = '';
  for (var i = 0;i<str.length;i++) {
   // arr.push(str.charCodeAt(i));
    if (str.charCodeAt(i) <= 77 && str.charCodeAt(i) >64) {
      arr[i] = str.charCodeAt(i) + 13;
    }

    else if (str.charCodeAt(i) >= 78) {

      arr[i] = str.charCodeAt(i) - 13;
    }
    else {
      arr[i] = str.charCodeAt(i);
    }

  }

  answer = arr.join(' ');
  for (var j = 0;j<str.length;j++) {
    answer.fromCharCode(answer[j]);

  }
  return answer;

}

// Change the inputs below to test
rot13("SERR PBQR PNZC");
This is what I have
My second loop obviously doesn't work, but I think it shows my though process
Justin Vernon
@Jvernz
Nov 14 2016 07:59
so apparently String isn't a placeholder. You actually have to type String.
MarinaDimitrijevic
@MarinaDimitrijevic
Nov 14 2016 08:10

var count = 0;

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

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

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

Counting Cards???
Ogundele Olumide
@Lumexralph
Nov 14 2016 08:15
@MarinaDimitrijevic what's the issue? you'll need an if/else or switch statement...to check all the conditions you're working with. switch statement would make it easier
@0x-gg can't think up anything yet
Merryl
@MerrylArok
Nov 14 2016 08:19
Hello I finished FCC 244, Return Largest Number in Arrays
I didnt want to use any prebuilt function(like sort()) so i wrote this piece of code but it looks ugly. Could this be optimized or are there any redundant lines that can be removed?

function largestOfFour(arr) {
  // You can do this!
  "use strict";
  function Sort(val){
    var sortArr=[];
    for(var i=0,len =0;i<val.length;i++){
      for(var j=0;j<val[i].length;j++){
      if (len<val[i][j]){len =val[i][j];}
          }
      sortArr.push(len);
      len=0;}
    return sortArr;

  }

  return Sort(arr);
}

largestOfFour([[13, 27, 18, 26], [4, 5, 1, 3], [32, 35, 37, 39], [1000, 1001, 857, 1]]);
As far as i can tell, the Sort function is redundant so i removed that extra piece of code and my main code is under the largest OfFour function
Philipp Scholz
@philipp32
Nov 14 2016 08:28
Hey :) So I have an array which consists of multiple strings. Is there a way to access the first item of each string in that array? My version was:
array[i][0]
AHMAD ZAHEER
@ahmad1174
Nov 14 2016 08:29

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=4;
this.setGear=function(gear){
this.gear=gear;
};
this.getGear=function(){
return gear;
};
// Only change code below this line.

};

var myCar = new Car();

var myBike = new Bike();
myBike.setGear(3);
myBike.getGear();

help please?
CamperBot
@camperbot
Nov 14 2016 08:29
no wiki entry for: please
Ivan Aganin
@criativ
Nov 14 2016 08:29
Hello :)
Philipp Scholz
@philipp32
Nov 14 2016 08:30
@criativ good morning :)
Ivan Aganin
@criativ
Nov 14 2016 08:33
I have a stupid question, I know the answer, but forgot it :) lol - Let's say I declared a value x = "It's X" and then I assign function(lets's say function changeX()) a button that runs a function that supposed to CHANGE the value of "x". How do I do that?
Merryl
@MerrylArok
Nov 14 2016 08:35
@ahmad1174 try setting gear=gear;
if i remember correctly your gear is a private property.
Jeff Shapiro
@Jeff-Shapiro
Nov 14 2016 08:35
@criativ have you tried google?
eyeseau
@eyea
Nov 14 2016 08:35
How to solve this?
Merryl
@MerrylArok
Nov 14 2016 08:36
also make sure you are giving unique names. this helps immensely with the readability too
this.setGear=function(val){
gear=val;
};
Jeff Shapiro
@Jeff-Shapiro
Nov 14 2016 08:36
@criativ I'm not doing it to be difficult but being able to source your own info will help you in the future
Ivan Aganin
@criativ
Nov 14 2016 08:36
@Jeff-Shapiro hi, yeah... been there - doesn't give right answers that easy :)
Jeff Shapiro
@Jeff-Shapiro
Nov 14 2016 08:36
@criativ one moment
MarinaDimitrijevic
@MarinaDimitrijevic
Nov 14 2016 08:37
I do not understand a mathematical formula that solve the task
Ivan Aganin
@criativ
Nov 14 2016 08:38
@Jeff-Shapiro I know how things work, but i kind of don't get the logic of it - how to inpact global variables from functions...
Philipp Scholz
@philipp32
Nov 14 2016 08:38
Hey :) So I have an array which consists of multiple strings. Is there a way to access the first item of each string in that array? My version was:
array[i][0]
Jeff Shapiro
@Jeff-Shapiro
Nov 14 2016 08:38
@criativ I think this will help you
Merryl
@MerrylArok
Nov 14 2016 08:39
@philipp32 do you mean the first letter of each string?
Ivan Aganin
@criativ
Nov 14 2016 08:39
@Jeff-Shapiro thanks I'll take a look!
CamperBot
@camperbot
Nov 14 2016 08:39
criativ sends brownie points to @jeff-shapiro :sparkles: :thumbsup: :sparkles:
:cookie: 346 | @jeff-shapiro |http://www.freecodecamp.com/jeff-shapiro
Philipp Scholz
@philipp32
Nov 14 2016 08:39
Yes @MerrylArok
MarinaDimitrijevic
@MarinaDimitrijevic
Nov 14 2016 08:39
switch (card) {
case (card==2 || card==3 || card==4 || card==5 || card==6):
return "Bet";
break;
case (card==7 || card==8 || card==9):
return "Hold";
break;
}
Jack Of All Trades International.
@JOATI
Nov 14 2016 08:40
I've tried just about everything but I can't get my buttons to work -_- can anybody lend a helping hand ^-^ http://codepen.io/JOATI/pen/PNOZzV
Jeff Shapiro
@Jeff-Shapiro
Nov 14 2016 08:40
@MarinaDimitrijevic I'm going to guess your having issues with that code
Markus Kiili
@Masd925
Nov 14 2016 08:41
@philipp32 You can get the first character of the looped string like that, but not set it, because strings are immutable.
Jeff Shapiro
@Jeff-Shapiro
Nov 14 2016 08:41
@JOATI its not even loading for me
Markus Kiili
@Masd925
Nov 14 2016 08:41
For changing, you need to make a new string and assign it back to the array element.
Jack Of All Trades International.
@JOATI
Nov 14 2016 08:41
WHTF haha brb ;)
Merryl
@MerrylArok
Nov 14 2016 08:42
@philipp32 firstly array[x][y] accesses the y index in the x subarray of the array
Jack Of All Trades International.
@JOATI
Nov 14 2016 08:42
thanks in advance !! :P
Merryl
@MerrylArok
Nov 14 2016 08:42
you should be able to get your first letter by using charAt on that string
so string.charAt[0] gives you the first letter of the string
Jack Of All Trades International.
@JOATI
Nov 14 2016 08:43
MarinaDimitrijevic
@MarinaDimitrijevic
Nov 14 2016 08:43
@Jeff-Shapiro yes, how to write function of counting cards
Markus Kiili
@Masd925
Nov 14 2016 08:44
@MerrylArok The syntax is .charAt(i), not [ ]
Philipp Scholz
@philipp32
Nov 14 2016 08:44
@JOATI there is a problem: reversed word function
Jeff Shapiro
@Jeff-Shapiro
Nov 14 2016 08:45
@MarinaDimitrijevic do you know how to go back and redo the challenges?
Jack Of All Trades International.
@JOATI
Nov 14 2016 08:45
okay i'll google how too solve it thanks man
dank mein freund !!
Merryl
@MerrylArok
Nov 14 2016 08:46
@Masd925 ah yes! thanks for correcting, i seem to entirely rely on errors to correct my code haha
CamperBot
@camperbot
Nov 14 2016 08:46
merrylarok sends brownie points to @masd925 :sparkles: :thumbsup: :sparkles:
:star2: 2901 | @masd925 |http://www.freecodecamp.com/masd925
Philipp Scholz
@philipp32
Nov 14 2016 08:46
@JOATI np
MarinaDimitrijevic
@MarinaDimitrijevic
Nov 14 2016 08:46
@Jeff-Shapiro no i don't
Philipp Scholz
@philipp32
Nov 14 2016 08:46
@Masd925 thank you. I will write a bit more code. :)
CamperBot
@camperbot
Nov 14 2016 08:46
philipp32 sends brownie points to @masd925 :sparkles: :thumbsup: :sparkles:
:star2: 2902 | @masd925 |http://www.freecodecamp.com/masd925
Jeff Shapiro
@Jeff-Shapiro
Nov 14 2016 08:47
in Freecodecamp up the top right click on map and then search for 'Selecting from many options with Switch Statements'
DafyddLlyr
@DafyddLlyr
Nov 14 2016 08:47
Hey guys, just started the "Seek and Destroy" challenge and I have a simple question.

function destroyer(arr) {

  for (var i = 1; i < arguments.length; i++) {
    return arr[i];
  }

}

destroyer([1, 2, 3, 1, 2, 3], 2, 3);
Shouldn't this return me and array with [2, 3] in it instead of just 2?
Philipp Scholz
@philipp32
Nov 14 2016 08:48
@DafyddLlyr No
Justin Vernon
@Jvernz
Nov 14 2016 08:48
@DafyddLlyr No
Markus Kiili
@Masd925
Nov 14 2016 08:48
@DafyddLlyr It will return arr[1]
Philipp Scholz
@philipp32
Nov 14 2016 08:48
Because 2,3 is not an array
Justin Vernon
@Jvernz
Nov 14 2016 08:48
return; exits the function
Philipp Scholz
@philipp32
Nov 14 2016 08:48
it would need to be [2,3]
Markus Kiili
@Masd925
Nov 14 2016 08:49
@DafyddLlyr Make an empty array and push those arguments there. Then you can solve it by using arr and arguments array.
Justin Vernon
@Jvernz
Nov 14 2016 08:50
and return arr[i] is accessing a specific element of the array
DafyddLlyr
@DafyddLlyr
Nov 14 2016 08:50
thanks guys

function destroyer(arr) {

  var test = [];

  for (var i = 1; i < arguments.length; i++) {
    test = arr[i];
  }

  return test;

}

destroyer([1, 2, 3, 1, 2, 3], 2, 3);
now this returns just 3 instead of an array
Markus Kiili
@Masd925
Nov 14 2016 08:51
@DafyddLlyr test.push(arguments[i]);
DafyddLlyr
@DafyddLlyr
Nov 14 2016 08:52
@Masd925 That's the one, of course. It will push each result in as it iterates through
Merryl
@MerrylArok
Nov 14 2016 08:53
is .substr being phased out for .substring or are they used for different purposes
DafyddLlyr
@DafyddLlyr
Nov 14 2016 08:53
fantastic, thanks for that guys - something simple I should have realised - need more coffee!
@Masd925 thanks again!
CamperBot
@camperbot
Nov 14 2016 08:53
dafyddllyr sends brownie points to @masd925 :sparkles: :thumbsup: :sparkles:
:star2: 2903 | @masd925 |http://www.freecodecamp.com/masd925
__mifflin__
@cdrainxv
Nov 14 2016 09:04
@MerrylArok: substr() substring()
Merryl
@MerrylArok
Nov 14 2016 09:09
@cdrainxv thanks!
CamperBot
@camperbot
Nov 14 2016 09:09
merrylarok sends brownie points to @cdrainxv :sparkles: :thumbsup: :sparkles:
:cookie: 921 | @cdrainxv |http://www.freecodecamp.com/cdrainxv
Merryl
@MerrylArok
Nov 14 2016 09:11
@cdrainxv the actual reason for me asking if substr was being phased out was the whole "The deprecated substr() method ..." lol when i was reading through DevDocs
__mifflin__
@cdrainxv
Nov 14 2016 09:13
@MerrylArok: Ahah… :smile:. I like to response with references.
Levi
@MalangeLevi
Nov 14 2016 09:14
@cdrainxv can u help please...
sajjanparida
@sajjanparida
Nov 14 2016 09:15

function addTogether(x) {

return function(y){
return x+y;
};
}

addTogether(2,3);

can anyone help me out with this one.
it works for addTogether()()
Do i need to define the fucntion differently for adding addtogether(2,3) ??
Claudio Restifo
@Marmiz
Nov 14 2016 09:20
@sajjanparida you are returning 2 function. One is indie the other therefore the program expect an "argument inside an argument"
If you want to have a single function simply pass two arguments to that:
function myFunction(x, y) {
 return x + y;
}
Levi
@MalangeLevi
Nov 14 2016 09:21
@sajjanparida remove return from your function then just use one return
@Marmiz hi, im trying to setup my cloud9 do u have any idea
__mifflin__
@cdrainxv
Nov 14 2016 09:22
@MalangeLevi: If I can… depends… hopefully your question is not above my expertise.
Levi
@MalangeLevi
Nov 14 2016 09:22
First, create a file called `test.js`.  It doesn't have to do anything,
really.  (This is npm class, not testing class.)  But it has to exit
without throwing an error, or else the test fails.

Then, edit your `package.json` file to make your scripts section look like
this instead:

  "scripts": {
    "test": "node test.js"
  },
@cdrainxv @cdrainxv
im dealing with cloud9
Jeff Shapiro
@Jeff-Shapiro
Nov 14 2016 09:23
@cdrainxv what IDE's do you use?
__mifflin__
@cdrainxv
Nov 14 2016 09:23
@MalangeLevi: Did you create the file test.js?
Levi
@MalangeLevi
Nov 14 2016 09:24
@cdrainxv no, i dont know how to do it
i thougth npm test.js
how do i edit the json file
__mifflin__
@cdrainxv
Nov 14 2016 09:24
try echo > test.js to create the file.
Levi
@MalangeLevi
Nov 14 2016 09:25
@cdrainxv what do i do next
__mifflin__
@cdrainxv
Nov 14 2016 09:26
@MalangeLevi: Then edit this part in your package.json file:
 "scripts": {
    "test": "node test.js"
  },
Levi
@MalangeLevi
Nov 14 2016 09:27
using what command npm package.json?
__mifflin__
@cdrainxv
Nov 14 2016 09:28
You can literally just edit it… by opening the file from your path tree in the top left.
Claudio Restifo
@Marmiz
Nov 14 2016 09:30

@MalangeLevi Trat C9 as if it was your desktop:
you want to create a new file? In the side-bar where you see your file tree, right-click and create a new file.
Then save it as "test.js"

I know. there's a lot to learn when starting workinhg on "your own" coding enviroment... so don't get discouraged

Levi
@MalangeLevi
Nov 14 2016 09:30
@Marmiz how do i edit it?
__mifflin__
@cdrainxv
Nov 14 2016 09:30
@MalangeLevi: Do you see the file learn-npm?
Levi
@MalangeLevi
Nov 14 2016 09:31
@cdrainxv yes
Claudio Restifo
@Marmiz
Nov 14 2016 09:31
@MalangeLevi when you open a file, it's automatically open for you in a text editor.
Simply type what you want to type, where you want to type it (like in the Free Code Camp challenges)
__mifflin__
@cdrainxv
Nov 14 2016 09:31
@MalangeLevi: Travel through it and you’ll see package.json… open it and then edit it.
Liew Xun
@damakuno
Nov 14 2016 09:32
use any text editor you want
locate to the directory where package.json is located
cd "filepath"
Blauelf
@Blauelf
Nov 14 2016 09:34

@sajjanparida For checking the number of passed arguments, you can use arguments.length.
For checking whether a variable (or parameter) contains a number, you can use typeof x === "number".

You can use two parameters in your outer function, or use arguments object to access those.

You have to return either a number or a function from your function, depending on the number of passed arguments (1 => function that accepts another number, 2 => number). And if any of the passed arguments is not a number, you are to return undefined.

Aarya Bhorra
@aarya1302
Nov 14 2016 09:34

function whatIsInAName(collection, source) {
  // What's in a name?
  var arr = [];
  // Only change code below this line
  var keys = Object.keys(source);

  for(var i =0; i < keys.length; i++){
    for (var j = 0; j < collection.length; j++){
      if(collection[j].hasOwnProperty(keys[i])){
        if(collection[j][keys[i]] === source[keys[i]]){
          console.log(collection[j][keys[i]]);
          var object;
          object[keys[i]] = collection[j][keys[i]];
          arr.push(object);
        }
      }
    }
  }

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

whatIsInAName([{ first: "Romeo", last: "Montague" }, { first: "Mercutio", last: null }, { first: "Tybalt", last: "Capulet" }], { last: "Capulet" });
I can't run this it keeps saying: TypeError: Cannot set property 'last' of undefined
Please help
Blauelf
@Blauelf
Nov 14 2016 09:38

@aarya1302 You declare object, without initializing it, it has value undefined, then you try to assign to one of its properties, but undefined cannot have properties.

Push collection[j] instead, but only after making sure it contains all the keys (for that, better switch the order of your loops and somehow track if all properties are found and match)

Ivan Aganin
@criativ
Nov 14 2016 09:38
Still need some help, please :)
Jeff Shapiro
@Jeff-Shapiro
Nov 14 2016 09:39
@criativ pm me :)
Ivan Aganin
@criativ
Nov 14 2016 09:40
Let's say I've got:
var one = "x";

function cangeX(){
   one = "y";
};
console.log(one); (and it says it is "x", not "y")
Blauelf
@Blauelf
Nov 14 2016 09:41
@criativ You never call cangeX
Ivan Aganin
@criativ
Nov 14 2016 09:41
yeah, but i have an eventHandler that does :)
Claudio Restifo
@Marmiz
Nov 14 2016 09:41
@criativ because the action that changes x to y is inside the changeX function.
You need to invoke that in your console.log
Blauelf
@Blauelf
Nov 14 2016 09:42
@criativ Maybe you have changeX vs. cangeX, or maybe you console.log before your other handler can fire?
SumaiyaTamjeed
@SumaiyaTamjeed
Nov 14 2016 09:43

In the casino game Blackjack, a player can gain an advantage over the house by keeping track of the relative number of high and low cards remaining in the deck. This is called Card Counting.

Having more high cards remaining in the deck favors the player. Each card is assigned a value according to the table below. When the count is positive, the player should bet high. When the count is zero or negative, the player should bet low.

Count Change Cards
+1 2, 3, 4, 5, 6
0 7, 8, 9
-1 10, 'J', 'Q', 'K', 'A'
You will write a card counting function. It will receive a card parameter and increment or decrement the global count variable according to the card's value (see table). The function will then return a string with the current count and the string "Bet" if the count is positive, or "Hold" if the count is zero or negative. The current count and the player's decision ("Bet" or "Hold") should be separated by a single space.

Example Output
"-3 Hold"
"5 Bet"

Aarya Bhorra
@aarya1302
Nov 14 2016 09:43
@Blauelf thanks
Ivan Aganin
@criativ
Nov 14 2016 09:43
So you are saying - that my thought/code processing is correct and it SHOULD work?
CamperBot
@camperbot
Nov 14 2016 09:43
aarya1302 sends brownie points to @blauelf :sparkles: :thumbsup: :sparkles:
:star2: 2845 | @blauelf |http://www.freecodecamp.com/blauelf
SumaiyaTamjeed
@SumaiyaTamjeed
Nov 14 2016 09:43
And thiis is my code
Liew Xun
@damakuno
Nov 14 2016 09:43
use switch ... case statements @SumaiyaTamjeed
SumaiyaTamjeed
@SumaiyaTamjeed
Nov 14 2016 09:43

var count = 0;

function cc(card) {

switch(card){
case 2:
case 3:
case 4:
case 5:
case 6:
count+=1;
break;
case 7:
case 8:
case 9:
break;
case 10:
case 'J':
case 'Q':
case 'K':
case 'A':
count-=1;
break;

}
if (count>0)
{
console.log( count, "bet");
}
else if(count<=0){
console.log( count, "hold");
}
//return "Change Me";
// Only change code above this line
}

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

help.
Blauelf
@Blauelf
Nov 14 2016 09:44
@SumaiyaTamjeed Return a string, don't console.log. And that if(count<=0) does not do anything (should be a simple else), and it has to be "Bet" and "Hold", with a space between the count and the word.
Conor Murphy
@cmurphy580
Nov 14 2016 09:45
Hey I want to reverse the order of my search results. My google search has amounted to nothing and I thought I see anyone here could help. https://codepen.io/cmurphy580/pen/JbXzJE
Give it a look and let me know if you have any ideas. I don't think the simple 'split("").reverse().join("")' will work.
chaoz4ngel
@chaoz4ngel
Nov 14 2016 09:45

"Truncate a string"


function truncateString(str, num) {
  // Clear out that junk in your trunk


  if (num <= 3){
    return str.slice(0, num) + "...";
  }
  else {
    return str.slice(0, num -3) + "...";
  }
  return str.trim();
}

truncateString("A-tisket a-tasket A green and yellow basket", 11);

i cant solve this two:
truncateString("A-tisket a-tasket A green and yellow basket", "A-tisket a-tasket A green and yellow basket".length) should return "A-tisket a-tasket A green and yellow basket".
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".

SumaiyaTamjeed
@SumaiyaTamjeed
Nov 14 2016 09:45
@damakuno My logic must be wrong. but cant figure it out where.
Blauelf
@Blauelf
Nov 14 2016 09:45
@chaoz4ngel Check first whether str needs shortening. If str.length <= num, just return str.
SumaiyaTamjeed
@SumaiyaTamjeed
Nov 14 2016 09:46
@Blauelf thanks
CamperBot
@camperbot
Nov 14 2016 09:46
sumaiyatamjeed sends brownie points to @blauelf :sparkles: :thumbsup: :sparkles:
:star2: 2846 | @blauelf |http://www.freecodecamp.com/blauelf
chaoz4ngel
@chaoz4ngel
Nov 14 2016 09:48
@Blauelf but then this
truncateString("A-", 1) should return "A...".
doesn't works :v
truncateString("Absolutely Longer", 2) should return "Ab...".
this too
Diane
@106Ch213
Nov 14 2016 09:49
Hi guys, anyone can see why my code doesn't work? :/ (record collection challenge)
if (prop !== "tracks" && value !== undefined) 
    {
    collection[id][prop][value] = value;
    }

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

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

if (collection[id][prop][value] === undefined) //works
    {
    delete collection[id][prop];
    }

  return collection;
}
Blauelf
@Blauelf
Nov 14 2016 09:49
@chaoz4ngel You wrote if (str.length <= num) { return str; } and it creates those errors?
chaoz4ngel
@chaoz4ngel
Nov 14 2016 09:50
@Blauelf oh lol, now i added it in a else if and works. thanks!
CamperBot
@camperbot
Nov 14 2016 09:50
chaoz4ngel sends brownie points to @blauelf :sparkles: :thumbsup: :sparkles:
:star2: 2847 | @blauelf |http://www.freecodecamp.com/blauelf
Blauelf
@Blauelf
Nov 14 2016 09:50
@106Ch213 value should be checked against empty string "", not undefined. Also, remove those [value].
Diane
@106Ch213
Nov 14 2016 09:51
@Blauelf ok I'll try that thanks
CamperBot
@camperbot
Nov 14 2016 09:51
106ch213 sends brownie points to @blauelf :sparkles: :thumbsup: :sparkles:
:star2: 2848 | @blauelf |http://www.freecodecamp.com/blauelf
Blauelf
@Blauelf
Nov 14 2016 09:51
@chaoz4ngel That check should be done first. If there's no need to truncate, don't truncate.
chaoz4ngel
@chaoz4ngel
Nov 14 2016 09:52
@Blauelf true, doned :)
Blauelf
@Blauelf
Nov 14 2016 09:54

@106Ch213

    collection[id][prop] = [];
    collection[id].tracks = value;

here both assignments assign to the same variable. Use either

    collection[id][prop] = [];
    collection[id].tracks.push(value);

or

    collection[id][prop] = [value];

(and since prop equals "tracks", collection[id][prop] and collection[id].tracks can be used interchangeably)

Ghulam Shabir
@ghulamshabir
Nov 14 2016 09:56
@106Ch213 you better use collection[id][prop] to be safe for instance tracks changes to songs
Diane
@106Ch213
Nov 14 2016 09:57
@Blauelf I did that but somehow now my function won't delete prop if my value is "" O.o and it won't push value to the end of the tracks array either :worried:
@ghulamshabir yup good idea thanks
CamperBot
@camperbot
Nov 14 2016 09:57
106ch213 sends brownie points to @ghulamshabir :sparkles: :thumbsup: :sparkles:
:star2: 1008 | @ghulamshabir |http://www.freecodecamp.com/ghulamshabir
Blauelf
@Blauelf
Nov 14 2016 09:58

@106Ch213 Just check whether value === "" as your first action, if so, delete, and put everything else in its else path (within that, you never have to check again whether value is not empty string - it is, otherwise you wouldn't be in the else path)

if-elseif-elseif-else works here (or some kind of nested if-elses)

Diane
@106Ch213
Nov 14 2016 09:58
@Blauelf Ok gonna try this right now! thanks again!
CamperBot
@camperbot
Nov 14 2016 09:58
106ch213 sends brownie points to @blauelf :sparkles: :thumbsup: :sparkles:
:warning: 106ch213 already gave blauelf points
nijeshk2011
@nijeshk2011
Nov 14 2016 10:04
hi
i need a help..
function isLess(a, b) {
// Fix this code
return a===b;
}
// Change these values to test
isLess(15, 10);
Liew Xun
@damakuno
Nov 14 2016 10:06
compare a and b
Ghulam Shabir
@ghulamshabir
Nov 14 2016 10:06
@nijeshk2011 your return syntax is good but wrong operator, get hint from function name isLess
sabaimtiaz
@sabaimtiaz
Nov 14 2016 10:06
Hi - I'm doing the MyVar++ challenge and am stuck at the error 'myVar=myVar' should be changed.

var myVar = 87;

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

what am i doing wrong?
Liew Xun
@damakuno
Nov 14 2016 10:07
you don't have to keep declaring myVar
also myVar = myVar++ is redundant because myVar++ is just myVar = myVar + 1
Ghulam Shabir
@ghulamshabir
Nov 14 2016 10:08
@sabaimtiaz ++ increments the variable by one in place you need not re-assign myVar anything
@sabaimtiaz the solution is one liner
jeannette-milland
@jeannette-milland
Nov 14 2016 10:09
Hi,

// Initialize these three variables
var a;
var b;
var c;

a=5;
b=10;
c="I am"; //a = a + 1;
b = b + 5;
c = c + " String!";

Ghulam Shabir
@ghulamshabir
Nov 14 2016 10:09
@jeannette-milland hi
chaoz4ngel
@chaoz4ngel
Nov 14 2016 10:09
some suggestion about "Chunky Monkey"?