These are chat archives for FreeCodeCamp/Help

14th
Jan 2016
John Cerpa
@johncerpa
Jan 14 2016 00:00
explain format
CamperBot
@camperbot
Jan 14 2016 00:00

:point_right: code formatting [wiki]

Inline code

This an inline `<paste code here>` code formatting with a single backtick(`) at start and end around the code.

Code Block

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

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

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

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

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

Brian
@sludge256
Jan 14 2016 00:00
it's faster to type
Bill
@kirah1314
Jan 14 2016 00:00
help works too
CamperBot
@camperbot
Jan 14 2016 00:00
no wiki entry for: works too
john considine
@jconsi1317
Jan 14 2016 00:00
In the Checkpoint Profile Lookup, why is it so important to use nested if statements rather than one if that uses the && operator?
Brian
@sludge256
Jan 14 2016 00:00
In case you guys want to test commands without spamming the chat
https://gitter.im/FreeCodeCamp/camperbotPlayground
Roshan Ghadamian
@RGhadamian
Jan 14 2016 00:00
@kirah1314 yeah I tried doing a fair bit of console.log’s but I couldn’t get it to do anything …it was just printing empty arrays and I couldn’t figure out why…obviously I know why now! :)
Brian
@sludge256
Jan 14 2016 00:00
cya later :wave:
John Cerpa
@johncerpa
Jan 14 2016 00:01
cya
Bill
@kirah1314
Jan 14 2016 00:01
@RGhadamian keep coding and things will start sinking in more and more :)
Jennifer Linkenauger
@jlinkenauger
Jan 14 2016 00:02

so then

var secondTree = myPlants[1].pine;

?

Roshan Ghadamian
@RGhadamian
Jan 14 2016 00:02
@kirah1314 yup yup, that’s the plan. Programming in general is a serious skill to do well
Bill
@kirah1314
Jan 14 2016 00:02
@jlinkenauger item is a property with an array, how would you access item's 2nd element?
John Cerpa
@johncerpa
Jan 14 2016 00:03
"property": "valueofproperty"
acces the property not the value
idk
Bill
@kirah1314
Jan 14 2016 00:03
thanks @johncerpa
CamperBot
@camperbot
Jan 14 2016 00:03
kirah1314 sends brownie points to @johncerpa :sparkles: :thumbsup: :sparkles:
:star: 232 | @johncerpa | http://www.freecodecamp.com/johncerpa
tommy
@tommygebru
Jan 14 2016 00:04
@jconsi1317 maybe nested if statements offers more {execution} than a condition with && which offers one {execution}?
Jennifer Linkenauger
@jlinkenauger
Jan 14 2016 00:04
@kirah1314 with another bracket? and a number?
so
var secondTree = myPlants.[1,1];
or
var secondTree = myPlants.[1][1];
John Cerpa
@johncerpa
Jan 14 2016 00:05
myPlants[1].propertyyouwantoacces
myPlants[1].something[1]
john considine
@jconsi1317
Jan 14 2016 00:05
@tommygebru what I was thinking was that nesting them creates more priority, but i'm not sure.
Bill
@kirah1314
Jan 14 2016 00:06
@jlinkenauger you're very close, so myPlants[1].item will allow you to access item which is an array. So how do you access item's 2nd element?
@jlinkenauger for example myPlants is an array and you're accessing myPlants's elements above
John Cerpa
@johncerpa
Jan 14 2016 00:06
and then your accessing the elements of the elements lol
Jennifer Linkenauger
@jlinkenauger
Jan 14 2016 00:07
got it! thank you @kirah1314 & @johncerpa
CamperBot
@camperbot
Jan 14 2016 00:07
jlinkenauger sends brownie points to @kirah1314 and @johncerpa :sparkles: :thumbsup: :sparkles:
:star: 821 | @kirah1314 | http://www.freecodecamp.com/kirah1314
:star: 233 | @johncerpa | http://www.freecodecamp.com/johncerpa
Bill
@kirah1314
Jan 14 2016 00:07
@jlinkenauger :thumbsup:
John Cerpa
@johncerpa
Jan 14 2016 00:07
@jlinkenauger :+1:
tommy
@tommygebru
Jan 14 2016 00:07
@jconsi1317 sure it does !
Davey
@dbelasco
Jan 14 2016 00:08
ok thanks for the help on the code blocks my peeps!
John Cerpa
@johncerpa
Jan 14 2016 00:08
I feel like if you help others you learn more lol
Davey
@dbelasco
Jan 14 2016 00:08
now the real problems follows
john considine
@jconsi1317
Jan 14 2016 00:09
@tommygebru okay thanks for the confirmation!
CamperBot
@camperbot
Jan 14 2016 00:09
jconsi1317 sends brownie points to @tommygebru :sparkles: :thumbsup: :sparkles:
:star: 308 | @tommygebru | http://www.freecodecamp.com/tommygebru
Davey
@dbelasco
Jan 14 2016 00:09
waypoint says “i need an “a” element that links to "http://freecatphotoapp.com” is this right?
Bill
@kirah1314
Jan 14 2016 00:09
@johncerpa haha and it's addicting!
Davey
@dbelasco
Jan 14 2016 00:10
<p><a href='http://freecatphotoapp.com'> cat photos</a></p>
John Cerpa
@johncerpa
Jan 14 2016 00:10
@kirah1314 I know right :)
Bill
@kirah1314
Jan 14 2016 00:10
and not to mention all the brownies!
John Cerpa
@johncerpa
Jan 14 2016 00:10
hahahahaha
Davey
@dbelasco
Jan 14 2016 00:10
wow
looks good
John Cerpa
@johncerpa
Jan 14 2016 00:10
what's up
jmesa92
@jmesa92
Jan 14 2016 00:10
I haven't even written anything, and I'm completely lost on what to do with "Checkpoint: Record Collection"
tommy
@tommygebru
Jan 14 2016 00:10
@dbelasco remember not to give the answer so freely :smile:
John Cerpa
@johncerpa
Jan 14 2016 00:11
are you guys in college?
iamlimo
@iamlimo
Jan 14 2016 00:12
hello
John Cerpa
@johncerpa
Jan 14 2016 00:12
hey
iamlimo
@iamlimo
Jan 14 2016 00:12
I need help with as challenge

a

John Cerpa
@johncerpa
Jan 14 2016 00:13
what is it
Bill
@kirah1314
Jan 14 2016 00:13
@jmesa92 the function is already started for you on the right section and it has 3 parameters, do you see that?
iamlimo
@iamlimo
Jan 14 2016 00:13
@johncerpa I was asked to Target the same element with multiple jQuery Selectors
John Cerpa
@johncerpa
Jan 14 2016 00:13
can you paste the code
iamlimo
@iamlimo
Jan 14 2016 00:13

here is my code <script>
$(document).ready(function() {
$("button").addClass()
$(".btn").addClass()
$("#target1").addClass("animated shake btn-primary")
});
</script>

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

John Cerpa
@johncerpa
Jan 14 2016 00:13
in the chat
Bill
@kirah1314
Jan 14 2016 00:13
@jmesa92 next you have to write codes inside this function which will do what the instructions are asking to do. You see all the if words?
John Cerpa
@johncerpa
Jan 14 2016 00:14
target what elements
tommy
@tommygebru
Jan 14 2016 00:14
@jmesa92 a checkpoint is merely the sum of it's waypoints
jmesa92
@jmesa92
Jan 14 2016 00:14
@kirah1314 okay, so taking a step forward, it'll most likely be using if statements?
iamlimo
@iamlimo
Jan 14 2016 00:15
$("button")
$(".btn") and
Bill
@kirah1314
Jan 14 2016 00:15
@iamlimo you have to add 1 class to each here, not all 3 classes to 1 element
$("button").addClass()
$(".btn").addClass()
$("#target1").addClass("animated shake btn-primary")
iamlimo
@iamlimo
Jan 14 2016 00:15
$("#target1")
@kirah1314 thanks
CamperBot
@camperbot
Jan 14 2016 00:15
iamlimo sends brownie points to @kirah1314 :sparkles: :thumbsup: :sparkles:
:star: 822 | @kirah1314 | http://www.freecodecamp.com/kirah1314
jmesa92
@jmesa92
Jan 14 2016 00:15
@tommygebru Yeah, I usually have trouble with the checkpoints. It's rather discouraging
Bill
@kirah1314
Jan 14 2016 00:16
@jmesa92 yeah because you have to do conditional comparisons and that's what if, else if and else can do
iamlimo
@iamlimo
Jan 14 2016 00:16
@kirah1314 how do I add Only one class with each of your three selectors.
tommy
@tommygebru
Jan 14 2016 00:16
@jmesa92 take in the instructions one sentence at a time and build and share
Tony Miri
@TonyMiri
Jan 14 2016 00:16
Anybody want to tell me what I missed here?
function translate(str) {

  var vowels = ["a", "e", "i", "o", "u"];
  var indexHolder = 0;
  var igpayAtinlay = "";

  for (var i = 0; i < vowels.length; i++) {
    if(str.charAt(0) == vowels[i]) {
      return str + "way";
    } else {
      if (str.indexOf(vowels[i]) < indexHolder){
        if (str.indexOf(vowels[i]) !== -1) {
          indexHolder = str.indexOf(vowels[i]);
        }
        }
      }
   }

  igpayAtinlay = str.substring(indexHolder) + str.substring(0, indexHolder) + "ay";

  return igpayAtinlay;
}

translate("consonant");
Bill
@kirah1314
Jan 14 2016 00:17
@iamlimo well in the codes you posted, you're adding 3 classes to the 3rd selector so remove 2 classes from there and add 1 each to the other 2 selectors:
$("button").addClass()
$(".btn").addClass()
$("#target1").addClass("animated shake btn-primary")
tommy
@tommygebru
Jan 14 2016 00:17
@FatTone225 what waypoint is this?
Kenny Mark
@kennymark
Jan 14 2016 00:18
anyone figured out the queue
Davey
@dbelasco
Jan 14 2016 00:18
i think ive got it
Bill
@kirah1314
Jan 14 2016 00:18
@kennymark yes, you have to use push and shift methods
iamlimo
@iamlimo
Jan 14 2016 00:18
ok thanks @kirah1314
CamperBot
@camperbot
Jan 14 2016 00:18
iamlimo sends brownie points to @kirah1314 :sparkles: :thumbsup: :sparkles:
:warning: iamlimo already gave kirah1314 points
Tony Miri
@TonyMiri
Jan 14 2016 00:18
@tommygebru It's the Pig Latin Bonfire... aaaaand I guess I should post it in the bonfire help section lol
Tony Miri
@TonyMiri
Jan 14 2016 00:20
@tommygebru Not recently but it shows that I have finished it
jmesa92
@jmesa92
Jan 14 2016 00:21
``` if (value !== "" && prop !== tracks){
 }```  is what I have so far for Record Collection 

if (value !== "" && prop !== tracks){

}

Bill
@kirah1314
Jan 14 2016 00:22
@jmesa92 great, that's a good start!
jmesa92
@jmesa92
Jan 14 2016 00:22
@kirah1314 as long as I'm headed in the right direction, that's all I care right now! :)
tommy
@tommygebru
Jan 14 2016 00:22
@jmesa92 tracks should be a string
Kenny Mark
@kennymark
Jan 14 2016 00:23
@kirah1314 i did and it didnt work
Bill
@kirah1314
Jan 14 2016 00:23
@kennymark post your codes?
Kenny Mark
@kennymark
Jan 14 2016 00:23
@kirah1314
var myArr = [1,2,3,4,5];

function queue(arr,item) {
  // Your code here
  arr = myArr.push(1);
  item = myArr.shift();

   // Change this line
  return item;
}

// Display Code
console.log("Before: " + JSON.stringify(myArr));
console.log(queue(myArr, 6)); // Modify this line to test
console.log("After: " + JSON.stringify(myArr));
Bill
@kirah1314
Jan 14 2016 00:25
@kennymark you're trying to assign things to arr and item but you shouldn't because those are the function's parameters meaning when you call the function, you provide these arguments to the function and the function will do things using these 2 arguments
@kennymark push works like this arr.push(something);
tommy
@tommygebru
Jan 14 2016 00:26
@kirah1314 :+1:
Bill
@kirah1314
Jan 14 2016 00:27
@kennymark and you can return the array you use shift() method on to make it cleaner
Kenny Mark
@kennymark
Jan 14 2016 00:28
@kirah1314 well it didnt work
Bill
@kirah1314
Jan 14 2016 00:29
@kennymark did you try anything new? Post it?
Kenny Mark
@kennymark
Jan 14 2016 00:29
@kirah1314
var myArr = [1,2,3,4,5];

function queue(arr,item) {
  // Your code here
  myArr.push(1);
  myArr.shift();

   // Change this line
  return myArr;
}

// Display Code
console.log("Before: " + JSON.stringify(myArr));
console.log(queue(myArr, 6)); // Modify this line to test
console.log("After: " + JSON.stringify(myArr));
@kirah1314 yeah
Bill
@kirah1314
Jan 14 2016 00:29
@kennymark the waypoint wants you to push item so try that
@kennymark and just return this myArr.shift();
@kennymark if you get maximum stack then you have to refresh your browser and re-submit the solution
John Cerpa
@johncerpa
Jan 14 2016 00:32
myArr.push(item);
Kenny Mark
@kennymark
Jan 14 2016 00:32
@johncerpa i did that
John Cerpa
@johncerpa
Jan 14 2016 00:32
it's a function anyways
jmesa92
@jmesa92
Jan 14 2016 00:32
Okay, so now what I'm not understanding on Record Collection is it's "If value is non-blank (value !== "") and prop is not "tracks" then update or set the value for the prop." what would I be updating to?
Giuseppe Remolino
@SpartacusRoot
Jan 14 2016 00:33
hello i have lost in this exercise http://www.freecodecamp.com/challenges/checkpoint-counting-cards
how can I proceed?
Kenny Mark
@kennymark
Jan 14 2016 00:33
// Setup
var myArr = [1,2,3,4,5];

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


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

// Display Code
console.log("Before: " + JSON.stringify(myArr));
console.log(queue(myArr, 6)); // Modify this line to test
console.log("After: " + JSON.stringify(myArr));
John Cerpa
@johncerpa
Jan 14 2016 00:33
collection[id][prop] = value;
set the value jmesa92
Bill
@kirah1314
Jan 14 2016 00:33
@kennymark refresh browser and re-submit
John Cerpa
@johncerpa
Jan 14 2016 00:33
i think
Bill
@kirah1314
Jan 14 2016 00:34
@jmesa92 think of the words value and prop as the function parameters
John Cerpa
@johncerpa
Jan 14 2016 00:35
I don't understand when they say update
update is like
object.property = "value";
right?
assigning a new value to the property
Kenny Mark
@kennymark
Jan 14 2016 00:36
@johncerpa yes it is
@kirah1314 i did but it aint working
Bill
@kirah1314
Jan 14 2016 00:37
@SpartacusRoot post what you have here?
Caden Albaugh
@ccalbaugh
Jan 14 2016 00:37
I need either a hit on the head or just a little guidance for the Checkpoint: Record Collection
Bill
@kirah1314
Jan 14 2016 00:37
@kennymark try arr instead of myArr
Caden Albaugh
@ccalbaugh
Jan 14 2016 00:37

function update(id, prop, value) {
if (id.prop !== "tracks" && id.value !== "") {

id.prop = this.prop;
id.value = this.value;
collection.push(id.prop, id.value);

} else if (id.prop === "tracks" && id.value !== "") {

tracks.push(id.value);

} else if (id.value === "") {

delete id.value;

}

return collection;
}

Giuseppe Remolino
@SpartacusRoot
Jan 14 2016 00:37

@kirah1314
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
cc(2); cc(3); cc(4); cc(5); cc(6);

Caden Albaugh
@ccalbaugh
Jan 14 2016 00:38
there's the code. If anyone could tell me where I'm being stupid I'd greatly appreciate it :D
Bill
@kirah1314
Jan 14 2016 00:38
@SpartacusRoot you didn't do anything yet? Do you have question about it?
John Cerpa
@johncerpa
Jan 14 2016 00:38
explain format
CamperBot
@camperbot
Jan 14 2016 00:38

:point_right: code formatting [wiki]

Inline code

This an inline `<paste code here>` code formatting with a single backtick(`) at start and end around the code.

Code Block

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

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

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

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

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

Jade Xiao
@jadexiao
Jan 14 2016 00:39
@ccalbaugh try using the bracket notation instead of dot notation
John Cerpa
@johncerpa
Jan 14 2016 00:40
@ccalbaugh use ```
Caden Albaugh
@ccalbaugh
Jan 14 2016 00:41
Use single quotes?
@jadexiao tried bracket notation, unfortunately it still just returns an empty object. Any other thoughts?
Should I not be using "this" here?
John Cerpa
@johncerpa
Jan 14 2016 00:42
it says
update and set the value
they mean
Nick Hester
@nickhstr
Jan 14 2016 00:42
Hey guys! I'm stuck on Waypoint: Return Early Pattern for Functions.
John Cerpa
@johncerpa
Jan 14 2016 00:42
collection[id][prop] = value;
Related2Glory
@Related2Glory
Jan 14 2016 00:42
Hey guys anyone mind helping me with beginner code?
Nick Hester
@nickhstr
Jan 14 2016 00:43
I think my code is fine, but let's see what you guys think:

// Setup
function abTest(a, b) {
// Only change code below this line
if (a < 0 || b < 0) {
return "undefined";
}

// Only change code above this line

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

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

Giuseppe Remolino
@SpartacusRoot
Jan 14 2016 00:43
@kirah1314 Yes, how i add the count of card and global variable count?
and in this exercise i have to assign at some cards value of +1 and at another the value of -1
Nick Hester
@nickhstr
Jan 14 2016 00:43
Testing has shown correct values in the console.
Caden Albaugh
@ccalbaugh
Jan 14 2016 00:43
@johncerpa wow of course they do...I knew it was a stupid reading error
@johncerpa thanks much!
CamperBot
@camperbot
Jan 14 2016 00:43
ccalbaugh sends brownie points to @johncerpa :sparkles: :thumbsup: :sparkles:
:star: 234 | @johncerpa | http://www.freecodecamp.com/johncerpa
John Cerpa
@johncerpa
Jan 14 2016 00:43
no problem
Scott Brenner
@ScottBrenner
Jan 14 2016 00:43
@nickhstr I just did that one! It wants you to return undefined, not the string "undefined".
Bill
@kirah1314
Jan 14 2016 00:44
@SpartacusRoot yes you have to make changes to count based on your cards
Nick Hester
@nickhstr
Jan 14 2016 00:44
Boy do I feel silly, haha. Thanks, @ScottBrenner
CamperBot
@camperbot
Jan 14 2016 00:44
nickhstr sends brownie points to @scottbrenner :sparkles: :thumbsup: :sparkles:
:star: 216 | @scottbrenner | http://www.freecodecamp.com/scottbrenner
Scott Brenner
@ScottBrenner
Jan 14 2016 00:45
:thumbsup: :thumbsup:
Nicolas Londoño
@Darkoyd
Jan 14 2016 00:45
Hey guys, im new here. Im stuck trying to prioritize a style over another in HTLM5. Halp plz?
Related2Glory
@Related2Glory
Jan 14 2016 00:45
"Your img element should have the class thick-green-border." I cannot seem to get this one right
George Slade
@GeorgeSlade1
Jan 14 2016 00:45
Good evening hate to bother you guys with this but can someone help with this challenge: Nest three button elements within each of your div elements with class well.
<div class="container-fluid">
<h3 class="text-primary text-center">jQuery Playground</h3>
<div class="row">
<div class="col-xs-6">
<div class="well">
<label><button type="radio" name="color">Red</button></label>
<label><button type="radio" name="color">Blue</button></label>
<label><button type="radio" name="color">Green</button></label>
</div>
</div>
<div class="col-xs-6">
<div class="well">
<label><button type="checkbox" name="music">Wu-Tang</button></label>
<label><button type="checkbox" name="music">Will Smith</button></label>
<label><button type="checkbox" name="music">Jay-Z</button></label>
</div>
</div>
</div>
</div>
Giuseppe Remolino
@SpartacusRoot
Jan 14 2016 00:45
@kirah1314 how? :\
Eina
@thelittleblacksmith
Jan 14 2016 00:46
@Darkoyd what's the waypoint name and the solution you have?
Scott Brenner
@ScottBrenner
Jan 14 2016 00:47
@Related2Glory What does your code look like?
John Cerpa
@johncerpa
Jan 14 2016 00:47
@GeorgeSlade1 what excercise
Bill
@kirah1314
Jan 14 2016 00:47
@SpartacusRoot how to make changes to count? count++ or count--
Nicolas Londoño
@Darkoyd
Jan 14 2016 00:47
@thelittleblacksmith Waypoint: Prioritize One Style Over Another

@thelittleblacksmith Create a CSS class called pink-text that gives an element the color pink.

Give your h1 element the class of pink-text.

George Slade
@GeorgeSlade1
Jan 14 2016 00:48
@johncerpa Waypoint: Add Elements within your Bootstrap Wells
Related2Glory
@Related2Glory
Jan 14 2016 00:48
Anyone mind helping me with Waypoint: Size your Images? Whats the correct way to size width of border?
John Cerpa
@johncerpa
Jan 14 2016 00:48
<div class="container-fluid">
  <h3 class="text-primary text-center">jQuery Playground</h3>
  <div class="row">
    <div class="col-xs-6">
      <div class="well">
        <button></button>
        <button></button>
        <button></button>

      </div>
    </div>
    <div class="col-xs-6">
      <div class="well">
        <button></button>
        <button></button>
        <button></button>


      </div>
    </div>
  </div>
</div>
Eina
@thelittleblacksmith
Jan 14 2016 00:49
@Darkoyd you need to make a class called pink-text, then give your h1 a class of pink-text
John Cerpa
@johncerpa
Jan 14 2016 00:49
shoud be like that
Andrew Charlebois
@andrewchar
Jan 14 2016 00:49

stuck on waypoint:create a form element this is what i have., not sure what to do .. my code is

<form action="/submit-cat-photo"></form>

John Cerpa
@johncerpa
Jan 14 2016 00:49
inside the div and class = "well"
is that okay?
George Slade
@GeorgeSlade1
Jan 14 2016 00:50
it looks similar to what i have so I have to examine and see
thank you for your help
John Cerpa
@johncerpa
Jan 14 2016 00:50
just the buttons
Eina
@thelittleblacksmith
Jan 14 2016 00:50
@Darkoyd does that make sense?
John Cerpa
@johncerpa
Jan 14 2016 00:50
don't anything yet
don't add anything yet
George Slade
@GeorgeSlade1
Jan 14 2016 00:50
ok
wow
speechless
John Cerpa
@johncerpa
Jan 14 2016 00:51
haha
good?
@andrewchar what is it
Nicolas Londoño
@Darkoyd
Jan 14 2016 00:51
@thelittleblacksmith Did that, applied the class, text is still green
George Slade
@GeorgeSlade1
Jan 14 2016 00:51
thank you @johncerpa
CamperBot
@camperbot
Jan 14 2016 00:51
georgeslade1 sends brownie points to @johncerpa :sparkles: :thumbsup: :sparkles:
:star: 235 | @johncerpa | http://www.freecodecamp.com/johncerpa
Eina
@thelittleblacksmith
Jan 14 2016 00:51
@Darkoyd can i see your code?
Petar
@Petar81
Jan 14 2016 00:52

can someone help me with palindromes zipline? I've been stuck for some time now...here is my code:

function palindrome(str) {
// Good luck!
function novaFunkcija(match){
return match.toLowerCase();
}

var newString = str.replace(/\W+/g, novaFunkcija);

return newString;

}
palindrome("eye");

Eina
@thelittleblacksmith
Jan 14 2016 00:52
@Darkoyd just copy paste it here
Nicolas Londoño
@Darkoyd
Jan 14 2016 00:52

<style>

body {
background-color: black;
font-family: Monospace;
color: green;
}

pink-text{
color: pink;
}

</style>

<h1 class="pink-text">Hello World!</h1>

Benjamin Starling
@bstarling
Jan 14 2016 00:52
@andrewchar you need a field for input to be put into your form.
<form action = "/submit-cat-photo'>
<input type ="text" placeholder="cat photo URL">
</form>
Eina
@thelittleblacksmith
Jan 14 2016 00:52
@Darkoyd when you're styling classes in CSS, you have to add . before the name of the class
so you need to add a dot before pink-text inside the style tag
.classname {
Nicolas Londoño
@Darkoyd
Jan 14 2016 00:53
Oh... thats right @thelittleblacksmith Thanks!
CamperBot
@camperbot
Jan 14 2016 00:53
darkoyd sends brownie points to @thelittleblacksmith :sparkles: :thumbsup: :sparkles:
:star: 280 | @thelittleblacksmith | http://www.freecodecamp.com/thelittleblacksmith
Andrew Charlebois
@andrewchar
Jan 14 2016 00:54
@nigeltea thank you! i didnt understand what they were talking about when they said i need text input
CamperBot
@camperbot
Jan 14 2016 00:54
andrewchar sends brownie points to @nigeltea :sparkles: :thumbsup: :sparkles:
:star: 290 | @nigeltea | http://www.freecodecamp.com/nigeltea
jmesa92
@jmesa92
Jan 14 2016 00:55
I think I finally have an outline for Record collection
// Only change code below this line
function update(id, prop, value) {
     if (value !== "" && prop !== "tracks"){

     }else if(value !== "" && prop == "tracks"){

     }else if(value == ""){

     }
     }

  return collection;
}
John Cerpa
@johncerpa
Jan 14 2016 00:55
you should update the value
if the first condition is true
Benjamin Starling
@bstarling
Jan 14 2016 00:57
@jmesa92 looks like a good start. Now you need to add the logic for each condition.
jmesa92
@jmesa92
Jan 14 2016 00:58
@nigeltea the logic is where I'm having a bit of trouble. But I'll get there
Benjamin Starling
@bstarling
Jan 14 2016 01:00
@jmesa92 yup! The framework is good though, IMO that's the hard part. Now it's just a matter of figuring out the syntax to do what you want to do.
John Cerpa
@johncerpa
Jan 14 2016 01:02
why
sinsukh
@sinsukh
Jan 14 2016 01:02
function checkObj(checkProp) {
return myObj.hasOwnProperty(checkProp);
}
John Cerpa
@johncerpa
Jan 14 2016 01:02
the else if is checking the same
sinsukh
@sinsukh
Jan 14 2016 01:02
need help with testing objects for properties
John Cerpa
@johncerpa
Jan 14 2016 01:03
don't see anything wrong
hmmn
what exercise?
jonlikesapples
@jonlikesapples
Jan 14 2016 01:05
what does it mean when my directions say "Give the text input in your form the class form-control."
:/
John Cerpa
@johncerpa
Jan 14 2016 01:05
<input class="form-control"></input>
sinsukh
@sinsukh
Jan 14 2016 01:05
Testing Objects For Properties @johncerpa
DJ
@qualitymanifest
Jan 14 2016 01:06
@Singhsukh if i remember correctly you need to check to see if myObj has the property checkProp (just like you did), and if it does, return checkProp
jonlikesapples
@jonlikesapples
Jan 14 2016 01:06
oo
i see
Benjamin Starling
@bstarling
Jan 14 2016 01:06
@Singhsukh hasOwnProperty() just returns true/false not the actual value. Once you have confirmed the property exists with .hasOwnProperty you should return using this sytax object[property]
John Cerpa
@johncerpa
Jan 14 2016 01:06
you need an if/else statement
sinsukh
@sinsukh
Jan 14 2016 01:06
It worked. Thanks guys @qualitymanifest @nigeltea @johncerpa
CamperBot
@camperbot
Jan 14 2016 01:06
singhsukh sends brownie points to @qualitymanifest and @nigeltea and @johncerpa :sparkles: :thumbsup: :sparkles:
:star: 291 | @nigeltea | http://www.freecodecamp.com/nigeltea
:star: 784 | @qualitymanifest | http://www.freecodecamp.com/qualitymanifest
:star: 236 | @johncerpa | http://www.freecodecamp.com/johncerpa
jonlikesapples
@jonlikesapples
Jan 14 2016 01:07
actually still lost
I take that back :P
Currently a Stick
@MackenzieCole
Jan 14 2016 01:08
Hey ya'll any idea where they want me to the class "form-control"?
Waypoint:Style Text Input as Form Controls
Giuseppe Remolino
@SpartacusRoot
Jan 14 2016 01:09

@kirah1314
`

var count = 0;

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

if (card > 0 && 2 && 3 && 4 && 5 && 6){
return count++ + " Bet";
} else if (card <= 0 && "J" && "Q" && "K" && "A" && 10){
return count-- + " Hold";
}

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

// Add/remove calls to test your function.
// Note: Only the last will display
cc(2); cc(3); cc(4); cc(5); cc(6);
`

Zach048
@Zach048
Jan 14 2016 01:10
Hey guys, my CatPhotoApp is colored red on the phone but I'm still receiving the your h2 element should be red error...
Benjamin Starling
@bstarling
Jan 14 2016 01:10
@MackenzieCole it should be a class associated with the <input> element.
@Zach048 paste your code?
John Cerpa
@johncerpa
Jan 14 2016 01:11
@SpartacusRoot use switch
iamlimo
@iamlimo
Jan 14 2016 01:11
hello
John Cerpa
@johncerpa
Jan 14 2016 01:12
hi
Zach048
@Zach048
Jan 14 2016 01:12

<h2><h2 style="color:red">CatPhotoApp</h2>

<p>Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.</p>

DJ
@qualitymanifest
Jan 14 2016 01:13
@Zach048 extra opening h2 tag
Benjamin Starling
@bstarling
Jan 14 2016 01:13
you have a redundant <h2> tag
all you need is <h2 style="color:red">CatPhotoApp</h2>
Zach048
@Zach048
Jan 14 2016 01:15
Ok I got it, the fact it was already colored red even with the redundant tag was tripping me up. Thank you.
Pranay Kothapalli
@kotAPI
Jan 14 2016 01:15
function convert(celsius) {
  // Only change code below this line
  var fahrenheit = celcius*(9/5) + 32;

  // Only change code above this line
  if ( typeof fahrenheit !== 'undefined' ) {
  return fahrenheit;
  } else {
    return 'fahrenheit not defined';
  }
}

// Change the inputs below to test your code
convert(30);
Anything wrong with this? I see it returning {}
Benjamin Starling
@bstarling
Jan 14 2016 01:16
@Zach048 Yeah browsers have all kinds of recovery built in, you can create malformed html and it still "looks like it works". Tricky sometimes when you are testing.
DJ
@qualitymanifest
Jan 14 2016 01:16
This message was deleted
disregard that :wink2:
Pranay Kothapalli
@kotAPI
Jan 14 2016 01:17
haha
damn, i cant seem to find what the problem is
Zach048
@Zach048
Jan 14 2016 01:18
Thanks, is there a way to give out stars or props to users who have helped me on this cat?
DJ
@qualitymanifest
Jan 14 2016 01:18
@kotAPI function convert(celsius) { celcius is spelled wrong
Zach048
@Zach048
Jan 14 2016 01:18
chat*
DJ
@qualitymanifest
Jan 14 2016 01:18
@kotAPI oops again.
@kotAPI it's spelled right in the function but not in your typeof
Pranay Kothapalli
@kotAPI
Jan 14 2016 01:19
oh god, i feel so dumb
@qualitymanifest thanks!! :D
CamperBot
@camperbot
Jan 14 2016 01:19
kotapi sends brownie points to @qualitymanifest :sparkles: :thumbsup: :sparkles:
:star: 785 | @qualitymanifest | http://www.freecodecamp.com/qualitymanifest
Giuseppe Remolino
@SpartacusRoot
Jan 14 2016 01:19
@qualitymanifest help me with this exercise? http://www.freecodecamp.com/challenges/checkpoint-counting-cards
DJ
@qualitymanifest
Jan 14 2016 01:19
@kotAPI naw dont worry i thought it should be spelled celcius too haha
Benjamin Starling
@bstarling
Jan 14 2016 01:19
@kotAPI check your spelling of celsius :)
DJ
@qualitymanifest
Jan 14 2016 01:20
@SpartacusRoot if you have code just post it and someone will help
Pranay Kothapalli
@kotAPI
Jan 14 2016 01:20
@qualitymanifest , its actually one of the most misspelled words, haha, my bad
Giuseppe Remolino
@SpartacusRoot
Jan 14 2016 01:20

@qualitymanifest var count = 0;

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

case card == 2:
case card == 3:
case card == 4:
case card == 5:
case card == 6:
card = card++ + " Bet";
break;

}

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(4); cc(5); cc(6);

Benjamin Starling
@bstarling
Jan 14 2016 01:20
@Zach048 you do it by putting the work thanks in a chat with someone's name using the @ sign
CamperBot
@camperbot
Jan 14 2016 01:20
nigeltea sends brownie points to @zach048 :sparkles: :thumbsup: :sparkles:
:star: 14 | @zach048 | http://www.freecodecamp.com/zach048
John Cerpa
@johncerpa
Jan 14 2016 01:21
spartacus
case1:
case 1:
do something;
Benjamin Starling
@bstarling
Jan 14 2016 01:22
@SpartacusRoot this problem requires 2 pieces. 1)Keep track of the "count". 2) return bet or hold based on the count. Keeping track of the count is most easily done using case statements. Then an you can use if statement to return count + Bet or hold.
Zach048
@Zach048
Jan 14 2016 01:24
Thanks @nigeltea
CamperBot
@camperbot
Jan 14 2016 01:24
zach048 sends brownie points to @nigeltea :sparkles: :thumbsup: :sparkles:
:star: 292 | @nigeltea | http://www.freecodecamp.com/nigeltea
Alex M
@wdadventure
Jan 14 2016 01:25
Hey guys, quick question. In lesson 138 (Javascript 12), I think there is a bug or something... Can someone else try it? its super easy, just an increment exercise. I write myVar = myVar++; and it gives me an error. I also tried myVar = ++myVar; - same error. Can someone else try it and see if the system lets you through this question? Thanks,
Giuseppe Remolino
@SpartacusRoot
Jan 14 2016 01:26
@nigeltea sorry but i can understand how i can count the global variable count in the switch statement or in a function statement?
Bill
@kirah1314
Jan 14 2016 01:26
@wdadventure try just myVar++; which is short for myVar = myVar++;
John Cerpa
@johncerpa
Jan 14 2016 01:26
myVar = myVar + 1;
Giuseppe Remolino
@SpartacusRoot
Jan 14 2016 01:26
@wdadventure myVar++;
Alex M
@wdadventure
Jan 14 2016 01:26
ohh, dah! thanks kirah and spartacus
John Cerpa
@johncerpa
Jan 14 2016 01:27
myVar++ is the same as myVar = myVar + 1
Teleisha Hall
@hallnt
Jan 14 2016 01:28
@R0k0 ok great! same here
Benjamin Starling
@bstarling
Jan 14 2016 01:28
switch(card){
case 1:
case 2:
case 3:
 count = count +1;
 break;
case 4:
case 5:
 count = count + 1;
 break;
is a general outline @SpartacusRoot
Giuseppe Remolino
@SpartacusRoot
Jan 14 2016 01:34

@nigeltea

var count = 0;

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

   case card == 2:
   case card == 3:
   case card == 4:
   case card == 5:
   case card == 6:
     card = card +1;
     break;
   case card == 10:
   case card == "J":
   case card == "Q":
   case card == "K":
   case card == "A":
     card = card-1;

   case card = 7:
   case card = 8:
   case card = 9:
     card = 0;

 }

  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(4); cc(5); cc(6);

nothing , i hate this execirse :\

John Cerpa
@johncerpa
Jan 14 2016 01:35
getting there
case 7 8 9
erase that
Pranay Kothapalli
@kotAPI
Jan 14 2016 01:36
var myStr = '\\ \t \r \n'; // Change this line
Any idea what i'm doin wrong? :D
John Cerpa
@johncerpa
Jan 14 2016 01:36
add the break
This message was deleted
count--;
break;
mecotterman
@mecotterman
Jan 14 2016 01:36
I'm on Waypoint: Assignment with a Returned Value and I'm confused on how I have process assigned to processed AND return a value of 2. Should I do something with num?
Benjamin Starling
@bstarling
Jan 14 2016 01:36
@SpartacusRoot getting there! put the case statements in order & you want to change the count not card
John Cerpa
@johncerpa
Jan 14 2016 01:37
oh true
DJ
@qualitymanifest
Jan 14 2016 01:38
@kotAPI need to have 2 tabs
Benjamin Starling
@bstarling
Jan 14 2016 01:38
@kotAPI double check instructions. Should be 2 tabs in a row backslash tab tab carriage-return new-line
Pranay Kothapalli
@kotAPI
Jan 14 2016 01:39
oh yeah, sorry @qualitymanifest @nigeltea thanks!
CamperBot
@camperbot
Jan 14 2016 01:39
kotapi sends brownie points to @qualitymanifest and @nigeltea :sparkles: :thumbsup: :sparkles:
:warning: kotapi already gave qualitymanifest points
John Cerpa
@johncerpa
Jan 14 2016 01:39
@mecotterman paste the code
CamperBot
@camperbot
Jan 14 2016 01:39
:star: 293 | @nigeltea | http://www.freecodecamp.com/nigeltea
Giuseppe Remolino
@SpartacusRoot
Jan 14 2016 01:39
```
var count = 0;

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

   case card == 2:
   case card == 3:
   case card == 4:
   case card == 5:
   case card == 6:
     count++;
     break;
   case card == 10:
   case card == "J":
   case card == "Q":
   case card == "K":
   case card == "A":
     count--;
    break;


 }

  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(4); cc(5); cc(6);
John Cerpa
@johncerpa
Jan 14 2016 01:39
case 1:
mecotterman
@mecotterman
Jan 14 2016 01:40

I'm struggling to understand the concept. This is the example code and I don't know how it relates to what they want me to do:
var processed = 0;

function process(num) {
return (num + 3) / 5;
}
Instructions:
Call the process function with an argument of 7 and assign its return value to the variable processed.

John Cerpa
@johncerpa
Jan 14 2016 01:40
case 1:
case 2:
case 3:
    count++;
    break;
that's an example
processed = process(7)
// Setup
var processed = 0;

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

// Only change code below this line
processed = process(7);
console.log(processed);
just use the function
Giuseppe Remolino
@SpartacusRoot
Jan 14 2016 01:42
@johncerpa the function don't recognize the global variable "count" in the function
i give up
John Cerpa
@johncerpa
Jan 14 2016 01:42
no dude
you should have this
var count = 0;

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

    case 2:
    case 3:
    case 4:
    case 5:
    case 6:  
      count++;
      break;
then this
   case 10:
    case 'J':
    case 'Q':
    case 'K':
    case 'A':
      count--;
      break;
and then the conditions
mecotterman
@mecotterman
Jan 14 2016 01:44
Thanks! @johncerpa - I got too caught up in their other written example and couldn't see the forest for the trees
CamperBot
@camperbot
Jan 14 2016 01:44
mecotterman sends brownie points to @johncerpa :sparkles: :thumbsup: :sparkles:
:star: 237 | @johncerpa | http://www.freecodecamp.com/johncerpa
John Cerpa
@johncerpa
Jan 14 2016 01:46
no problem
Giuseppe Remolino
@SpartacusRoot
Jan 14 2016 01:51

@johncerpa ```

var count = 0;

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

case card == 2:
case card == 3:
case card == 4:
case card == 5:
case card == 6:
count++;
break;
case card == 10:
case card == "J":
case card == "Q":
case card == "K":
case card == "A":
count--;
break;

}

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

Melissa Austin
@MAustinMMDP
Jan 14 2016 01:52
Can anyone tell me what I am doing wrong?
//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": ["Intruiging Cases", "Violin"]
    },
    {
        "firstName": "Kristian",
        "lastName": "Vos",
        "number": "unknown",
        "likes": ["Javascript", "Gaming", "Foxes"]
    },
];


function lookUp( firstName, prop ) {
// Only change code below this line
  for (var i = 0; i < contacts.length; i++) {
      if (contacts[i][firstName] === firstName && contacts[i][prop]) {
        return contacts[i][prop];
      } else if (contacts[i].firstName !== firstName) {
        return "No such contact";
      } else if (!contacts[i][prop]) {
        return "No such property";
      }
    }

// Only change code above this line
}

// Change these values to test your function
lookUp("Kristian", "lastName");
John Cerpa
@johncerpa
Jan 14 2016 01:52
@SpartacusRoot dude I just fixed it for you
var count = 0;

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

    case 2:
    case 3:
    case 4:
    case 5:
    case 6:  
      count++;
      break;

    case 10:
    case 'J':
    case 'Q':
    case 'K':
    case 'A':
      count--;
      break;

  }

  if (count > 0) {

    return count + " Bet";

  } else {

    return count + " Hold";

  }

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

// Add/remove calls to test your function.
// Note: Only the last will display
cc(2); cc(3); cc(7); cc('K'); cc('A');
first of all
you only need to conditions
two*
Melissa Austin
@MAustinMMDP
Jan 14 2016 01:53
I need to return the value of the prop
if both the firstName and prop are true
John Cerpa
@johncerpa
Jan 14 2016 01:54
yeah
wait
you need to check if firstName is an actual contact's firstName
if (contacts[i].firstName === firstName) {
and if the given property (prop) is a property of that contact.
if (contacts[i].hasOwnProperty(prop)) {
if those conditions are true then return condition[i][prop]
shoud look like this
  for (var i = 0; i < contacts.length; i++) {


    if (contacts[i].firstName === firstName) {

      if (contacts[i].hasOwnProperty(prop)) {

        return contacts[i][prop];

      } else {

        return "No such property";

      }
Melissa Austin
@MAustinMMDP
Jan 14 2016 01:58
I see ... thanks I had completely forgot about the hasOwnProperty method.
Giuseppe Remolino
@SpartacusRoot
Jan 14 2016 01:58
@nigeltea and @johncerpa thanks !!! it's works
CamperBot
@camperbot
Jan 14 2016 01:58
spartacusroot sends brownie points to @nigeltea and @johncerpa :sparkles: :thumbsup: :sparkles:
:star: 294 | @nigeltea | http://www.freecodecamp.com/nigeltea
:star: 238 | @johncerpa | http://www.freecodecamp.com/johncerpa
Benjamin Starling
@bstarling
Jan 14 2016 01:59
@SpartacusRoot Awesome, glad you got it! That one is a very tough one, great you stuck with it.
John Cerpa
@johncerpa
Jan 14 2016 02:00
good :)
Giuseppe Remolino
@SpartacusRoot
Jan 14 2016 02:00
@nigeltea i have lost 2 hours with it, thanks you @johncerpa
CamperBot
@camperbot
Jan 14 2016 02:00
spartacusroot sends brownie points to @nigeltea and @johncerpa :sparkles: :thumbsup: :sparkles:
:warning: spartacusroot already gave johncerpa points
:warning: spartacusroot already gave nigeltea points
John Cerpa
@johncerpa
Jan 14 2016 02:01
hahahah same thing happened to me
but with the profile lookup
Benjamin Starling
@bstarling
Jan 14 2016 02:02
Don't think of it as lost time. You learn a lot by struggling with the lessons. Most important part of learning to code is persistence.
John Cerpa
@johncerpa
Jan 14 2016 02:02
true
wise words
nebunic
@nebunic
Jan 14 2016 02:04
how could I check an array of objects if there is a certain value in it?
John Cerpa
@johncerpa
Jan 14 2016 02:05
use the hasOwnProperty method
function
Giuseppe Remolino
@SpartacusRoot
Jan 14 2016 02:05
@nigeltea yes sure , i have finished the path of javascript on codeacademy years ago but on freecodecampus it's too full, good
Ron
@rphill03
Jan 14 2016 02:05

Need advice or tips with Checkpoint: Profile Lookup
"We have an array of objects representing different people in our contacts lists.

A lookUp function that takes firstName and a property (prop) as arguments has been pre-written for you.

The function should check if firstName is an actual contact's firstName and the given property (prop) is a property of that contact.

If both are true, then return the "value" of that property.

If firstName does not correspond to any contacts then return "No such contact"

If prop does not correspond to any valid properties then return "No such property"
"

//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": ["Intruiging Cases", "Violin"]
    },
    {
        "firstName": "Kristian",
        "lastName": "Vos",
        "number": "unknown",
        "likes": ["Javascript", "Gaming", "Foxes"]
    },
];


function lookUp(firstName, prop){
// Only change code below this line
 for (var i in contacts) 
 {
  if (contacts[i].firstName === firstName && contacts[i].firstName.prop !== "")
  {
    return contacts[i][prop];

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

   else
     {
       return "No such property";                       
     }
 }
// Only change code above this line
}

// Change these values to test your function
lookUp("Akira", "likes");
```
Benjamin Starling
@bstarling
Jan 14 2016 02:06
@SpartacusRoot Yup, I've had several false starts myself & FCC is great. Hoping I can stay motivated this time! Chat is great for that.
Ron
@rphill03
Jan 14 2016 02:06
Close ..it works for Akira but I can't find where I went wrong .. the rest return "No such property" which indicates it is not looping through the rest of Contacts maybe?
John Cerpa
@johncerpa
Jan 14 2016 02:07
for loop is wrong
for(var i = 0;  i < contacts.length; i++) {

}
B. Garber
@TheBGar
Jan 14 2016 02:08
@nebunic Hey! Is this for a specific FCC waypoint?
Ron
@rphill03
Jan 14 2016 02:09
I've tried that and it still fails .. only passes for when Name and property doesn't exist ..the rest still fail
nebunic
@nebunic
Jan 14 2016 02:09
@TheBGar it was, but I figured it out :D
Ron
@rphill03
Jan 14 2016 02:09
there has to be something else I'm overlooking
B. Garber
@TheBGar
Jan 14 2016 02:09
@nebunic Just wanted to follow up and make sure you got help!
nebunic
@nebunic
Jan 14 2016 02:09
@TheBGar heh, thank you ^^
CamperBot
@camperbot
Jan 14 2016 02:09
nebunic sends brownie points to @thebgar :sparkles: :thumbsup: :sparkles:
:star: 234 | @thebgar | http://www.freecodecamp.com/thebgar
B. Garber
@TheBGar
Jan 14 2016 02:10
@nebunic you bet
John Cerpa
@johncerpa
Jan 14 2016 02:10
try this
Ron
@rphill03
Jan 14 2016 02:10
function lookUp(firstName, prop){
// Only change code below this line
 for (var i = 0; i < contacts.length; i++) 
 {
  if (contacts[i].firstName === firstName && contacts[i].firstName.prop !== "")
  {
    return contacts[i][prop];

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

   else
     {
       return "No such property";                       
     }
 }
// Only change code above this line
}

// Change these values to test your function
lookUp("Akira", "likes");
John Cerpa
@johncerpa
Jan 14 2016 02:10
if (contacts[i].firstName === firstName) {

      if (contacts[i].hasOwnProperty(prop)) {

        return contacts[i][prop];
figure out what comes next
Benjamin Starling
@bstarling
Jan 14 2016 02:10
@rphill03 @johncerpa I think that shorthand will work in this case. Two things i see hasOwnProperty() may be helpful for you. Make sure you are not returning "no such contact" until the whole loop is completed.
nebunic
@nebunic
Jan 14 2016 02:10
how does one paste code from FCC like that? :-?
Ron
@rphill03
Jan 14 2016 02:10
three back ticks
Benjamin Starling
@bstarling
Jan 14 2016 02:11
format wiki
help format
CamperBot
@camperbot
Jan 14 2016 02:11

:point_right: code formatting [wiki]

Inline code

This an inline `<paste code here>` code formatting with a single backtick(`) at start and end around the code.

Code Block

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

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

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

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

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

nebunic
@nebunic
Jan 14 2016 02:11

```// Example
function ourFunction(ourMin, ourMax) {

return Math.floor(Math.random() * (ourMax - ourMin + 1)) + ourMin;
}

ourFunction(1, 9);

// Only change code below this line.

function randomRange(myMin, myMax) {

return 0; // Change this line

}

// Change these values to test your function
var myRandom = randomRange(5, 15);
```

Jennifer Linkenauger
@jlinkenauger
Jan 14 2016 02:11
Waypoint: Nesting For Loops, not returning values, what do I need to fix
function multiplyAll(arr) {
  var product = 1;
  // Only change code below this line
  for (var i=0; i<arr.length; i++){
    product= product * arr[i];
    }
  }
  // Only change code above this line
  return product;
}

// Modify values below to test your code
multiplyAll([[1],[2],[3]]);
Ron
@rphill03
Jan 14 2016 02:12
@johncerpa and @nigeltea thanks for the tips I will fight with it a bit more
CamperBot
@camperbot
Jan 14 2016 02:12
rphill03 sends brownie points to @johncerpa and @nigeltea :sparkles: :thumbsup: :sparkles:
:star: 295 | @nigeltea | http://www.freecodecamp.com/nigeltea
:star: 239 | @johncerpa | http://www.freecodecamp.com/johncerpa
John Cerpa
@johncerpa
Jan 14 2016 02:13
hmmn
there should be two for loops
here's an example
nebunic
@nebunic
Jan 14 2016 02:13
// Example
function ourFunction(ourMin, ourMax) {

  return Math.floor(Math.random() * (ourMax - ourMin + 1)) + ourMin;
}

ourFunction(1, 9);

// Only change code below this line.

function randomRange(myMin, myMax) {

  return 0; // Change this line

}

// Change these values to test your function
var myRandom = randomRange(5, 15);
John Cerpa
@johncerpa
Jan 14 2016 02:13
var arr = [
  [1,2], [3,4], [5,6]
];
for (var i=0; i < arr.length; i++) {
  for (var j=0; j < arr[i].length; j++) {
    console.log(arr[i][j]);
  }
}
nebunic
@nebunic
Jan 14 2016 02:13
ahhh, figured it out :D
Jennifer Linkenauger
@jlinkenauger
Jan 14 2016 02:15
@johncerpa so I tried that exact thing before and it didn't pass
John Cerpa
@johncerpa
Jan 14 2016 02:15
for (var i = 0; i < arr.length; i++) {

    for (var j = 0; j < arr[i].length; j++) {
then multiply product
product * arr[i][j]
Nick Hester
@nickhstr
Jan 14 2016 02:16
Hey guys! I can't seem to get a hang of Checkpoint: Record Collection. Does anyone have some insight on what I'm doing wrong?
// Setup
var collection = {
    2548: {
      album: "Slippery When Wet",
      artist: "Bon Jovi",
      tracks: [ 
        "Let It Rock", 
        "You Give Love a Bad Name" 
      ]
    },
    2468: {
      album: "1999",
      artist: "Prince",
      tracks: [ 
        "1999", 
        "Little Red Corvette" 
      ]
    },
    1245: {
      artist: "Robert Palmer",
      tracks: [ ]
    },
    5439: {
      album: "ABBA Gold"
    }
};
// Keep a copy of the collection for tests
var collectionCopy = JSON.parse(JSON.stringify(collection));

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

  return collection;
}

// Alter values below to test your code
update(5439, "artist", "ABBA");
John Cerpa
@johncerpa
Jan 14 2016 02:17
This message was deleted
This message was deleted
This message was deleted
This message was deleted
first condition
should look like this
if(value !== "") {
    if(prop === "tracks") {

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

      collection[id][prop] = value;
Jennifer Linkenauger
@jlinkenauger
Jan 14 2016 02:19
@nickhstr on the first if statement (prop === "tracks)
John Cerpa
@johncerpa
Jan 14 2016 02:20
did it work? @jlinkenauger
Melissa Austin
@MAustinMMDP
Jan 14 2016 02:21
Same issue as before but now only one test fails which is lookup("Bob", "number");. For some reason the test returns an empty string. Anyone know why?
//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": ["Intruiging Cases", "Violin"]
    },
    {
        "firstName": "Kristian",
        "lastName": "Vos",
        "number": "unknown",
        "likes": ["Javascript", "Gaming", "Foxes"]
    },
];


function lookUp( firstName, prop ) {
// Only change code below this line
  for (var i = 0; i < contacts.length; i++) {
      if (contacts[i].firstName === firstName) {
        if (contacts[i].hasOwnProperty(prop)) {
        return contacts[i][prop];
      } else if (contacts[i].firstName !== firstName) {
        return "No such contact";
      } else if (!contacts[i][prop]) {
        return "No such property";
      }
    }
  }

// Only change code above this line
}

// Change these values to test your function
lookUp("Bob", "number");
John Cerpa
@johncerpa
Jan 14 2016 02:22
there should be two if statements
return "No such contact"
should be out of the for loop
and return "No such property"
Jennifer Linkenauger
@jlinkenauger
Jan 14 2016 02:22
this is what i ended up with and its a no go
John Cerpa
@johncerpa
Jan 14 2016 02:22
should be in an else statement
Jennifer Linkenauger
@jlinkenauger
Jan 14 2016 02:23
@johncerpa
function multiplyAll(arr) {
  var product = 1;
  // Only change code below this line
  for (var i=0; i < arr.length; i++) {
  for (var j=0; j < arr[i].length; j++) {
    console.log(arr[i][j]);
    product = product * arr[i][j];
  }
  // Only change code above this line
  return product;
}
Melissa Austin
@MAustinMMDP
Jan 14 2016 02:23
So, no need to iterate through the array?
John Cerpa
@johncerpa
Jan 14 2016 02:23
if (contacts[i].firstName === firstName) {

      if (contacts[i].hasOwnProperty(prop)) {

        return contacts[i][prop];

      } else {

        return "No such property";
Benjamin Starling
@bstarling
Jan 14 2016 02:24
@MAustinMMDP Your logic is slightly out of order. Here is my psuedo code breaking down the problem.
  • Loop through each contact (for loop)
  • if firstName == object.firstName
    • check properties (Hint: .hasOwnProperty() is helpful here)
      • Yes - return object[prop]
      • No - “No such property"
  • Else all contacts searched and no contact match found (outside for loop)
    • return “No such contact"
John Cerpa
@johncerpa
Jan 14 2016 02:24
erase the console.log
Jennifer Linkenauger
@jlinkenauger
Jan 14 2016 02:25
what else?
John Cerpa
@johncerpa
Jan 14 2016 02:25
I think that's it
Melissa Austin
@MAustinMMDP
Jan 14 2016 02:25
I see @nigeltea ... psuedo code helps :)
Jennifer Linkenauger
@jlinkenauger
Jan 14 2016 02:26
no bueno
function multiplyAll(arr) {
  var product = 1;
  // Only change code below this line
  for (var i=0; i < arr.length; i++) {
  for (var j=0; j < arr[i].length; j++) {
    product = product * arr[i][j];
  }
  // Only change code above this line
  return product;
  }

}
Shahid Foy
@shahidfoy
Jan 14 2016 02:26
@jlinkenauger set ur product = to nothing
John Cerpa
@johncerpa
Jan 14 2016 02:26
return should be out of the for loops
return product;
and that's it
Nick Hester
@nickhstr
Jan 14 2016 02:27
@johncerpa and @jlinkenauger thank you! One question: why did (prop === "tracks") need to be first?
CamperBot
@camperbot
Jan 14 2016 02:27
nickhstr sends brownie points to @johncerpa and @jlinkenauger :sparkles: :thumbsup: :sparkles:
:star: 240 | @johncerpa | http://www.freecodecamp.com/johncerpa
:star: 267 | @jlinkenauger | http://www.freecodecamp.com/jlinkenauger
Shahid Foy
@shahidfoy
Jan 14 2016 02:27
@jlinkenauger yea do as @johncerpa said set the return outside of the for loops
John Cerpa
@johncerpa
Jan 14 2016 02:28
If value is non-blank (value !== "") and prop is not "tracks" then update or set the value for the prop.
@jlinkenauger did it work?
Jennifer Linkenauger
@jlinkenauger
Jan 14 2016 02:29
:worried: nope
Piotr Zaborszczyk
@aldiaro91
Jan 14 2016 02:29
Hi! I have a problem with waypoint: local scope and functions
It says "no global myVar variable"
Jennifer Linkenauger
@jlinkenauger
Jan 14 2016 02:30
I put the product before and after the }
function multiplyAll(arr) {
  var product = 1;
  // Only change code below this line
  for (var i=0; i < arr.length; i++) {
  for (var j=0; j < arr[i].length; j++) {
  } 
        product = product * arr[i][j];
  }

  // Only change code above this line
  return product;
  }
John Cerpa
@johncerpa
Jan 14 2016 02:30
return product;
out of the function
too
@aldiaro91 paste your code here
Piotr Zaborszczyk
@aldiaro91
Jan 14 2016 02:31

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

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

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

// now remove the console log line to pass the test

Mohammad Hassaan Mahmood
@CampMahmood
Jan 14 2016 02:31
hi there
Jennifer Linkenauger
@jlinkenauger
Jan 14 2016 02:31
function multiplyAll(arr) {
  var product = 1;
  // Only change code below this line
  for (var i=0; i < arr.length; i++) {
  for (var j=0; j < arr[i].length; j++) {
  } 

  }

  // Only change code above this line

}
 product = product * arr[i][j];
  return product;

// Modify values below to test your code
multiplyAll([[1],[2],[3]]);
Ron
@rphill03
Jan 14 2016 02:31
how do you search for other chat discussions related to a checkpoint/waypoint or how do you search with the camper bot
John Cerpa
@johncerpa
Jan 14 2016 02:32
just the return product;
Mohammad Hassaan Mahmood
@CampMahmood
Jan 14 2016 02:32
i need to add a new object to a JSON
Frank
@fctromba66
Jan 14 2016 02:32
can anyone give me some assistance without give the solution away, I am on Word Blanks and cannot figure out what goes in the function?
Mohammad Hassaan Mahmood
@CampMahmood
Jan 14 2016 02:32
need help

var myMusic = [
{
"artist": "Billy Joel",
"title": "Piano Man",
"release_year": 1993,
"formats": [
"CS",
"8T",
"LP" ],
"gold": true
}
// Add record here

];

John Cerpa
@johncerpa
Jan 14 2016 02:32
not the product = product * arr[i][j];
Jennifer Linkenauger
@jlinkenauger
Jan 14 2016 02:32
@johncerpa still didn't work
I'm still going to give you some brownie points!
Bill
@kirah1314
Jan 14 2016 02:33
@CampMahmood myMusic is an array and you need to add another object to this array. Have you tried the push method?
Jennifer Linkenauger
@jlinkenauger
Jan 14 2016 02:33
thanks for trying @johncerpa
John Cerpa
@johncerpa
Jan 14 2016 02:33
wait why
CamperBot
@camperbot
Jan 14 2016 02:33
jlinkenauger sends brownie points to @johncerpa :sparkles: :thumbsup: :sparkles:
:star: 241 | @johncerpa | http://www.freecodecamp.com/johncerpa
John Cerpa
@johncerpa
Jan 14 2016 02:33
look
function multiplyAll(arr) {
  var product = 1;
  // Only change code below this line
  for (var i = 0; i < arr.length; i++) {

    for (var j = 0; j < arr[i].length; j++) {

      product = product * arr[i][j];

    }

  }


  // Only change code above this line
  return product;
}
Shahid Foy
@shahidfoy
Jan 14 2016 02:34
@jlinkenauger put the product = product * arr[i][j]; in the for loops
Jennifer Linkenauger
@jlinkenauger
Jan 14 2016 02:35
thank you. finally got it! @johncerpa
CamperBot
@camperbot
Jan 14 2016 02:35
jlinkenauger sends brownie points to @johncerpa :sparkles: :thumbsup: :sparkles:
:warning: jlinkenauger already gave johncerpa points
Jennifer Linkenauger
@jlinkenauger
Jan 14 2016 02:35
thanks @shahidfoy
CamperBot
@camperbot
Jan 14 2016 02:35
jlinkenauger sends brownie points to @shahidfoy :sparkles: :thumbsup: :sparkles:
:star: 328 | @shahidfoy | http://www.freecodecamp.com/shahidfoy
John Cerpa
@johncerpa
Jan 14 2016 02:35
good
Steven
@sgxinf
Jan 14 2016 02:37
Can anyone help with the "Stand in Line" problem under javascript? I'm unsure of what i'm supposed to do
nebunic
@nebunic
Jan 14 2016 02:38
var oldArray = [1,2,3,4,5];
var newArray = [];

// Only change code below this line.
var timesFour = oldArray.map(function(val){

  return val +3;

});
newArray = oldArray;
what am I doing wrong here? :-/
John Cerpa
@johncerpa
Jan 14 2016 02:39
paste the code @sgxinf
Mohammad Hassaan Mahmood
@CampMahmood
Jan 14 2016 02:40
@kirah1314 that did not even occur to me but let me try it thank you!
CamperBot
@camperbot
Jan 14 2016 02:40
campmahmood sends brownie points to @kirah1314 :sparkles: :thumbsup: :sparkles:
:star: 823 | @kirah1314 | http://www.freecodecamp.com/kirah1314
Steven
@sgxinf
Jan 14 2016 02:40

function queue(arr, item) {
// Your code here

return item; // Change this line
}

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

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

well, that didnt quite work
John Cerpa
@johncerpa
Jan 14 2016 02:40
well
function is empty
davidmartiin
@davidmartiin
Jan 14 2016 02:41
function lookUp(firstName, prop){
// Only change code below this line
for(var i = 0; i < contacts.length; i++) {
  if(firstName === contacts[i].firstName && contact[i].hasOwnProperty(prop)) {
    return contacts[i][prop];
  }
  else if(contacts[i].hasOwnProperty(prop)) {
    return "No such property";
  }
}
  if(firstName !== contacts.firstName) {
    return "No such contact";
  }
// Only cha
Manish Giri
@Manish-Giri
Jan 14 2016 02:41
@nebunic you don't need to set newArray to []. Call .map() on oldArray as you have but assign the results to newArray instead of timesFour
John Cerpa
@johncerpa
Jan 14 2016 02:41
Write a function queue which takes an array (arr) and a number (item) as arguments.
Shahid Foy
@shahidfoy
Jan 14 2016 02:41
@nebunic try and remove the last line newArray = oldArray;
John Cerpa
@johncerpa
Jan 14 2016 02:41
Add the number to the end of the array, then remove the first element of array.
davidmartiin
@davidmartiin
Jan 14 2016 02:41
this code does not see to work for checkpoint: Profile Lookup
John Cerpa
@johncerpa
Jan 14 2016 02:41
use shift and push
davidmartiin
@davidmartiin
Jan 14 2016 02:42
any help with Checkpoint: Profile Lookup?
function lookUp(firstName, prop){
// Only change code below this line
for(var i = 0; i < contacts.length; i++) {
  if(firstName === contacts[i].firstName && contact[i].hasOwnProperty(prop)) {
    return contacts[i][prop];
  }
  else if(contacts[i].hasOwnProperty(prop)) {
    return "No such property";
  }
}
  if(firstName !== contacts.firstName) {
    return "No such contact";
  }
// Only cha
John Cerpa
@johncerpa
Jan 14 2016 02:43
for loop is okay
Ron
@rphill03
Jan 14 2016 02:43
I have been so stuck on this
John Cerpa
@johncerpa
Jan 14 2016 02:43
the if should be
Ron
@rphill03
Jan 14 2016 02:43
I keep trying all the suggestions
John Cerpa
@johncerpa
Jan 14 2016 02:43
if (contacts[i].firstName === firstName) {

      if (contacts[i].hasOwnProperty(prop)) {

        return contacts[i][prop];

      }
then use an else
if those condition are false
and return "No such property";
davidmartiin
@davidmartiin
Jan 14 2016 02:46
function lookUp(firstName, prop){
// Only change code below this line
for(var i = 0; i < contacts.length; i++) {
  if(contacts[i].firstName === firstName) {
    if(contact[i].hasOwnProperty(prop)) {
      return contacts[i][prop];
    }
  }
  else  {
    return "No such property";
  }
}
  if(firstName !== contacts.firstName) {
    return "No such contact";
  }
// Only change code above this line
}
i did this? I don
Smrawls
@Smrawls
Jan 14 2016 02:47
I have a question about JavaScript Waypoint 54: Assignment with a Returned value. I managed to set process to equal a value of 2, but I can't figure out how to assign process to processed. The directions specifically say to 'Call the process function with an argument of 7 and assign its return value to the variable processed' . I've tried a bunch of things, all of which were wrong, and only managed to confused myself even more. How exactly do I set the return value to the variable processed?
davidmartiin
@davidmartiin
Jan 14 2016 02:47
I don't see what is incorrect here?
John Cerpa
@johncerpa
Jan 14 2016 02:47
hmmn
the last if
shouldn't be there
return "No such contact";
davidmartiin
@davidmartiin
Jan 14 2016 02:48
Where does it go then?
John Cerpa
@johncerpa
Jan 14 2016 02:48
should be out of the for loop
erase the if
just leave the return statement
put it out of the for loop
davidmartiin
@davidmartiin
Jan 14 2016 02:50
function lookUp(firstName, prop){
// Only change code below this line
for(var i = 0; i < contacts.length; i++) {
  if(contacts[i].firstName === firstName) {
    if(contact[i].hasOwnProperty(prop)) {
      return contacts[i][prop];
    }
  }
  else  {
    return "No such property";
  }
}

    return "No such contact";
}
I am so confused
both the return no prop and the return no contact are working
Smrawls
@Smrawls
Jan 14 2016 02:51
blob
davidmartiin
@davidmartiin
Jan 14 2016 02:51
It is only the return contacts[i][prop] that will not execute
John Cerpa
@johncerpa
Jan 14 2016 02:52
for (var i = 0; i < contacts.length; i++) {


    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
}
processed = process(7);
@Smrawls that
the use console.log
Smrawls
@Smrawls
Jan 14 2016 02:53
Thanks! @johncerpa
CamperBot
@camperbot
Jan 14 2016 02:53
smrawls sends brownie points to @johncerpa :sparkles: :thumbsup: :sparkles:
:star: 242 | @johncerpa | http://www.freecodecamp.com/johncerpa
John Cerpa
@johncerpa
Jan 14 2016 02:55
:)
:+1:
davidmartiin
@davidmartiin
Jan 14 2016 02:57
@johncerpa nice. Thanks so much. I just had some spacing off |(
CamperBot
@camperbot
Jan 14 2016 02:57
davidmartiin sends brownie points to @johncerpa :sparkles: :thumbsup: :sparkles:
:star: 243 | @johncerpa | http://www.freecodecamp.com/johncerpa
John Cerpa
@johncerpa
Jan 14 2016 02:57
good
Rachel
@rcmoldovan
Jan 14 2016 03:09

Hey guys, why is my code wrong? // Setup
var myStr = "Jello World";

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

John Cerpa
@johncerpa
Jan 14 2016 03:09
hmmn
erase the myStr = "Hello World";
Rex Schrader
@SaintPeter
Jan 14 2016 03:10
@rcmoldovan erase myStr[0] = "H"; // Fix Me
John Cerpa
@johncerpa
Jan 14 2016 03:10
no
Rex Schrader
@SaintPeter
Jan 14 2016 03:11
@johncerpa Yup. I wrote the challenge. His answer is correct except that he needs to remove that line.
John Cerpa
@johncerpa
Jan 14 2016 03:11
hhmmn
I don't remember it like that
Vignesh
@vignesh12187
Jan 14 2016 03:11
Hi
John Cerpa
@johncerpa
Jan 14 2016 03:11
but okay :)
Vignesh
@vignesh12187
Jan 14 2016 03:11
Create a function called myFunction that accepts two arguments and outputs their sum to the dev console.
Call the function.
function myFunction(a, b) {
console.log(a + b);
}
myFunction(1, 2);
whats wrong with my function ?
Rachel
@rcmoldovan
Jan 14 2016 03:12
The erasing it worked thank you @SaintPeter
CamperBot
@camperbot
Jan 14 2016 03:12
rcmoldovan sends brownie points to @saintpeter :sparkles: :thumbsup: :sparkles:
:star: 2275 | @saintpeter | http://www.freecodecamp.com/saintpeter
cannelflow
@cannelflow
Jan 14 2016 03:13
@myfirstrailsblogapp don't see any error which ex?
Vignesh
@vignesh12187
Jan 14 2016 03:13
Javascript - Waypoint: Passing Values to Functions with Arguments
John Cerpa
@johncerpa
Jan 14 2016 03:14
This message was deleted
This message was deleted
result = num1 + num2;
then
console.log(result);
Vignesh
@vignesh12187
Jan 14 2016 03:15
Let me try that
David Biedenbender
@CodeDavidB
Jan 14 2016 03:16
what is Waypoint: Storing Values with the Equal Operator actually asking me to do, I dont get what Im supposed to do. cant I just do var a to 7 and var b to 7?
Ricardo Sanchez
@ricsanm
Jan 14 2016 03:16
Greetings, travelers!
max77p
@max77p
Jan 14 2016 03:16
need help with this exercise
how do you do this? Encode the following sequence, separated by spaces:
backslash tab tab carriage-return new-line and assign it to myStr
can someone help me please?
John Cerpa
@johncerpa
Jan 14 2016 03:16
obviously
with the parameters you're using
a and b
result = a + b;
cannelflow
@cannelflow
Jan 14 2016 03:17
@myfirstrailsblogapp working for me try refreshing page
Vignesh
@vignesh12187
Jan 14 2016 03:17
Ahhh .. that was a refresh issue .. thanks @cannelflow
CamperBot
@camperbot
Jan 14 2016 03:17
myfirstrailsblogapp sends brownie points to @cannelflow :sparkles: :thumbsup: :sparkles:
:star: 400 | @cannelflow | http://www.freecodecamp.com/cannelflow
max77p
@max77p
Jan 14 2016 03:18
@cannelflow have a moment to help with my question please?
John Cerpa
@johncerpa
Jan 14 2016 03:20
you should use the bacsklash
Vignesh
@vignesh12187
Jan 14 2016 03:20
This message was deleted
@max77p : You already have the value explained there
just substitute that and declare the same as a string
cannelflow
@cannelflow
Jan 14 2016 03:21
@max77p can try
max77p
@max77p
Jan 14 2016 03:23
@cannelflow var mySt='\"\" \t \t \r \n';
but i think i am understanding the question wrong
cannelflow
@cannelflow
Jan 14 2016 03:24
which ex
@max77p
max77p
@max77p
Jan 14 2016 03:24
ex?
John Cerpa
@johncerpa
Jan 14 2016 03:24
\ \t \t \r \n
cannelflow
@cannelflow
Jan 14 2016 03:24
@max77p exercise
max77p
@max77p
Jan 14 2016 03:24
@cannelflow Waypoint: Escape Sequences in Strings
John Cerpa
@johncerpa
Jan 14 2016 03:25
``
```
cannelflow
@cannelflow
Jan 14 2016 03:25
@max77p what are you not getting?
John Cerpa
@johncerpa
Jan 14 2016 03:25
var myStr = '\\ \t \t \r \n';
max77p
@max77p
Jan 14 2016 03:25
ohh the quotes outside
thats what i didnt do
thanks guys @johncerpa @cannelflow
CamperBot
@camperbot
Jan 14 2016 03:26
max77p sends brownie points to @johncerpa and @cannelflow :sparkles: :thumbsup: :sparkles:
:star: 244 | @johncerpa | http://www.freecodecamp.com/johncerpa
:star: 401 | @cannelflow | http://www.freecodecamp.com/cannelflow
Yan Kozlovskiy
@YanKozlovskiy
Jan 14 2016 03:26
is there a site where i can practice dom traversal?
John Cerpa
@johncerpa
Jan 14 2016 03:26
@cannelflow :+1:
cannelflow
@cannelflow
Jan 14 2016 03:26
@max77p np
@johncerpa how to do thumps up
John Cerpa
@johncerpa
Jan 14 2016 03:27
type :
max77p
@max77p
Jan 14 2016 03:27
var mySt='\ \t \t \r \n'; @cannelflow @johncerpa sorry guys, but the assignment not accepting my answer
John Cerpa
@johncerpa
Jan 14 2016 03:27
you'll see some
two
var myStr = '\ \t \t \r \n';
var myStr = '*\ \t \t \r \n';
max77p
@max77p
Jan 14 2016 03:27
yea sorry i dont know why it didnt paste
i have two
John Cerpa
@johncerpa
Jan 14 2016 03:27
you need two backslashes
at the beginning
max77p
@max77p
Jan 14 2016 03:27
'''
var mySt='\ \t \t \r \n';
CamperBot
@camperbot
Jan 14 2016 03:27
:bulb: to format code use backticks! ``` more info
John Cerpa
@johncerpa
Jan 14 2016 03:28
because it erases itself
idk
cannelflow
@cannelflow
Jan 14 2016 03:28
@max77p var myStr='\ \t \t \r \n'
max77p
@max77p
Jan 14 2016 03:28
'''
var mySt='\ \t \t \r \n';
'''
CamperBot
@camperbot
Jan 14 2016 03:28
:bulb: to format code use backticks! ``` more info
John Cerpa
@johncerpa
Jan 14 2016 03:28
var myStr = '\\ \t \t \r \n';
like that
two
cannelflow
@cannelflow
Jan 14 2016 03:28
var myStr='\\ \t \t \r \n'
:+1: @johncerpa got it
Yvonne
@yvonne6344
Jan 14 2016 03:29

Q:Your image should have a border radius of 50%, making it perfectly circular.

<style>
img {
border-radius: 50%;
}
</style>
<img class="smaller-image thick-green-border" src="https://bit.ly/fcc-relaxing-cat">

it's error...how can I do?

John Cerpa
@johncerpa
Jan 14 2016 03:29
good
cannelflow
@cannelflow
Jan 14 2016 03:29
@yvonne6344 exercise?
John Cerpa
@johncerpa
Jan 14 2016 03:29
what exercise
max77p
@max77p
Jan 14 2016 03:29
ahh works now, thanks!
John Cerpa
@johncerpa
Jan 14 2016 03:29
border-radius:50;
cannelflow
@cannelflow
Jan 14 2016 03:29
@max77p worked?
Yvonne
@yvonne6344
Jan 14 2016 03:30
exercise 20
John Cerpa
@johncerpa
Jan 14 2016 03:30
This message was deleted
This message was deleted
cannelflow
@cannelflow
Jan 14 2016 03:30
@yvonne6344 its btr to give ex name
John Cerpa
@johncerpa
Jan 14 2016 03:30
i think
oh no
Yvonne
@yvonne6344
Jan 14 2016 03:31
Waypoint: Make Circular Images with a Border Radius
max77p
@max77p
Jan 14 2016 03:31
@cannelflow yes worked, it was weird, because i had same code, but after pasting what you guys gave me, it worked
weird, but at least i get it now, thanks!
John Cerpa
@johncerpa
Jan 14 2016 03:31
img
Yvonne
@yvonne6344
Jan 14 2016 03:31
border-radius:50;
it's false
John Cerpa
@johncerpa
Jan 14 2016 03:31
<img></img>
cannelflow
@cannelflow
Jan 14 2016 03:32
@yvonne6344 giv that spec in smaller-radius class
John Cerpa
@johncerpa
Jan 14 2016 03:32
look
you need to make a class
cannelflow
@cannelflow
Jan 14 2016 03:32
@yvonne6344 sry smaller-image
John Cerpa
@johncerpa
Jan 14 2016 03:33
.thick-green-border {

    border-radius: 50%;
}
and use it in your image
Yvonne
@yvonne6344
Jan 14 2016 03:33
oh!!success!!!
thanks :D
make a class is true!
not use img { }
Tim Bell
@MindfulBell
Jan 14 2016 03:43
anyone familiar with nodejs?
Rex Schrader
@SaintPeter
Jan 14 2016 03:45
@MindfulBell Sure - sup?
David
@DavidPhan1992
Jan 14 2016 03:50
can anybody help me with waypoint : make object properties private
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() {

  // Only change code below this line.
  var gear;
  var getGear = function(){

  };
  var setGear = function(){

  };
};

var myCar = new Car();

var myBike = new Bike();
myBike.gear();
myBike.getGear();
myBike.setGear();
this is what I have
and I'm not quite sure what the way point wants to me do
Now try it yourself! Modify the Bike constructor to have a private property called gear and two public methods called getGear and setGear to get and set that value.
The method getGear of myBike should be accessible outside the object.
The method setGear of myBike should be accessible outside the object.
myBike.gear should remain undefined.
myBike.getGear() should return 4 after myBike.setGear(4).
Im creating two methods for getGear and setGear
how am i suppose to change it after?
Tim Bell
@MindfulBell
Jan 14 2016 03:55
@SaintPeter why is this not working for the "my first I/O' step?
var fs = require('fs');
var buf = fs.readFileSync(process.argv[2]);
var bufArr = buf.toString().split('\n');
return bufArr.length-1
Rex Schrader
@SaintPeter
Jan 14 2016 03:59
@MindfulBell I don't think you need to -1
@MindfulBell The count should be exact
@MindfulBell Remember that length is not zero-based
NormalWare
@Centuriom
Jan 14 2016 04:03
Hello everyone!
I got a problem with the exercise
Bonfire: Truncate a string
Here is my code, i think it should work
Elizabeth
@elizabethindigo
Jan 14 2016 04:03
Hi friends! I've got a pretty basic problem, I think, but I can't figure what I'm doing wrong.
NormalWare
@Centuriom
Jan 14 2016 04:03
function truncate(str, num) {
  // Clear out that junk in your trunk

  var word = '';
  var endDots = '...';

  if (num <=3)
    {
      word = str.slice(0,num) + endDots; 
    }


  else 
    {
      word = str.slice(0,num - endDots.length) + endDots;
    }

 return word;

}

truncate("A-", 1);
@elizabethindigo Tell me your problem, i'll help if i know
Elizabeth
@elizabethindigo
Jan 14 2016 04:06

I'm working on radio buttons (I just started). My cat app looks right, but the run tests button sends me back. this is the html:

<lable><input type="radio" name="indoor-outdoor" value="indoor">
indoor</lable>

<lable><input type="radio" name="indoor-outdoor" value="outdoor">
outdoor</lable>

Jon Johnson
@jonjohnson34
Jan 14 2016 04:07
can anybody help me with waypoint : make object properties private
@DavidPhan1992 You need to add the actual code for the function. For getGear you will return the gear, and setGear you will pass in the value to that function and then set gear = to that value.
NormalWare
@Centuriom
Jan 14 2016 04:09
@jonjohnson34 post your code here please
Alejandro Joya
@ajoyac
Jan 14 2016 04:10
remeber /```
NormalWare
@Centuriom
Jan 14 2016 04:10
@elizabethindigo What's the name of the exercise
Elizabeth
@elizabethindigo
Jan 14 2016 04:10
Waypoint: Create a Set of Radio Buttons
Jon Johnson
@jonjohnson34
Jan 14 2016 04:10
var getGear = function(){
return gear;
};
var setGear = function(val){
gear = val;
};
Alejandro Joya
@ajoyac
Jan 14 2016 04:10
remeber ``` can be used for show code
NormalWare
@Centuriom
Jan 14 2016 04:11
@elizabethindigo It's a funny mistake, it's actually <label> and you got <lable>
Elizabeth
@elizabethindigo
Jan 14 2016 04:12
@Centuriom You're kidding me. spelling fail.
Thank you! I'll check that.
NormalWare
@Centuriom
Jan 14 2016 04:12
@elizabethindigo I make those kind of problem really often
Did your code work this time ?
Elizabeth
@elizabethindigo
Jan 14 2016 04:13
HA! Yes, thanks a lot @Centuriom
CamperBot
@camperbot
Jan 14 2016 04:13
elizabethindigo sends brownie points to @centuriom :sparkles: :thumbsup: :sparkles:
:star: 223 | @centuriom | http://www.freecodecamp.com/centuriom
NormalWare
@Centuriom
Jan 14 2016 04:13
@elizabethindigo Cool !
@jonjohnson34 you still got that problem ?
Jon Johnson
@jonjohnson34
Jan 14 2016 04:15
No, I was trying to help someone else and I accidentally pasted that i had an issue. sorry for the confusion. That first sentence was a mistake
mimics
@mimics
Jan 14 2016 04:16

has anyone done the new JS checkpoint "Profile Lookup" my code passes all checkpoints except #4 and I'm stumped
function lookUp(firstName, prop){
// Only change code below this line

for (i = 0; i < contacts.length; i++) {
if (contacts[i].firstName === firstName && contacts[i].hasOwnProperty(prop)) {
return contacts[i][prop];
}
else if (contacts[i].hasOwnProperty(prop) === false) {
return "No such property";
}
else if (contacts[i].firstName === false) {
return "No such contact";
}
}

DJ
@qualitymanifest
Jan 14 2016 04:17
@Centuriom you still working on truncate? you were really close up there
Glen Roberts
@ZeroAccess
Jan 14 2016 04:17
@mimics just got done working on that one sec let me look
mimics
@mimics
Jan 14 2016 04:17
@ZeroAccess thanks bud!
CamperBot
@camperbot
Jan 14 2016 04:17
mimics sends brownie points to @zeroaccess :sparkles: :thumbsup: :sparkles:
:star: 265 | @zeroaccess | http://www.freecodecamp.com/zeroaccess
NormalWare
@Centuriom
Jan 14 2016 04:17
@qualitymanifest Hi, i don't know what's the problem there
Glen Roberts
@ZeroAccess
Jan 14 2016 04:18
What's the test it's not validating?
DJ
@qualitymanifest
Jan 14 2016 04:18
@Centuriom if num is greater than or equal to str's length, you just return str
mimics
@mimics
Jan 14 2016 04:18
"Bob", "number" should return "No such contact"
CamperBot
@camperbot
Jan 14 2016 04:18
this is bob
DJ
@qualitymanifest
Jan 14 2016 04:18
@Centuriom no need to truncate or add dots
NormalWare
@Centuriom
Jan 14 2016 04:18
@qualitymanifest Oh thanks! i see it know
CamperBot
@camperbot
Jan 14 2016 04:18
centuriom sends brownie points to @qualitymanifest :sparkles: :thumbsup: :sparkles:
:star: 786 | @qualitymanifest | http://www.freecodecamp.com/qualitymanifest
Glen Roberts
@ZeroAccess
Jan 14 2016 04:20
@mimics what # is that one again?
mimics
@mimics
Jan 14 2016 04:21
should be test #4 out of 5
navin singh dalal
@dalalns
Jan 14 2016 04:21
help subarray
CamperBot
@camperbot
Jan 14 2016 04:21
no wiki entry for: subarray
Glen Roberts
@ZeroAccess
Jan 14 2016 04:21
No I mean what bonfire #/title?
or waypoint
navin singh dalal
@dalalns
Jan 14 2016 04:21
multidemnsional array
mimics
@mimics
Jan 14 2016 04:21
oh sorry #98 in Basic Javascript
Glen Roberts
@ZeroAccess
Jan 14 2016 04:23
@mimics k looking to see how to change ur code to work
don't wanna just have you change what you've already done to my format
mimics
@mimics
Jan 14 2016 04:24
totally, i appreciate it!
nebunic
@nebunic
Jan 14 2016 04:24
could anyone help me with the palindrome bonfire? why is "1 eye for of 1 eye" not supposed to be a palindrome after you remove all alphanumerical characters?
CamperBot
@camperbot
Jan 14 2016 04:24
type bonfire name to get some info on that bonfire. And check HelpBonfires chatroom
Dr. Paul Kenneth Shreeman
@pkshreeman
Jan 14 2016 04:25
@nebunic because 1 eye is not eye 1
mimics
@mimics
Jan 14 2016 04:25
@nebunic because the word "of" makes it not reversible after removing the 1's
nebunic
@nebunic
Jan 14 2016 04:26
yes, but if you remove all alphanumerical characters you get "eyeforofeye"
all non-alphanumeric
Glen Roberts
@ZeroAccess
Jan 14 2016 04:26
@mimics here's the thing when you do something like if(a = true) you could just write if(a) ..
nebunic
@nebunic
Jan 14 2016 04:26
ohhh, wait
you're not supposed to remove the numbers
Dr. Paul Kenneth Shreeman
@pkshreeman
Jan 14 2016 04:26
I think that’s why the test is there..to double check that you don’t remove the numbers.
Glen Roberts
@ZeroAccess
Jan 14 2016 04:27
you're basically asking if this string === false
so if you put Bob's name as false that'd probably equate to true
@mimics Does that make sense?
nebunic
@nebunic
Jan 14 2016 04:27
@pkshreeman yeah, I got it now, I had everything sorted out but that one, I accidentally also removed the numbers :D
mimics
@mimics
Jan 14 2016 04:28
@ZeroAccess sort of, you're talking about the last "else if" clause right?
Glen Roberts
@ZeroAccess
Jan 14 2016 04:28
Either one
Dr. Paul Kenneth Shreeman
@pkshreeman
Jan 14 2016 04:28
@nebunic pass all the tests now?
nebunic
@nebunic
Jan 14 2016 04:28
@pkshreeman yeah, I'm off to the next one, longest word :D
Dr. Paul Kenneth Shreeman
@pkshreeman
Jan 14 2016 04:28
good luck!
nebunic
@nebunic
Jan 14 2016 04:28
thanks!
Matthew Johnson
@EmjayFlight
Jan 14 2016 04:29
Screen Shot 2016-01-13 at 11.26.04 PM.png

Hey guys, doing the Stand in Line Waypoint and got this solution which is wrong:

I’m clueless at this point any pointers?

mimics
@mimics
Jan 14 2016 04:29
I guess im just confused because I used the same sort of operator to determine if 'prop' does not exist and that part works fine
Brian
@sludge256
Jan 14 2016 04:30
@MrEmjay417 try refreshing the page
Glen Roberts
@ZeroAccess
Jan 14 2016 04:30
@mimics one second I'll try it differently
Brian
@sludge256
Jan 14 2016 04:30
or restarting your browser
NormalWare
@Centuriom
Jan 14 2016 04:30
@MrEmjay417 There's a cooler way for posting your code
All you got to do is to write this things ```
Glen Roberts
@ZeroAccess
Jan 14 2016 04:31
@mimics I made a mistake (typo) my bad
NormalWare
@Centuriom
Jan 14 2016 04:31
At the top and the bottom of your code
Jon Johnson
@jonjohnson34
Jan 14 2016 04:31
@MrEmjay417 I had to restart the browser as well to get that one to work
Yvonne
@yvonne6344
Jan 14 2016 04:31
22.Waypoint: Nest an Anchor Element within a Paragraph
Q1:Your a element should be nested within your new p element.
Q2:Your p element should have the text "View more " (with a space after it).
unsuccess!!How can I do? I don't know that
Matthew Johnson
@EmjayFlight
Jan 14 2016 04:32
Yep, all I had to do was restart the browser lol
Rick Markins
@rkmarks
Jan 14 2016 04:33
Hello all having issues with Checkpoint: Profile Lookup. Here is my current code:
//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": ["Intruiging Cases", "Violin"]
    },
    {
        "firstName": "Kristian",
        "lastName": "Vos",
        "number": "unknown",
        "likes": ["Javascript", "Gaming", "Foxes"]
    },
];


function lookUp(firstName, prop){
// Only change code below this line
  prop = contacts[prop];
  firstName = contacts[firstName];

  if (firstName == contacts[firstName]){
    return contacts[prop];
  }
  else if (firstName === contacts[firstName] && prop === contacts[prop]){
       return contacts[firstName][prop];
   }
  else if (firstName !== contacts[firstName]){
    return "No such contact";
  }
  else if (prop !== contacts[prop]){
    return "No such property";
  }

// Only change code above this line
}

// Change these values to test your function
lookUp("Hary", "likes");
any suggestions?
Brian
@sludge256
Jan 14 2016 04:34
@MrEmjay417 @jonjohnson34 There's a max call stack error that usually occurs with some of the new lessons but it was easy to tell because or the error message. However the site recently changed how it displays code output and now the error message does not show up. A fix for displaying erro messages has been implemented but is not yet live.
mimics
@mimics
Jan 14 2016 04:35
@rkmarks working on that right now, what tests isn't your code passing?
Rick Markins
@rkmarks
Jan 14 2016 04:35
the No such contact on
else if (firstName !== contacts[firstName]){
return "No such contact";
}
that's the only part that passes.
Glen Roberts
@ZeroAccess
Jan 14 2016 04:35
I see how ya'll are doing it. I did it differently and am trying to figure out how I can make it work with the way ya'll are doing it.
Brian
@sludge256
Jan 14 2016 04:36
@yvonne6344 It's helpful if you post your code
Jon Johnson
@jonjohnson34
Jan 14 2016 04:37
@sludge256 Thanks for the expatiation.
CamperBot
@camperbot
Jan 14 2016 04:37
jonjohnson34 sends brownie points to @sludge256 :sparkles: :thumbsup: :sparkles:
:star: 803 | @sludge256 | http://www.freecodecamp.com/sludge256
Jon Johnson
@jonjohnson34
Jan 14 2016 04:37
explanation
mimics
@mimics
Jan 14 2016 04:37
@rkmarks the "no such property" test isn't passing?
Glen Roberts
@ZeroAccess
Jan 14 2016 04:37
@mimics k got it
Rick Markins
@rkmarks
Jan 14 2016 04:37
no
@mimics
Glen Roberts
@ZeroAccess
Jan 14 2016 04:37
so here's the thing you have your for loop right?
@mimics and @rkmarks ^
Brian
@sludge256
Jan 14 2016 04:38
he doesn't have a for loop
mimics
@mimics
Jan 14 2016 04:38
I do rkmarks doesnt
Glen Roberts
@ZeroAccess
Jan 14 2016 04:38
OH lol, got his and @mimics code mixed up
Rick Markins
@rkmarks
Jan 14 2016 04:38
@ZeroAccess there's not one currently in the code but I see what your saying I need to add a for loop that loops through the array
Glen Roberts
@ZeroAccess
Jan 14 2016 04:38
Ok then I'll do @mimics first and then @rkmarks
@mimics you have your for loop right? Well basically when you finish the for loop what do you know once it's done if it didn't return anything?
mimics
@mimics
Jan 14 2016 04:39
you mean if neither firstName or prop is in the object?
Glen Roberts
@ZeroAccess
Jan 14 2016 04:39
Yep
mimics
@mimics
Jan 14 2016 04:40
i guess i didnt add a final "else" clause cause the objective didnt ask for one, is that effecting the solution?
Glen Roberts
@ZeroAccess
Jan 14 2016 04:40
No
David
@DavidPhan1992
Jan 14 2016 04:41
waypoint.PNG
Glen Roberts
@ZeroAccess
Jan 14 2016 04:41
Ok, let's see. So you have your for loop that goes through the entire object. If it has a name and property it returns the property. If it has just a name it returns "no such property". So basically if you get to the end of the For loop (after it completes) what can you say?
David
@DavidPhan1992
Jan 14 2016 04:41
can somebody help me with this if you gotten this far
Glen Roberts
@ZeroAccess
Jan 14 2016 04:41
@DavidPhan1992 it helps to paste the code here
explain format
CamperBot
@camperbot
Jan 14 2016 04:41

:point_right: code formatting [wiki]

Inline code

This an inline `<paste code here>` code formatting with a single backtick(`) at start and end around the code.

Code Block

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

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

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

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

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

mimics
@mimics
Jan 14 2016 04:42
oh, then you can say that the property doesn't exist?
David
@DavidPhan1992
Jan 14 2016 04:42
var Car = function() {
  // this is a private variable
  var speed = 10;

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

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

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

var Bike = function() {

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

  this.setGear = function(pick){
    this.getGear = function(){
      return pick;
    };
  };
};

var myCar = new Car();

var myBike = new Bike();
myBike.gear();
myBike.getGear();
myBike.setGear(4);
Glen Roberts
@ZeroAccess
Jan 14 2016 04:42
Exactly, so if the property doesn't exist what can you return?
David
@DavidPhan1992
Jan 14 2016 04:42
@ZeroAccess
better?
Glen Roberts
@ZeroAccess
Jan 14 2016 04:42
@DavidPhan1992 yea sorry just helpful :D
David
@DavidPhan1992
Jan 14 2016 04:42
@ZeroAccess haha no it's fine it's my fault lol
mimics
@mimics
Jan 14 2016 04:42
it returns "property does not exist" currently
Brian
@sludge256
Jan 14 2016 04:43
@DavidPhan1992 setGear and getGear should be separate functions
mimics
@mimics
Jan 14 2016 04:43
or "no such property" rather
iokonokh
@iokonokh
Jan 14 2016 04:43
i am having some issues with he switch statement
nebunic
@nebunic
Jan 14 2016 04:43
bonfire longest word
CamperBot
@camperbot
Jan 14 2016 04:43

:fire:Bonfire: Find the Longest Word in a String :link:

function findLongestWord(str) {
  return str.length;
}

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

Return the length of the longest word in the provided sentence.

more info:  bf details | bf links | hint

David
@DavidPhan1992
Jan 14 2016 04:43
@sludge256 if i separate them, how do i have my.bikeGear() return 4 when I set myBike.setGear(4)?
allenewood
@allenewood
Jan 14 2016 04:44
help checkpoint: record collection
CamperBot
@camperbot
Jan 14 2016 04:44

:point_right: checkpoint record collection [wiki]

Checkpoint: Record Collection

Instructions

You are given a JSON object representing (a small part of) your record collection. Each album is identified by a unique id number and has several properties. Not all albums have complete information.

Write a function which takes an id, a property (prop), and a value.

For the given id in collection:

If value is non-blank (value !== ""), then update or set the value for the prop.

If the prop is "tracks" and value is non-blank, push the value onto the end of the tracks array.

If value is blank, delete that prop.

Always return the entire collection object.

Remember to use Read-Search-Ask if you get stuck. Try to pair program. Write your own code.

:pencil: read more about checkpoint record collection on the FCC Wiki

Glen Roberts
@ZeroAccess
Jan 14 2016 04:44
@mimics , ok go to the end of your for loop and think about if there was no object with that name found what could you return?
nebunic
@nebunic
Jan 14 2016 04:44
function findLongestWord(str) {
 var array=str.split(' ');
// console.log(array[1][1]);
  //console.log(array.length);
  for(var i=0; i<array.length; i++)
    {var length=0;
      for(var j=0; j<array[i].length; j++)
        {
          if(length<array[i].length) length=array[i].length;}

 // console.log(length);
     return length;
    }
}

findLongestWord("The quick brown fox jumped over the lazy dog");
what am I missing?
iokonokh
@iokonokh
Jan 14 2016 04:44

function myTest(val) {
var answer = "";
// Only change code below this line
switch(val) {
case 1:
case 2:
case 3:
result = "Low";
break;
case 4:
case 5:
case 6:
result = "Mid";
break;
case 7:
case 8:
case 9:
result = "High";
}

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

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

mimics
@mimics
Jan 14 2016 04:44
return false or undefined?
Glen Roberts
@ZeroAccess
Jan 14 2016 04:45
lol, or you could return that maybe the user doesn't exist?
Brian
@sludge256
Jan 14 2016 04:45
@DavidPhan1992 for setGear you can just assign variable gear to whatever you name your parameter
getGear should just return gear
Kevin Rodriguez
@kevin2r
Jan 14 2016 04:46
Hi Guys, i'm struck up in Checkpoint: Profile Lookup
mimics
@mimics
Jan 14 2016 04:46
im confused
Glen Roberts
@ZeroAccess
Jan 14 2016 04:46
@kevin2r a couple people are working on it ..one second
mimics
@mimics
Jan 14 2016 04:46
i have a bit of code doing that, it's just not working
Glen Roberts
@ZeroAccess
Jan 14 2016 04:46
@mimics paste the code you have right now
please
Kevin Rodriguez
@kevin2r
Jan 14 2016 04:46
i think that the problem are the return statements
once you return
mimics
@mimics
Jan 14 2016 04:46

function lookUp(firstName, prop){
// Only change code below this line

for (i = 0; i < contacts.length; i++) {
if (contacts[i].firstName === firstName && contacts[i].hasOwnProperty(prop)) {
return contacts[i][prop];
}
else if (contacts[i].hasOwnProperty(prop) === false) {
return "No such property";
}
else if (contacts[i].firstName === false) {
return "No such contact";
}
}

Santiago de la Torre
@iargonut
Jan 14 2016 04:46
<script

        $(document).ready(function() {});>
Kevin Rodriguez
@kevin2r
Jan 14 2016 04:46
the loop exit
Glen Roberts
@ZeroAccess
Jan 14 2016 04:46
@kevin2r most the time it's in the loops
Santiago de la Torre
@iargonut
Jan 14 2016 04:46
whats wrong with that ???
Kevin Voshell
@kvoshell
Jan 14 2016 04:46
Hi all, what am I missing here? :smile:
// Setup
var myPlants = [
  { 
    type: "flowers",
    list: [
      "rose",
      "tulip",
      "dandelion"
    ]
  },
  {
    type: "trees",
    list: [
      "fir",
      "pine",
      "birch"
    ]
  }  
];

// Only change code below this line

var secondTree = myPlants.type.list[1]; // Change this line
Santiago de la Torre
@iargonut
Jan 14 2016 04:47
first time usiing java
David
@DavidPhan1992
Jan 14 2016 04:47
@sludge256 do I have set gear to something?
Kevin Rodriguez
@kevin2r
Jan 14 2016 04:47
@ZeroAccess if you comment the returns statements it work
David
@DavidPhan1992
Jan 14 2016 04:47
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() {

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

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

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

var myCar = new Car();

var myBike = new Bike();
myBike.gear();
myBike.getGear();
myBike.setGear(4);
Santiago de la Torre
@iargonut
Jan 14 2016 04:47
<script

        $(document).ready(function() {});>
Kevin Rodriguez
@kevin2r
Jan 14 2016 04:47
i mean
Glen Roberts
@ZeroAccess
Jan 14 2016 04:47
function lookUp(firstName, prop){
// Only change code below this line

  for (i = 0; i < contacts.length; i++) {
    if (contacts[i].firstName === firstName && contacts[i].hasOwnProperty(prop)) {
    return contacts[i][prop];
    }
    else if (contacts[i].hasOwnProperty(prop) === false) {
    return "No such property";
    }
//let's remove this as we're still in the for loop
    else if (contacts[i].firstName === false) {
    return "No such contact";
    }
}
//so after the for loop ends what can we return here? What do we know? That there isn't a user in the object
Does that help?
If not I'm gonna paste it and go into a lot of detail since so many people are having issues
David
@DavidPhan1992
Jan 14 2016 04:48
@sludge256 can't pass =\
Glen Roberts
@ZeroAccess
Jan 14 2016 04:48
There's a few different ways to do it though
Kevin Rodriguez
@kevin2r
Jan 14 2016 04:48
@ZeroAccess i have something like that
Glen Roberts
@ZeroAccess
Jan 14 2016 04:48
@kevin2r most do, just to avoid confusion if it's ok I'll knock out @mimics then jump on yours
David
@DavidPhan1992
Jan 14 2016 04:48
doesn't the this.ob notation make the objects public
and not private
Glen Roberts
@ZeroAccess
Jan 14 2016 04:49
Just don't want to have the same code but different conversations all over the place
Brian
@sludge256
Jan 14 2016 04:49
@DavidPhan1992 get rid of your bottom 3 lines
Rick Markins
@rkmarks
Jan 14 2016 04:49
@Payne1006 you're on the right track but you are missing one piece. As you see the myPlants variable is an array and so is the object list.
Glen Roberts
@ZeroAccess
Jan 14 2016 04:49
Feel free to just send a private chat and I'll knock it out there if needed.
David
@DavidPhan1992
Jan 14 2016 04:49
@sludge256 that worked, why is that?
Kevin Rodriguez
@kevin2r
Jan 14 2016 04:49
@ZeroAccess ok let me show you
Rick Markins
@rkmarks
Jan 14 2016 04:49
if they are both arrays they would need the same thing as list @Payne1006
Santiago de la Torre
@iargonut
Jan 14 2016 04:50
can anyone help me ??
David
@DavidPhan1992
Jan 14 2016 04:50
@sludge256 i don't understand why it passed that way after deleting my last 3 lines, i thought i would need it
mimics
@mimics
Jan 14 2016 04:50
@ZeroAccess i don't understand why this one condition would be tackled outside of the for-loop, and I feel bad holding you up more
Brian
@sludge256
Jan 14 2016 04:50
@DavidPhan1992 this was your problem I think
myBike.gear();
Glen Roberts
@ZeroAccess
Jan 14 2016 04:51
@mimics please don't feel bad
Kevin Voshell
@kvoshell
Jan 14 2016 04:51
something like 'myPlants[1]'? @rkmarks
Glen Roberts
@ZeroAccess
Jan 14 2016 04:51
@mimics and @kevin2r gonna write a little more detailed for both of you (you're both so close!)
Brian
@sludge256
Jan 14 2016 04:51
It's not a valid way to get the gear I believe
that's why you made getGear
(what you had wasn't validcode as far as I can tell)
Rick Markins
@rkmarks
Jan 14 2016 04:51
@Payne1006 Try that out and see if it passes
Kevin Voshell
@kvoshell
Jan 14 2016 04:52
nope :smile:
David
@DavidPhan1992
Jan 14 2016 04:52
@sludge256 oh I see what you mean there
@sludge256 another question
Rick Markins
@rkmarks
Jan 14 2016 04:52
@ZeroAccess I too am stuck on the Profile Lookup so any input you provide would be helpful :D
David
@DavidPhan1992
Jan 14 2016 04:52
why delete myBike.setGear(4)
and myBike.getGear()?
don't you need the 4 to update the paramter?
Brian
@sludge256
Jan 14 2016 04:52
You didn't have to
It was just the first thing that popped in my head
Kevin Voshell
@kvoshell
Jan 14 2016 04:52
I see that 'type' is the second 'type', for the reason that you stated, not sure how to differentiate that I want to access the second one, not the first
Brian
@sludge256
Jan 14 2016 04:52
since the original code didnt have those lines
David
@DavidPhan1992
Jan 14 2016 04:53
@sludge256 LOL weird now it doesn't work when I add those lines
@sludge256 it works when they are removed
Brian
@sludge256
Jan 14 2016 04:53
It's working for me
David
@DavidPhan1992
Jan 14 2016 04:53
@sludge256 can i see your code?
Brian
@sludge256
Jan 14 2016 04:53
same as the code you gave me
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() {

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

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

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

var myCar = new Car();

var myBike = new Bike();
myBike.getGear();
myBike.setGear(4);
David
@DavidPhan1992
Jan 14 2016 04:54
what in the world
LOL
Brian
@sludge256
Jan 14 2016 04:54
@iargonut put hat code between <script> and </script>
don't put it inside the first script
David
@DavidPhan1992
Jan 14 2016 04:54
didn't work for me
Rick Markins
@rkmarks
Jan 14 2016 04:54
@Payne1006 so when you accessed the 2nd item in the array you don't need to call the type
Brian
@sludge256
Jan 14 2016 04:54
try resetting and pasting it back in?
David
@DavidPhan1992
Jan 14 2016 04:54
@sludge256 i just resetted it
and it worked
Glen Roberts
@ZeroAccess
Jan 14 2016 04:54
function lookUp(firstName, prop) {
// Only change code below this line
    for (i = 0; i < contacts.length; i++) {
        //enter the for loop
        if (contacts[i].firstName === firstName && contacts[i].hasOwnProperty(prop)) {
            //basically saying if the name is found and it has a property return property
            return contacts[i][prop];
        }
        else if (contacts[i].hasOwnProperty(prop) === false) {
            //or if the name exist and it doesn't have a property then say no property
            return "No such property";
        }
    } //exit the for loop
    // Now you've made it through the entire object and didn't find the name so what do you know?
    // You know that the object doesn't have an entry with the firstName so what could you return that
    // would allow the program to know that no such user exist?

    // The reason this is done outside of the for loop is because you're asking each entry "are you this person?"
    // and each entry says "nope move on" well how do you know that it's complete and done? basically the for loop
    // ends saying "damn didn't find anyone not sure what this guy wants me to do
    return; //something here  
}
David
@DavidPhan1992
Jan 14 2016 04:54
@sludge256 thanks dude
CamperBot
@camperbot
Jan 14 2016 04:54
davidphan1992 sends brownie points to @sludge256 :sparkles: :thumbsup: :sparkles:
:star: 804 | @sludge256 | http://www.freecodecamp.com/sludge256
Brian
@sludge256
Jan 14 2016 04:55
@DavidPhan1992 some day we'll be bug free :+1:
Glen Roberts
@ZeroAccess
Jan 14 2016 04:55
@mimics and @kevin2r please look above and read the comments, see if that helps?
@kevin your code is just in a different order but it's the same exact error so you'll have to either flip your code or look at it accordingly
@kevin2r ^^
Bearded One
@EpicBeard
Jan 14 2016 04:55
anyone on Nesting For Loops?
Rick Markins
@rkmarks
Jan 14 2016 04:55
@ZeroAccess palm face Now i get it. ugh i feel so dump lol
Bearded One
@EpicBeard
Jan 14 2016 04:55
waypoint 22
227
Kevin Rodriguez
@kevin2r
Jan 14 2016 04:56
@ZeroAccess ohh i see your point
Glen Roberts
@ZeroAccess
Jan 14 2016 04:56
I hope so, please let me know when you get the good ole checkmark :D if not we're gonna keep at it!
Kevin Voshell
@kvoshell
Jan 14 2016 04:56
so more like?
var secondTree = myPlants.list[1];
Brian
@sludge256
Jan 14 2016 04:56
Sorry to anyone that we're missing in terms of help. It's hard to keep up while providing exensive explanations.
Feel free to post again if you still have issues.
mimics
@mimics
Jan 14 2016 04:57
@ZeroAccess thanks for the comments let me dig in for a minute and get back to ya :)
CamperBot
@camperbot
Jan 14 2016 04:57
mimics sends brownie points to @zeroaccess :sparkles: :thumbsup: :sparkles:
:warning: mimics already gave zeroaccess points
Bearded One
@EpicBeard
Jan 14 2016 04:57
Nesting For Loops, waypoint 227, can't seem to see what I'm doing wrong
Kevin Voshell
@kvoshell
Jan 14 2016 04:57
I keep getting 'line':23, 'column': x error
Glen Roberts
@ZeroAccess
Jan 14 2016 04:57
@mimics not a problem goodluck! if not..get a bigger hammer and we'll try again!
Bearded One
@EpicBeard
Jan 14 2016 04:57

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

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

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

// Modify values below to test your code
multiplyAll([[1,2],[3,4],[5,6,7]]);
Glen Roberts
@ZeroAccess
Jan 14 2016 04:57
@tom103 it's 4 ticks just a heads up but.
nevermind lol
Rick Markins
@rkmarks
Jan 14 2016 04:57
@ZeroAccess thanks for the help!
CamperBot
@camperbot
Jan 14 2016 04:57
rkmarks sends brownie points to @zeroaccess :sparkles: :thumbsup: :sparkles:
Bearded One
@EpicBeard
Jan 14 2016 04:57
lol
CamperBot
@camperbot
Jan 14 2016 04:57
:star: 267 | @zeroaccess | http://www.freecodecamp.com/zeroaccess
Glen Roberts
@ZeroAccess
Jan 14 2016 04:58
@rkmarks not a problem, were you able to get it resolved?
Brian
@sludge256
Jan 14 2016 04:58
@tom103 j will just be the index. You need to refer to the subarray elements
You also have your product value assignment backwards
Rick Markins
@rkmarks
Jan 14 2016 04:59
@Payne1006 so if i have myPlants[1] and i remove .type and keep .list[1]; what does that do?
Bearded One
@EpicBeard
Jan 14 2016 04:59
how do I refer to the subarray elements?
David
@DavidPhan1992
Jan 14 2016 04:59
@tom103 hey tome you have something backwards lol
Rick Markins
@rkmarks
Jan 14 2016 04:59
@ZeroAccess Yes it worked like a charm after I saw I was still returning inside the for loop.
David
@DavidPhan1992
Jan 14 2016 04:59
it's in your inner for loop
Brian
@sludge256
Jan 14 2016 05:00
@tom103 Here's the example:
for (var i=0; i < arr.length; i++) {
  for (var j=0; j < arr[i].length; j++) {
    console.log(arr[i][j]);
  }
}
Glen Roberts
@ZeroAccess
Jan 14 2016 05:00
@rkmarks awesome, glad to hear I could assist. Goodluck on the next one!
Brian
@sludge256
Jan 14 2016 05:00
You can ignore the console.log
Bearded One
@EpicBeard
Jan 14 2016 05:00
so my For loops are fine, but I"m just not referring correctly to the subarray?
Kevin Voshell
@kvoshell
Jan 14 2016 05:00
@rkmarks Ah! Now I see, Thank you! :+1:
CamperBot
@camperbot
Jan 14 2016 05:00
payne1006 sends brownie points to @rkmarks :sparkles: :thumbsup: :sparkles:
:star: 228 | @rkmarks | http://www.freecodecamp.com/rkmarks
Glen Roberts
@ZeroAccess
Jan 14 2016 05:00
I'm supposed to be going home right now (I'm at work) but this is fun ... gonna knock out some more stuff
Rick Markins
@rkmarks
Jan 14 2016 05:01
You're welcome! @Payne1006
David
@DavidPhan1992
Jan 14 2016 05:01
@tom103 your j*= product is incoorect
Bearded One
@EpicBeard
Jan 14 2016 05:01
we fixed that earlier lol
David
@DavidPhan1992
Jan 14 2016 05:01
oh haha dind't see
didn't see
Glen Roberts
@ZeroAccess
Jan 14 2016 05:02
unacceptable... A THOUSAND LASHINGS!
Bearded One
@EpicBeard
Jan 14 2016 05:02
it's all good, just trying to figure out what I'm missing now
function multiplyAll(arr) {
  var product = 1;
  // Only change code below this line
  for (var i = 0; i < arr.length; i++) {
    for (var j = 0; j < arr[i].length; j ++) {
      product *= j;
    }
  }
  // Only change code above this line
  return product;
}

// Modify values below to test your code
multiplyAll([[1,2],[3,4],[5,6,7]]);
David
@DavidPhan1992
Jan 14 2016 05:02
you're so close
super close
look at the example
mimics
@mimics
Jan 14 2016 05:03
@ZeroAccess I got it to work now, adding return "No such contact" to the end. I guess i was confused because it's essentially saying, "if none of the conditions in my for loop are true, do this" and I thought that's what a final "else" clause was supposed to be for. but either way, i'm through now, and a billion thanks for the help
CamperBot
@camperbot
Jan 14 2016 05:03
mimics sends brownie points to @zeroaccess :sparkles: :thumbsup: :sparkles:
:warning: mimics already gave zeroaccess points
David
@DavidPhan1992
Jan 14 2016 05:03
they give you on the left
Joshua McKenzie
@mckenzieja
Jan 14 2016 05:03
I see that "Waypoint: Fill in the Blank with Placeholder Text" is bugged. Can I bypass this or would I have to wait for it to be fixed before proceeding?
nevermind. it was whitespacing
Bearded One
@EpicBeard
Jan 14 2016 05:04
function multiplyAll(arr) {
  var product = 1;
  // Only change code below this line
  for (var i = 0; i < arr.length; i++) {
    for (var j = 0; j < arr[i].length; j ++) {
      product *= arr[i][j];
    }
  }
  // Only change code above this line
  return product;
}

// Modify values below to test your code
multiplyAll([[1,2],[3,4],[5,6,7]]);
finally got it lol
Glen Roberts
@ZeroAccess
Jan 14 2016 05:04
@mimics not a problem, I hope you understand why it wasn't returning anything when it was in the for loop. As to not confuse you further I'll hush but hopefully you got it!
Bearded One
@EpicBeard
Jan 14 2016 05:04
thanks @DavidPhan1992
CamperBot
@camperbot
Jan 14 2016 05:04
tom103 sends brownie points to @davidphan1992 :sparkles: :thumbsup: :sparkles:
:star: 237 | @davidphan1992 | http://www.freecodecamp.com/davidphan1992
Brian
@sludge256
Jan 14 2016 05:04
@tom103 :+1:
Bearded One
@EpicBeard
Jan 14 2016 05:04
thanks @sludge256
CamperBot
@camperbot
Jan 14 2016 05:04
tom103 sends brownie points to @sludge256 :sparkles: :thumbsup: :sparkles:
:star: 805 | @sludge256 | http://www.freecodecamp.com/sludge256
mimics
@mimics
Jan 14 2016 05:04
ahh but since the for loop is first in the function, it looks to return one of those conditions first? so if i put "return: 'no contact'" before my for-loop, this wouldn't work, right?
David
@DavidPhan1992
Jan 14 2016 05:04
you got it @tom103
Brian
@sludge256
Jan 14 2016 05:04
I think I will hop out. I get trapped in here when I pop by.
Glen Roberts
@ZeroAccess
Jan 14 2016 05:05
Well then it would just return the 'no contact' immediately because it wouldn't even make it to the for loop
Jon Spencer
@batboy138
Jan 14 2016 05:05
help Counting Cards
CamperBot
@camperbot
Jan 14 2016 05:05

:point_right: checkpoint counting cards [wiki]

Checkpoint: Counting Cards

About Blackjack

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.

Value Cards
+1 2, 3, 4, 5, 6
0 7, 8, 9
-1 10, 'J', 'Q', 'K','A'

Instructions

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 the current count and the string "Bet" if the count is positive, or "Hold" if the count is zero or negative.

Example Output:

:pencil: read more about checkpoint counting cards on the FCC Wiki

mimics
@mimics
Jan 14 2016 05:05
right thats what i'm sayin
on the same page now!
Glen Roberts
@ZeroAccess
Jan 14 2016 05:06
WOOHOOOO
You Rock!
mimics
@mimics
Jan 14 2016 05:06
you're a real american hero haha
Glen Roberts
@ZeroAccess
Jan 14 2016 05:06
Hell yea, gonna tell my mom I amounted to something!
Bearded One
@EpicBeard
Jan 14 2016 05:06
lol
mimics
@mimics
Jan 14 2016 05:07
haha check out my waypoint's ma
Bearded One
@EpicBeard
Jan 14 2016 05:08
they are doing construction in my building and it's driving me up the wall
how many times do they need to drill into a concrete wall already!!!
mimics
@mimics
Jan 14 2016 05:08
@tom103 at midnight?
msha833
@msha833
Jan 14 2016 05:09
was that a pun? Up the wall and they're doing construction
Glen Roberts
@ZeroAccess
Jan 14 2016 05:10
@tom103 are ya sure it's not someone snoring?
Derek Welton
@freefora11
Jan 14 2016 05:11
For the zipline "Camper News" the api they give us "http://www.freecodecamp.com/news/hot" has the time posted for each post as something like "1452561630193". I can't figure out what time this is....
Emanuel Quimper
@EQuimper
Jan 14 2016 05:12

I am crazy or just I really don't understand the concept here ?

Checkpoint: Counting Cards

var count = 0;

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

  if (count > 0) {
    return 'Bet';
  }  else {
    return 'Hold';
  }

  // Only change code above this line
}

// Add/remove calls to test your function.
// Note: Only the last will display
cc(2); cc(3); cc(7); cc('K'); cc('A');
Kevin Voshell
@kvoshell
Jan 14 2016 05:14
@EQuimper Need something to display both "Bet/Hold" and count value
Glen Roberts
@ZeroAccess
Jan 14 2016 05:15
@freefora11 check out UTC time
Kunal
@kunal047
Jan 14 2016 05:15
@EQuimper In case 7 : case8: case 9: count should not be set to zero ! There should be no change in the value of count in that cases .
Glen Roberts
@ZeroAccess
Jan 14 2016 05:16
@freefora11 that may help you, it's a standard for programming to tell time so that programs can communicate with each other over multiple time zones and applications.
Emanuel Quimper
@EQuimper
Jan 14 2016 05:16
@Payne1006 Display like log?
Derek Welton
@freefora11
Jan 14 2016 05:17
@ZeroAccess alright Ill look more into that, thanks
CamperBot
@camperbot
Jan 14 2016 05:17
freefora11 sends brownie points to @zeroaccess :sparkles: :thumbsup: :sparkles:
:star: 268 | @zeroaccess | http://www.freecodecamp.com/zeroaccess
Emanuel Quimper
@EQuimper
Jan 14 2016 05:17
@kunal047 Ok thank you gonna try to figure out
Tim Bell
@MindfulBell
Jan 14 2016 05:17
any node.js peeps around?
Glen Roberts
@ZeroAccess
Jan 14 2016 05:17
<--
@MindfulBell tons of people here are doing node I'd think. What's up?
Tim Bell
@MindfulBell
Jan 14 2016 05:18
I am doing the My First Asynch I/O on the tutorial and having trouble
Emanuel Quimper
@EQuimper
Jan 14 2016 05:18
node is my goal for me
Glen Roberts
@ZeroAccess
Jan 14 2016 05:19
@MindfulBell paste your code please and if you have a particular question we can look or just say "I DUNNO WHAT THE HELL IS GOING ON AHHH" ..that works too I guess
Herman Fassett
@HermanFassett
Jan 14 2016 05:19
Yep @MindfulBell code
Tim Bell
@MindfulBell
Jan 14 2016 05:19
Yea I know guys. Just testing the waters. sheesh
var fs = require('fs');
var buf;
var bufArr;
var len;

function myFunc(callback){
    fs.readFile(process.argv[2], function(err, data){
        if (err) {
            console.log('error');
        }
        else {
            buf = data;
            bufArr = buf.toString().split('\n');
            len = bufArr.length-1;
        }
    });
    callback();
}

function printStuff(){
    console.log(len);
}

myFunc(printStuff);
Herman Fassett
@HermanFassett
Jan 14 2016 05:19
:P I node that
knew*
Tim Bell
@MindfulBell
Jan 14 2016 05:19
logs undefined
and i don't understand the bit about utf-8
Herman Fassett
@HermanFassett
Jan 14 2016 05:20
@MindfulBell my first asynch? I thought that was a real short one
Tim Bell
@MindfulBell
Jan 14 2016 05:20
my first I/O is relatively short
this one introduces callbacks and asynchronous
Kevin Voshell
@kvoshell
Jan 14 2016 05:20
@EQuimper after each grouping of case statements, you will need a unique return
Herman Fassett
@HermanFassett
Jan 14 2016 05:21

@MindfulBell I think an option is

fs.readFile(file, 'utf8', callback)

for utf but not necessary

Emanuel Quimper
@EQuimper
Jan 14 2016 05:22
@Payne1006 Thank you ok I understand now but the funny things is in the controle all work try a lot of change card and all work lol
CamperBot
@camperbot
Jan 14 2016 05:22
equimper sends brownie points to @payne1006 :sparkles: :thumbsup: :sparkles:
:star: 218 | @payne1006 | http://www.freecodecamp.com/payne1006
Jon Spencer
@batboy138
Jan 14 2016 05:22
@EQuimper Did you remember to add a space to ' Bet'and ' Hold'?
Herman Fassett
@HermanFassett
Jan 14 2016 05:22
@MindfulBell uh but since it Is asynch you should just log inside the readFile right after len otherwise it will be undefined
Kevin Voshell
@kvoshell
Jan 14 2016 05:22
Very Nice! @EQuimper
Herman Fassett
@HermanFassett
Jan 14 2016 05:22
Or move the function call I guess
Tim Bell
@MindfulBell
Jan 14 2016 05:23
i was trying to replicate this:
var fs = require('fs')
var myNumber = undefined

function addOne(callback) {
  fs.readFile('number.txt', function doneReading(err, fileContents) {
    myNumber = parseInt(fileContents)
    myNumber++
    callback()
  })
}

function logMyNumber() {
  console.log(myNumber)
}

addOne(logMyNumber)
oh
wait
duh
pa pow
Herman Fassett
@HermanFassett
Jan 14 2016 05:23
;)
Tim Bell
@MindfulBell
Jan 14 2016 05:24
i know there is a much simpler way probably, but trying to learn asycnh
Emanuel Quimper
@EQuimper
Jan 14 2016 05:24
@batboy138 sry I don't understand what you say ?
Herman Fassett
@HermanFassett
Jan 14 2016 05:24
Well you could just fs readFile without all the functions and make some lines into one and ignore err to make it short but you have it all
Tim Bell
@MindfulBell
Jan 14 2016 05:24
@HermanFassett could I hav ejust console.loged in the else statement?
Herman Fassett
@HermanFassett
Jan 14 2016 05:25
Yeah
Tim Bell
@MindfulBell
Jan 14 2016 05:25
ah
right, well th eexercise in a callback helped i guess
the doc on github took me down one road and the instructions in the exercise suggested a different one
sigh
thanks @HermanFassett
CamperBot
@camperbot
Jan 14 2016 05:25
mindfulbell sends brownie points to @hermanfassett :sparkles: :thumbsup: :sparkles:
:star: 1341 | @hermanfassett | http://www.freecodecamp.com/hermanfassett
Herman Fassett
@HermanFassett
Jan 14 2016 05:25

I think even just

fs.readFile(file, function (err, data) {
  console.log(data.toString().split('\n').length - 1)
})

but have to double check

Tim Bell
@MindfulBell
Jan 14 2016 05:26
ah. yea that's super simple
my head is not in a great place today, messing up really simple things.
@HermanFassett how do these work: file:///home/ubuntu/.nvm/versions/node/v4.1.1/lib/node_modules/learnyounod
e/node_apidoc/path.html . i cannot get there in a browser
Wes Kay
@weskay
Jan 14 2016 05:31
This message was deleted
  i = 0;
  while (i < contacts.length) {
    if (firstName !== 'firstName'){
      return 'No such contact';
    } else if (firstName === "firstName" && contacts[i].hasOwnProperty(prop)) {
      return 'No such property';
    } else {
      return contacts[i].prop;
    }
    i++;
  }
What's missing/wrong?
Checkpoint: Profile Lookup
Emanuel Quimper
@EQuimper
Jan 14 2016 05:33
@batboy138 Thank you after reread the code I see where I miss
CamperBot
@camperbot
Jan 14 2016 05:33
equimper sends brownie points to @batboy138 :sparkles: :thumbsup: :sparkles:
:star: 239 | @batboy138 | http://www.freecodecamp.com/batboy138
Emanuel Quimper
@EQuimper
Jan 14 2016 05:34
Final answer :)
var count = 0;

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

  if (count > 0) {
    return count + ' Bet';
  }  else {
    return count + ' Hold';
  }

  // Only change code above this line
}

// Add/remove calls to test your function.
// Note: Only the last will display
cc(2); cc(3); cc(4); cc(5); cc(6);
Glen Roberts
@ZeroAccess
Jan 14 2016 05:34
@weskay I was afk, did you figure it out? A lot of people are having issues with this one
sean9
@sean9
Jan 14 2016 05:34
function multiplyAll(arr) {
  var product = 1;
  // Only change code below this line

  for (var i = 0; i < multiplyAll.length; i++) {
    for (var j = 0; j < multiplyAll[i].length; j++) {
      product = product * multiplyAll[i][j];
    }
  }



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

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


>
can anyone chime in
Pratik Ratnaparkhi
@pratikr1593
Jan 14 2016 05:35
<link href="http://fonts.googleapis.com/css?family=Lobster" rel="stylesheet" type="text/css">
<style>
  h2 {
    font-family: Lobster, Monospace;
  }

  .thick-green-border {
    border-color: green;
    border-width: 10px;
    border-style: solid;
    border-radius: 50%;
  }

</style>

<div class="container-fluid">
  <div class="row">
    <div class="col-xs-8">
      <h2 class="text-primary text-center">CatPhotoApp</h2>
    </div>
    <div class="col-xs-4">
      <a href="#"><img class="img-responsive thick-green-border" src="https://bit.ly/fcc-relaxing-cat"></a>
    </div>
  </div>
  <img src="http://bit.ly/fcc-running-cats" class="img-responsive">
  <div class="row">
    <div class="col-xs-4">
      <button class="btn btn-block btn-primary"><i class="fa fa-thumbs-up"></i> Like</button>
    </div>
    <div class="col-xs-4">
      <button class="btn btn-block btn-info"><i class="fa fa-info-circle"></i> Info</button>
    </div>
    <div class="col-xs-4">
      <button class="btn btn-block btn-danger"><i class="fa fa-trash"></i> Delete</button>
    </div>
  </div>
  <p>Things cats <span class="text-danger">love:</span></p>
  <ul>
    <li>cat nip</li>
    <li>laser pointers</li>
    <li>lasagna</li>
  </ul>
  <p>Top 3 things cats hate:</p>
  <ol>
    <li>flea treatment</li>
    <li>thunder</li>
    <li>other cats</li>
  </ol>
  <form action="/submit-cat-photo">
    <div class="row">
      <div class="col-xs-6">
        <label><input class="form-control" type="radio" name="indoor-outdoor"> Indoor</label>
      </div>
      <div class="col-xs-6">
        <label><input type="radio" name="indoor-outdoor"> Outdoor</label>
      </div>
    </div>
    <div class="row">
      <div class="col-xs-4">
        <label><input type="checkbox" name="personality"> Loving</label>
      </div>
      <div class="col-xs-4">
        <label><input type="checkbox" name="personality"> Lazy</label>
      </div>
      <div class="col-xs-4">
        <label><input type="checkbox" name="personality"> Crazy</label>
      </div>
    </div>
    <input type="text" placeholder="cat photo URL" required>

    <button class="btn btn-primary" type="submit"><i class="fa fa-paper-plane"></i>Submit</button>
  </form>
</div>
Wes Kay
@weskay
Jan 14 2016 05:35
@ZeroAccess I did not
Pratik Ratnaparkhi
@pratikr1593
Jan 14 2016 05:35
it says : Give the text input in your form the class form-control.
Glen Roberts
@ZeroAccess
Jan 14 2016 05:35
@sean where you have product = product * multiplyAll ..that won't work. What are you actually multiplying by?
@weskay k one sec