These are chat archives for FreeCodeCamp/HelpJavaScript

25th
May 2016
Christian Todd
@chrstntdd
May 25 2016 00:00
@ymb456 and the problem is that the weather api wont take a regular http request :worried:
Yev
@ymb456
May 25 2016 00:00
Christian, I think the opposide. I takes exactly http.
Krishna Pradhan
@kpaccess
May 25 2016 00:00
hi @chrstntdd try out this link http://jsbin.com/gaxidamike/edit?js,console,output
Aryan
@aryandua
May 25 2016 00:00
hey whassup guys?
Yev
@ymb456
May 25 2016 00:00
do you use openweathermap?
this is using the http.
Christian Todd
@chrstntdd
May 25 2016 00:01
@ymb456 Im trying to use a different weather api becuase i wanted to change it up.
Yev
@ymb456
May 25 2016 00:02
I see. then I don't know.
Justin Woodward
@jwoo92
May 25 2016 00:02
@Chrono79 thanks, using !important works but that can be a sneaky call i have heard.
CamperBot
@camperbot
May 25 2016 00:02
jwoo92 sends brownie points to @chrono79 :sparkles: :thumbsup: :sparkles:
:cookie: 839 | @chrono79 |http://www.freecodecamp.com/chrono79
Justin Woodward
@jwoo92
May 25 2016 00:02
none the less it did solve the issue being a simplistic webpage.
Diego Mayer
@Chrono79
May 25 2016 00:03
@kpaccess Encode the following sequence, separated by spaces:
backslash tab tab carriage-return new-line and assign it to myStr
You have to use the table at the left to translate that
var myStr = "\t \t"; this would be ok if you had to translate tab tab only
Christian Todd
@chrstntdd
May 25 2016 00:05
@kpaccess So Im able to retrieve the location data from that api and store it in variables for the lat and long data needed to call the weather api, but I cant retrieve data from the weather api.
Aryan
@aryandua
May 25 2016 00:05
Hey guys i dont get what you are supposed to do in where art thou
??
I am 7 tasks away from my front end!!
Alex Berndt
@mechozaiko
May 25 2016 00:06
good night guys; I will try harder by myself!
Thompson Ike
@hubhubace
May 25 2016 00:08
guys I dont understang this code formating stuff
Aryan
@aryandua
May 25 2016 00:11
help format @hubhubace
CamperBot
@camperbot
May 25 2016 00:11
no wiki entry for: format @hubhubace
Aryan
@aryandua
May 25 2016 00:11
help format
CamperBot
@camperbot
May 25 2016 00:11

:point_right: code formatting [wiki]

Multi line Code

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

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

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

Single line Code

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

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

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

Nikki
@ntaylor09
May 25 2016 00:13
Hello I have a simple question anyone having a brain fart?

Assign the value 7 to variable a.

Assign the contents of a to variable b.

var a;
var b = 2;

// Only change code below this line
var b = 7;
var a = 7;

Stephen James
@sjames1958gm
May 25 2016 00:14
@ntaylor09 The variables are already defined so don't repeat var
Nikki
@ntaylor09
May 25 2016 00:15
ok how do i assign contents of a to variable b
Stephen James
@sjames1958gm
May 25 2016 00:15
@ntaylor09 The same way you assigned 7 to a
Nikki
@ntaylor09
May 25 2016 00:18
oo ok i got it smh thanks
Tiffany White
@twhite96
May 25 2016 00:22
Can someone help me with this Profile Lookup waypoint? I almost have it but there is a bug here somewhere, according to the console. It’s my last one until finishing the Basic Algorithm scripting
//Setup
var contacts = [
    {
        "firstName": "Akira",
        "lastName": "Laine",
        "number": "0543236543",
        "likes": ["Pizza", "Coding", "Brownie Points"]
    },
    {
        "firstName": "Harry",
        "lastName": "Potter",
        "number": "0994372684",
        "likes": ["Hogwarts", "Magic", "Hagrid"]
    },
    {
        "firstName": "Sherlock",
        "lastName": "Holmes",
        "number": "0487345643",
        "likes": ["Intriguing Cases", "Violin"]
    },
    {
        "firstName": "Kristian",
        "lastName": "Vos",
        "number": "unknown",
        "likes": ["Javascript", "Gaming", "Foxes"]
    }
];


function lookUpProfile(firstName, prop) {
// Only change code below this line
  if (lookUpProfile.hasOwnProperty(firstName) && lookUpProfile[prop] === firstName) {
    return console.log(firstName);
  } else if (!lookUpProfile.hasOwnProperty(firstName)) {
    return "No such contact";
  }

// Only change code above this line
}

// Change these values to test your function
lookUpProfile("Akira", "likes");
This is my code so far
Stephen James
@sjames1958gm
May 25 2016 00:23
@twhite96 lookupProfile is a function you are using it like an object - the object is contacts
Tiffany White
@twhite96
May 25 2016 00:24
Yeah but when I add contacts it says it is not defined
Stephen James
@sjames1958gm
May 25 2016 00:25
Then you are doing something else wrong, contacts is the object be looked up in
Tiffany White
@twhite96
May 25 2016 00:25
Okay. Changed it to contacts @sjames1958gm but I am still not passing all the tests
The only condition passing is in the else if statement
//Setup
var contacts = [
    {
        "firstName": "Akira",
        "lastName": "Laine",
        "number": "0543236543",
        "likes": ["Pizza", "Coding", "Brownie Points"]
    },
    {
        "firstName": "Harry",
        "lastName": "Potter",
        "number": "0994372684",
        "likes": ["Hogwarts", "Magic", "Hagrid"]
    },
    {
        "firstName": "Sherlock",
        "lastName": "Holmes",
        "number": "0487345643",
        "likes": ["Intriguing Cases", "Violin"]
    },
    {
        "firstName": "Kristian",
        "lastName": "Vos",
        "number": "unknown",
        "likes": ["Javascript", "Gaming", "Foxes"]
    }
];


function lookUpProfile(firstName, prop) {
// Only change code below this line
  if (contacts.hasOwnProperty(firstName) && contacts[prop] === firstName) {
    return console.log(firstName);
  } else if (!contacts.hasOwnProperty(firstName)) {
    return "No such contact";
  }

// Only change code above this line
}

// Change these values to test your function
lookUpProfile("Akira", "likes");
Stephen James
@sjames1958gm
May 25 2016 00:26
@twhite96 You need to re-read the instructions.
Tiffany White
@twhite96
May 25 2016 00:26
Changed the code
Stephen James
@sjames1958gm
May 25 2016 00:26
@twhite96 You have to check each contact to find the one that has the matching first name.
@twhite96 Imagine that the contacts are a stack of business card and you have to find the matching firstName and then return the desired property.
Tiffany White
@twhite96
May 25 2016 00:31
SO I need a for loop...
Luke
@lukeharris
May 25 2016 00:31
Yep!
Thompson Ike
@hubhubace
May 25 2016 00:31
@sjames1958gm please help
Mihó Dániel
@Dubbie
May 25 2016 00:31
Hey peeps, I'm doing the Profile lookup aswell, can someone tell me why person.firstName gives me the correct values but person[firstName] does not?
Thompson Ike
@hubhubace
May 25 2016 00:31

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

      case "A":
count--;

}
return "5 Bet" ,"0 Hold" , "-5 Hold";

// Only change code above this line
}

Santosh Kumar Toleti
@Santosh456
May 25 2016 00:32
anyone can help me to solve these problem
Thompson Ike
@hubhubace
May 25 2016 00:32
or anyone free?
Luke
@lukeharris
May 25 2016 00:32
@Santosh456 can I see your code?
Santosh Kumar Toleti
@Santosh456
May 25 2016 00:33

function orderMyLogic(val) {
if (val < 10) {
return "Less than 10";
} else if (val < 5) {
return "Less than 5";
} else {
return "Greater than or equal to 10";
}
}

// Change this value to test
orderMyLogic(7);

Stephen James
@sjames1958gm
May 25 2016 00:33
@Dubbie Because firstName is a literal property name, it is not holding a property name when you use [] it assumes it is a variable holding a property name
Thompson Ike
@hubhubace
May 25 2016 00:33

@lukeharris

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

      case "A":
count--;

}
return "5 Bet" ,"0 Hold" , "-5 Hold";

// Only change code above this line
}

ALMY91
@ALMY91
May 25 2016 00:33
hi is anybody able to help me out here?
Mihó Dániel
@Dubbie
May 25 2016 00:34
@sjames1958gm got it thanks!
CamperBot
@camperbot
May 25 2016 00:34
dubbie sends brownie points to @sjames1958gm :sparkles: :thumbsup: :sparkles:
:star2: 1236 | @sjames1958gm |http://www.freecodecamp.com/sjames1958gm
Jamen Marz
@jamen
May 25 2016 00:34
Sure, feel free to post your code.
Stephen James
@sjames1958gm
May 25 2016 00:34
@hubhubace Did you read the instructions about if count > 0 return count + "some string" else return count + "some other string"
Luke
@lukeharris
May 25 2016 00:34
@Santosh456 your order is mixed up
ALMY91
@ALMY91
May 25 2016 00:34
@jamen hello there
this is my code
Luke
@lukeharris
May 25 2016 00:34
Order matters, so you have to switch some things around, try switching some stuff around.
Stephen James
@sjames1958gm
May 25 2016 00:34
@Santosh456 if val is 3 then it will pass < 10 before getting to < 5
ALMY91
@ALMY91
May 25 2016 00:35
try {
var n = Number(prompt("Please enter a positive integer","")); //Ask the user to enter a number
var f = factorial(n) //Compute the factorial of the number, assuming the input is valid
alert(n+"!="+f); // Display the results

}

catch (ex) {alert(ex);

}
Stephen James
@sjames1958gm
May 25 2016 00:35
@twhite96 Yes.
Thompson Ike
@hubhubace
May 25 2016 00:35
om
omg
i am stuck lol
js

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

          case "A":
    count--;




 }
  return "5 Bet" ,"0 Hold" , "-5 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');
ALMY91
@ALMY91
May 25 2016 00:35
@jamen im not too sure why am i getting a reference error even if i had entered a positive integer?
Santosh Kumar Toleti
@Santosh456
May 25 2016 00:36
@sjames1958gm i am nt understanding what u r telling
Luke
@lukeharris
May 25 2016 00:36
@hubhubace can you link the actual problem?
Stephen James
@sjames1958gm
May 25 2016 00:36
if (count > 0) return count + " Bet" else return count + " Hold"
Jamen Marz
@jamen
May 25 2016 00:36
@ALMY91 You initialize the Number object with new, so, new Number(...), are you sure you couldn't use parseInteger or parseFloat either? Also, is the factorial function defined somewhere?
Stephen James
@sjames1958gm
May 25 2016 00:36
@hubhubace I am not sure about the order.
Thompson Ike
@hubhubace
May 25 2016 00:36
You will write a card counting function. It will receive a card parameter and increment or decrement the global count variable according to the card's value (see table). The function will then return a string with the current count and the string "Bet" if the count is positive, or "Hold" if the count is zero or negative. The current count and the player's decision ("Bet" or "Hold") should be separated by a single space.
Santosh Kumar Toleti
@Santosh456
May 25 2016 00:36
@sjames1958gm i am nt understanding what u r telling
Stephen James
@sjames1958gm
May 25 2016 00:37
@Santosh456 val is 3 if (val < 10) return "less than 10"
Thompson Ike
@hubhubace
May 25 2016 00:37
@sjames1958gm pls what should i do?
from corrections i can learn
what is wrong and what needs to be done
i am out of ideas
Stephen James
@sjames1958gm
May 25 2016 00:38
@hubhubace if (count > 0) return count + " Bet" else return count + " Hold" this code needs to be after the switch statement. If you post your code, please delete all the extra lines..
Mihó Dániel
@Dubbie
May 25 2016 00:38
If I want to share my code do i just copy/paste it here?
Stephen James
@sjames1958gm
May 25 2016 00:38
help format
CamperBot
@camperbot
May 25 2016 00:38

:point_right: code formatting [wiki]

Multi line Code

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

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

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

Single line Code

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

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

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

Stephen James
@sjames1958gm
May 25 2016 00:38
@Dubbie :point_up:
ALMY91
@ALMY91
May 25 2016 00:38
@jamen u mentioned that i had initialized Number object with new but i dont see new in my code tho. Im pretty new to Javascript just started 2 mths ago so im just following what the book says.. this is the code given. And the reference error actually states that factorial is not defined
Stephen James
@sjames1958gm
May 25 2016 00:39
@Santosh456 You need to put the more specific test first (< 5) before (< 10)
@ALMY91 The code must assume you have factorial defined somewhere
Jamen Marz
@jamen
May 25 2016 00:40
@ALMY91 Are you supposed to make a factorial function for the lesson? If so, I'll let you try and figure that piece out, since I'd be giving away the whole lesson.
ALMY91
@ALMY91
May 25 2016 00:40
@jamen it just states that it uses the factorial method here im not too sure if im missing smth out here
Mihó Dániel
@Dubbie
May 25 2016 00:41
Ok so can someone point me where I failed? Console logging gives me the correct values
function lookUpProfile(firstName, prop){
// Only change code below this line
  var f = 0;
  contacts.forEach(function(p) {
    if(p.firstName === firstName ) {
      f++;
      if(p.hasOwnProperty(prop)){
        return p[prop];
      } else {
        return "No such property";
      }
    }
  });
  if (f === 0) {
    return "No such contact";
  }
// Only change code above this line
}
Thompson Ike
@hubhubace
May 25 2016 00:42
@sjames1958gm what extras?
Stephen James
@sjames1958gm
May 25 2016 00:42
@hubhubace All the blank lines that take up all the space
Thompson Ike
@hubhubace
May 25 2016 00:42
ok
Luke
@lukeharris
May 25 2016 00:43
@Dubbie you need to start with a for() loop
Mihó Dániel
@Dubbie
May 25 2016 00:43
Does the order matter?
Stephen James
@sjames1958gm
May 25 2016 00:44
@Dubbie Because you are using forEach your returns don't return anything. You either have to have a variable outside the forEach that you set the return to, or use a regular for loop
Luke
@lukeharris
May 25 2016 00:44
Yes, it should be at the top. I would start with creating an if that checks if the firstName that checks if the firstName is in the contacts
Thompson Ike
@hubhubace
May 25 2016 00:45
@sjames1958gm }
}
js

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 "K":
 case "A":
    count--;

    }
  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(7); cc('K'); cc('A');
still not workin
Santosh Kumar Toleti
@Santosh456
May 25 2016 00:46
@sjames1958gm I m trying to solve but the error is coming
Jaren Escueta
@jarenescueta731
May 25 2016 00:47
@Dubbie you could also use a while loop
Mihó Dániel
@Dubbie
May 25 2016 00:47
I'm just trying to figure out why forEach does not return anything
Stephen James
@sjames1958gm
May 25 2016 00:47
@hubhubace You need a semicolon after the " Bet";
@Santosh456 What error
JimmyBonez
@JimmyBonez
May 25 2016 00:47
Switch is too long. I know it is a switch section, but think of a if loop that would work better
Stephen James
@sjames1958gm
May 25 2016 00:49
@hubhubace Check all your cases
Thompson Ike
@hubhubace
May 25 2016 00:49
type error
"" is not a function
Stephen James
@sjames1958gm
May 25 2016 00:49
@Dubbie Because you are returning to the forEach - which doesn't do anything with the return values
Anusha
@anushavicky
May 25 2016 00:50

var count = 0;

function cc(card) {
switch (card) {
case 2 :
case 3 :
case 4 :
case 5 :
case 6 :
count +=1;
break;

    case 7 :
    case 8 :
    case 9 :
 count +=0;
  break;

    case 10 :
    case "J" :
    case "Q" :
    case "K" :
    case "A" :
  count +=-1;
  break; 

}

return count + ( count > 0 ? " Bet": " Hold");

Prashant Gupta
@darkpasanger
May 25 2016 00:50

Hi I'm a new to JavaScript and I'm trying to solve the longest word in a string here is my code function findLongestWord(str) {
var a = str.split("");
var len = 0;
for(i=0;i<=a.length;i++)
{
if(a[i].length == a[i+1].length)
len = a[i].length;
else
len = a[i+1].length;
}
return leng;
}

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

Jaren Escueta
@jarenescueta731
May 25 2016 00:51
@darkpasanger what is the value of leng?
Prashant Gupta
@darkpasanger
May 25 2016 00:51
@jarenescueta731 sorry for the typo it's len
@jarenescueta731 the last statement is return len; not return leng;
drew
@drewcodes
May 25 2016 00:53
hey, i have a newb question: is the javascript we're learning in the front end dev curriculum considered angularjs?
Jaren Escueta
@jarenescueta731
May 25 2016 00:53
@darkpasanger yup, just looking at what i did
Thompson Ike
@hubhubace
May 25 2016 00:53
pls anyone done the card counting challenge?
i am not cracking this
Stephen James
@sjames1958gm
May 25 2016 00:54
@hubhubace Anusha just posted a solution above.
Prashant Gupta
@darkpasanger
May 25 2016 00:54
@jarenescueta731 so does it work
Stephen James
@sjames1958gm
May 25 2016 00:54
@darkpasanger You are going to go over the end of the array by two bad practice.
Prashant Gupta
@darkpasanger
May 25 2016 00:55
@sjames1958gm what are they?
Stephen James
@sjames1958gm
May 25 2016 00:55
@darkpasanger Shouldn't you be picking the longest length not just if the next one is different?
@darkpasanger What are what?
Thompson Ike
@hubhubace
May 25 2016 00:56
@anushavicky please what difference is mine?
js

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 "K":
 case "A":
    count--;

    }
  return count + ( count > 0 ? " Bet": " 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');
Stephen James
@sjames1958gm
May 25 2016 00:56
@hubhubace ONe thing is your missing the "Q" -
Prashant Gupta
@darkpasanger
May 25 2016 00:56
@sjames1958gm I'am going to every element in the array and storing the longest string in a variable
Thompson Ike
@hubhubace
May 25 2016 00:57
wow
ok
Stephen James
@sjames1958gm
May 25 2016 00:57
@darkpasanger I don't see it, you are never testing for > or <= only ==
Thompson Ike
@hubhubace
May 25 2016 00:58
fixed that
but still stuck
any difference with c++ and +=
Darwin RC
@darwinrc
May 25 2016 00:59
@hubhubace count += 0; does nothing
Jaren Escueta
@jarenescueta731
May 25 2016 00:59
@darkpasanger btw did you remember to declare i as a var?
Prashant Gupta
@darkpasanger
May 25 2016 00:59
@sjames1958gm ohh I din't saw that.But it is still giving me syntax error.
Jaren Escueta
@jarenescueta731
May 25 2016 01:00
@jarenescueta731 because in the code you posted above, i is not declared
Stephen James
@sjames1958gm
May 25 2016 01:00
@darkpasanger What does it look like now. use the correct formatting for posting.
Prashant Gupta
@darkpasanger
May 25 2016 01:00
@sjames1958gm i can go over my logic again but I'm not able to figure out the problem with the syntax.
Stephen James
@sjames1958gm
May 25 2016 01:00
help format
CamperBot
@camperbot
May 25 2016 01:00

:point_right: code formatting [wiki]

Multi line Code

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

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

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

Single line Code

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

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

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

Thompson Ike
@hubhubace
May 25 2016 01:00
@darwinrc please look at my code and tell me what is wrong
js

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

    }
  return count + ( count > 0 ? " Bet": " 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');
Darwin RC
@darwinrc
May 25 2016 01:01
@hubhubace let me contextualize the exercise first... that's one thing
Prashant Gupta
@darkpasanger
May 25 2016 01:02

@sjames1958gm
function findLongestWord(str) {
var a = str.split("");
var len = 0;
for(i=0;i<=a.length;i++)
{
if(a[i].length >= a[i+1].length)
len = a[i].length;
else
len = a[i+1].length;
}
return len;
}

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

Stephen James
@sjames1958gm
May 25 2016 01:02
@darkpasanger Formatting.
help format
CamperBot
@camperbot
May 25 2016 01:02

:point_right: code formatting [wiki]

Multi line Code

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

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

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

Single line Code

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

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

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

innovatorandcreator
@innovatorandcreator
May 25 2016 01:02
Hello all and happy Tuesday. Working through #217 Record Collection exercise and can't seem to get past it. My code is below

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

return collection;
}

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

Thompson Ike
@hubhubace
May 25 2016 01:03
@darwinrc You will write a card counting function. It will receive a card parameter and increment or decrement the global count variable according to the card's value (see table). The function will then return a string with the current count and the string "Bet" if the count is positive, or "Hold" if the count is zero or negative. The current count and the player's decision ("Bet" or "Hold") should be separated by a single space
Darwin RC
@darwinrc
May 25 2016 01:03
@hubhubace the following cases are not necessary:
case 7: case 8: case 9: count += 0; break;
Stephen James
@sjames1958gm
May 25 2016 01:03
@darkpasanger Shouldn't you be comparing to the stored length, looks like you will only select between the last two word. Also, you are going over the end of the arry by two
@hubhubace I just put that code in and it passed.
Jaren Escueta
@jarenescueta731
May 25 2016 01:04
@darkpasanger what @sjames1958gm is saying. and also you haven't declared your i variable
Thompson Ike
@hubhubace
May 25 2016 01:05
@sjames1958gm maybe i should refresh?
Stephen James
@sjames1958gm
May 25 2016 01:05
@hubhubace possibly
@innovatorandcreator You are setting the variable myRecord, not updating the collection. research how to call delete because that is wrong.
Thompson Ike
@hubhubace
May 25 2016 01:06
@sjames1958gm ok now
but what i dont understand is this statement
return count + ( count > 0 ? " Bet": " Hold");
why the ?
Prashant Gupta
@darkpasanger
May 25 2016 01:06
function findLongestWord(str) {
 var a = str.split(""); 
 var len = 0;
  for(i=0;i<=a.length;i++)
    {
      if(a[i].length >= a[i+1].length)
        len = a[i].length;
      else
        len = a[i+1].length;
    }
  return len;
}

findLongestWord("The quick brown fox jumped over the lazy dog");
innovatorandcreator
@innovatorandcreator
May 25 2016 01:06
thank you for helpful hint. Off to research now
Thompson Ike
@hubhubace
May 25 2016 01:06
@sjames1958gm thanks
CamperBot
@camperbot
May 25 2016 01:06
hubhubace sends brownie points to @sjames1958gm :sparkles: :thumbsup: :sparkles:
:star2: 1237 | @sjames1958gm |http://www.freecodecamp.com/sjames1958gm
Thompson Ike
@hubhubace
May 25 2016 01:07
@anushavicky thanks
CamperBot
@camperbot
May 25 2016 01:07
hubhubace sends brownie points to @anushavicky :sparkles: :thumbsup: :sparkles:
:cookie: 227 | @anushavicky |http://www.freecodecamp.com/anushavicky
Stephen James
@sjames1958gm
May 25 2016 01:07
@darkpasanger when i === a.length you are off the end of the array, and a[i+1] is more off the end
if(a[i].length > len) len = a[i].length; this is the check you are looking for.
Chris Lacaille
@ChrisL108
May 25 2016 01:08
This message was deleted
Nick Ang
@nickangtc
May 25 2016 01:08
Hi guys, I'm new here. Is this thread only for the specific challenge I'm looking at, or is it a general chatroom for all challenges (ie. I should state my current challenge and problem I'm facing)?
Chris Lacaille
@ChrisL108
May 25 2016 01:08

If I have all the names in a array like this ...

let streamers = ["freecodecamp", "storbeck", "terakilobyte",
 "habathcx","RobotCaleb","thomasballinger","noobs2ninjas","beohoff",
 "ESL_SC2", "OgamingSC2", "cretetion"];

Is there an easier way to make objects with them then this?

var usr1 = new Streamer('freecodecamp');
usr1.getUser();
var usr2 = new Streamer('cretetion');
usr2.getUser();
var usr1 = new Streamer('storbeck');
usr1.getUser();

using forEach() or something similar?

Jaren Escueta
@jarenescueta731
May 25 2016 01:09
@darkpasanger once again, you still need to declare your i variable, as in var i = 0, in your for loop
Chris Lacaille
@ChrisL108
May 25 2016 01:09
but still using prototypal inheritance
Thompson Ike
@hubhubace
May 25 2016 01:10
return count + ( count > 0 ? " Bet": " Hold"); please someone explain the ? in this statement
Prashant Gupta
@darkpasanger
May 25 2016 01:11
@jarenescueta731 does it is necessary?
Nick Ang
@nickangtc
May 25 2016 01:11
Ok figured that it's across the board all JS-related help!
Chris Lacaille
@ChrisL108
May 25 2016 01:11
@hubhubace count > 0 ? " Bet": " Hold" is shorthand for
if (count > 0) {
 return "Bet";
} else {
return "Hold";
}
Stephen James
@sjames1958gm
May 25 2016 01:12
@darkpasanger It is not necessary, but is good practice.
Thompson Ike
@hubhubace
May 25 2016 01:12
@ChrisL108 thanks
CamperBot
@camperbot
May 25 2016 01:12
hubhubace sends brownie points to @chrisl108 :sparkles: :thumbsup: :sparkles:
:cookie: 236 | @chrisl108 |http://www.freecodecamp.com/chrisl108
Chris Lacaille
@ChrisL108
May 25 2016 01:12
@hubhubace sure thing
Jaren Escueta
@jarenescueta731
May 25 2016 01:12
@sjames1958gm shouldn't you always declare your variables?
Stephen James
@sjames1958gm
May 25 2016 01:12
@ChrisL108 You could use map and create a new array of the new objects
Stephen James
@sjames1958gm
May 25 2016 01:13
@jarenescueta731 That is what I said. It isn't strictly necessary but good practice.
thompsonsaraht
@thompsonsaraht
May 25 2016 01:13
Okay, I could use everyone's help again. I'm on the 'Return Early Patterns' exercise. I'm supposed to change the code so it returns undefined if a or b are less than 0. Can anyone give me a hint?
Mithun reddy
@mithunreddyt
May 25 2016 01:13
I am not getting what's wrong with my code
Stephen James
@sjames1958gm
May 25 2016 01:14
@mithunreddyt You are supposed to use this string I am a "double quoted" string inside "double quotes" get rid of all the extra stuff you added.
Nick Ang
@nickangtc
May 25 2016 01:14
I need help with the challenge "Testing Objects for Properties" - how do I write a function that tests whether an Object has various properties? To make it systematic, I'm guessing I shouldn't have to write each property name myself and run it through .hasOwnProperty("name"); - right?
Stephen James
@sjames1958gm
May 25 2016 01:14
@nickangtc I assume the function is passing the property in a variable that you could use?
Chris Lacaille
@ChrisL108
May 25 2016 01:15
@sjames1958gm I didn't think about making a new array of objects.. Thanks!
CamperBot
@camperbot
May 25 2016 01:15
chrisl108 sends brownie points to @sjames1958gm :sparkles: :thumbsup: :sparkles:
:star2: 1238 | @sjames1958gm |http://www.freecodecamp.com/sjames1958gm
Jaren Escueta
@jarenescueta731
May 25 2016 01:15
@darkpasanger not using var will make i a global variable, so yes, it's not necessary declaring would save headaches in more complex programs later on
Mithun reddy
@mithunreddyt
May 25 2016 01:15
I din't got it@sjames1958gm
Stephen James
@sjames1958gm
May 25 2016 01:16
@mithunreddyt delete all the extra spaces, ( ) etc. that you added.
Nick Ang
@nickangtc
May 25 2016 01:16
@sjames1958gm but in the question, the property that they seem to want to be verified is "checkProp"? Or am I reading the question wrong... I've tried reinterpreting it a few times now but can't come to any other udnerstanding of the question
Stephen James
@sjames1958gm
May 25 2016 01:17
@nickangtc The property is in the variable checkProp
@nickangtc No quotes
@nickangtc You are correct the idea of the function and the variable is to not have to write code for each individual property.
Nick Ang
@nickangtc
May 25 2016 01:18
Ok let me digest that for a moment
Stephen James
@sjames1958gm
May 25 2016 01:19
@nickangtc :+1:
@ChrisL108 I think you could even do [ new Streamer("one"), new Streamer("two") ]
Prashant Gupta
@darkpasanger
May 25 2016 01:21
@jarenescueta731 thanks for the such a nice advice
CamperBot
@camperbot
May 25 2016 01:21
darkpasanger sends brownie points to @jarenescueta731 :sparkles: :thumbsup: :sparkles:
:cookie: 270 | @jarenescueta731 |http://www.freecodecamp.com/jarenescueta731
Prashant Gupta
@darkpasanger
May 25 2016 01:21
function findLongestWord(str) {
 var a = str.split(""); 
 var len = 0;
  for(var i=0;i<a.length;i++)
    {
      if(len<a[i].length)
        len = a[i].length;
    }
  return len;
}

findLongestWord("The quick brown fox jumped over the lazy dog");
Stephen James
@sjames1958gm
May 25 2016 01:21
@darkpasanger solved it ?
Prashant Gupta
@darkpasanger
May 25 2016 01:22
@sjames1958gm it is returning 1 why?
Nick Ang
@nickangtc
May 25 2016 01:22
I still don't get it... the question asks "Modify the function checkObj to test myObj for checkProp." - shouldn't I be testing the variable myObj instead of checkProp?
Honestly I'm just confused as to why checkProp is even in there... but my brain tells me it's there to identify all the properties that are in myObj
Stephen James
@sjames1958gm
May 25 2016 01:23
@nickangtc You have to use both myObj and checkProp. checkProp will be set to whatever property the function is called on
@darkpasanger ?? don't know why
@darkpasanger Duh, check your split parameter
Mithun reddy
@mithunreddyt
May 25 2016 01:23
No I am not getting what I am doing wrong@sjames1958gm
Prashant Gupta
@darkpasanger
May 25 2016 01:24
@sjames1958gm ohh miss that one Thanks a lot for your help
CamperBot
@camperbot
May 25 2016 01:24
darkpasanger sends brownie points to @sjames1958gm :sparkles: :thumbsup: :sparkles:
:star2: 1239 | @sjames1958gm |http://www.freecodecamp.com/sjames1958gm
Stephen James
@sjames1958gm
May 25 2016 01:25
@mithunreddyt var myStr = "( I am a \"double quoted\" string inside \"double quotes\" ). "; this is what I saw when you posted. the test results are misleading. You shouild only use this -> I am a "double quoted" string inside "double quotes"
@darkpasanger So the longest character was length one :)
whoops, hold up
Mithun reddy
@mithunreddyt
May 25 2016 01:27
The requirements You should use two double quotes (") and four escaped double quotes (\")
Variable myStr should equal to (I am a "double quoted" string inside "double quotes").@sjames1958gm
Hanifah Walidah
@hackyourcraft
May 25 2016 01:28
I am doing the "counting card exercise" and I have every sequence except 2,j,9,2,7. Did anyone else get stuck with this one. If they worled for the rest, I'm confused why it would nt' work for this sequence?
JacksonJS
@JacksonJS
May 25 2016 01:29

for challenge https://www.freecodecamp.com/challenges/falsy-bouncer

if this works to filter out all falsey values:

function bouncer(arr) {
  // Don't show a false ID to this bouncer.
  return arr.filter(Boolean);
}

How can I use a comparable method to filter out all truthy values?

Stephen James
@sjames1958gm
May 25 2016 01:29
@mithunreddyt The () are not part of the answer, nor the extra spaces.
Hanifah Walidah
@hackyourcraft
May 25 2016 01:30
never mind, figured it out. I had count = 0 instead of count += 0
Stephen James
@sjames1958gm
May 25 2016 01:30
@souloperator :+1:
@JacksonJS Probably have to write a function.
thompsonsaraht
@thompsonsaraht
May 25 2016 01:32

Seems like whenever I ask for help, I find I'm making these harder than they need to be, so I'm just going to ask for a hint this time. I'm on Return Early Pattern. I'm supposed to:

Modify the function abTest so that if a or b are less than 0 the function will immediately exit with a value of undefined.

Stephen James
@sjames1958gm
May 25 2016 01:33
@thompsonsaraht if a or b are less than 0 this tells me that I need an if statement that tests a < 0 or b < 0
Mithun reddy
@mithunreddyt
May 25 2016 01:33
While I am compiling its not taking it's showing somemistake@sjames1958gm
Stephen James
@sjames1958gm
May 25 2016 01:34
@mithunreddyt var myStr = "I am a \"double quoted\" string inside \"double quotes\""; this is the answer.
Mithun reddy
@mithunreddyt
May 25 2016 01:37
Thanks I got to learn my mistake@sjames1958gm
thompsonsaraht
@thompsonsaraht
May 25 2016 01:37
@sjames1958gm , thank you! I was trying to make it harder than it needed to be :)
CamperBot
@camperbot
May 25 2016 01:37
thompsonsaraht sends brownie points to @sjames1958gm :sparkles: :thumbsup: :sparkles:
:star2: 1240 | @sjames1958gm |http://www.freecodecamp.com/sjames1958gm
Stephen James
@sjames1958gm
May 25 2016 01:38
@thompsonsaraht like you said :)
Tonye Iyalla
@tiyalla
May 25 2016 01:39
hey all. i've found that when i work on codepen on different computers, although i save it, most times my code doesn't update/sync. Does anyone else have these issues
Krishna
@krisskb
May 25 2016 01:42
Hello All, Could someone please help me what is wrong with this code. I am always getting json[1][1] instead of each element json[1][i].
for(var i=1;i<json[1].length;i++){
nchild="nth-child("+i+")";
$(".results").append($("#wikitem:first").clone());
element=json[1][i];
console.log(element);
$("div.results p:"+nchild).text(element);
};
Prashant Gupta
@darkpasanger
May 25 2016 01:46
it is giving error cannot read property 'toUpperCase' of undefined~~~

~~~
function titleCase(str) {
str.toLowerCase();
var a = str.split(" ");
for(var i=0;i<a.length;i++)
a[i].charAt.toUpperCase() + a[i].slice(1);

   str = a.join();

return str;
}

titleCase("I'm a little tea pot");

function titleCase(str) {
        str.toLowerCase();
        var a = str.split(" ");
        for(var i=0;i<a.length;i++)
          a[i].charAt.toUpperCase() + a[i].slice(1);

       str = a.join();
  return str;
}

titleCase("I'm a little tea pot");
it is giving error toUpperCase of undefined
Moisés Man
@moigithub
May 25 2016 01:48
@darkpasanger check correct syntax for chatAt
also u need to check syntax for join method
and toLowerCase
lcassettai
@lcassettai
May 25 2016 01:49
@darkpasanger the ' is breaking the string
Nick Ang
@nickangtc
May 25 2016 01:49
@sjames1958gm I just did some research, found the solution. Staring at it now and I'm wondering 2 things I was hoping you could help me with answering.
(1) is checkProp a special variable that is recognised in JS, or is it a variable that's already coded by freecodecamp in the backend (and not shown) to us?
(2) how come ' return myObj.checkProp ' doesn't work when ' return myObj[checkProp] ' ?
Kyle W Pilkinton
@tadake
May 25 2016 01:50
can anyone help me out with my javascript? its not letting me add "not online" to the offline profiles on twitch.
var link;
  var description;
  var stream;
  var name;
  var logo;
  var val;
  var i;

  listing.forEach(function(val, i) {

    name = val;
    $("#" + i + "name").html(val);
    $("#" + i).addClass("on");
    //console.log(val);

    $.getJSON('https://api.twitch.tv/kraken/streams/' + val + '?callback=?', function(data) {
      stream = data.stream;
      link = data._links.self;
      logo = data.stream.channel.logo;

      if (data.stream !== null) {
        description = data.stream.game;
        $("#" + i).addClass("off");
        $("#" + i + "description").html(description);
      }
      if(data.stream === null){

        $("#" + i + "description").html("description");
      }



      console.log(logo);

      $("#" + i + "logo").html();
      $("#" + i + "description").html(description);

    });
  });
});
Prashant Gupta
@darkpasanger
May 25 2016 01:51
@lcassettai i corrected the syntax of charAt to charAt~~~

~~~

function titleCase(str) {
str.toLowerCase();
var a = str.split(" ");
for(var i=0;i<a.length;i++)
a[i].charAt[0].toUpperCase() + a[i].slice(1);

   str = a.join();

return str;
}

titleCase("I'm a little tea pot");

Wendy Medeiros
@wendyr21
May 25 2016 01:52
i was just going to ask about the same thing! lol

```function titleCase(str) {

str = str.toLowerCase().split(" ");

for (var n = 0; n<str.length ; n++){
str[n] = str[n].charAt(0).toUpperCase() + str[n].slice(1);
}

return str.join(" ");
}```

is there a better way of doing that
Prashant Gupta
@darkpasanger
May 25 2016 01:52
again the same error.
Moisés Man
@moigithub
May 25 2016 01:53
@darkpasanger charAt still wrong..should use () not []
toLowerCase() returns a new string.. not mutate the original.. so u need to reassing
@darkpasanger a[i].charAt(0).toUpperCase() + a[i].slice(1) <-- u building a string.. but u not doing anything with it.. probably should reasign to a[i]= ...
nelsewehy
@nelsewehy
May 25 2016 01:55
can i get some quick help
i am trying to figure out what i am missing here
Moisés Man
@moigithub
May 25 2016 01:55
@darkpasanger join need a parameter.. "a glue" how u wanna join ur string.. if not specify any.. be default uses comma ,
Krishna
@krisskb
May 25 2016 01:55
Hello All, Could someone please help me what is wrong with this code. I am always getting json[1][1] instead of each element json[1][i].
for(var i=1;i<json[1].length;i++){
nchild="nth-child("+i+")";
$(".results").append($("#wikitem:first").clone());
element=json[1][i];
console.log(element);
$("div.results p:"+nchild).text(element);
};
nelsewehy
@nelsewehy
May 25 2016 01:55

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

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

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

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

Prashant Gupta
@darkpasanger
May 25 2016 01:55
@moigithub got it thanks for the help
CamperBot
@camperbot
May 25 2016 01:55
darkpasanger sends brownie points to @moigithub :sparkles: :thumbsup: :sparkles:
:star2: 1243 | @moigithub |http://www.freecodecamp.com/moigithub
Wendy Medeiros
@wendyr21
May 25 2016 01:55
@darkpasanger my code seems to wrok. i think it looks badthough
Moisés Man
@moigithub
May 25 2016 01:56
@wendyr21 urs looks good.. try refresh browser ?? or reset code do again?
Wendy Medeiros
@wendyr21
May 25 2016 01:56
the code it self works. i just dont know if i did it the right way or the "Wendy" way lol
Prashant Gupta
@darkpasanger
May 25 2016 01:57
@wendyr21 ya I also got it work,but looking for a better way
Wendy Medeiros
@wendyr21
May 25 2016 01:57
i tend to have code thats not sufficiant
Moisés Man
@moigithub
May 25 2016 01:59
many ways to do , u could replace ur for/loop with map
or probably use reduce..
or do with replace + regex
@wendyr21
Iago Breno
@ibacaraujo
May 25 2016 02:01
@nelsewehy Look your if condition, the variable val should not be between 10 and 20
Wendy Medeiros
@wendyr21
May 25 2016 02:01
@moigithub thanks :) i have such a confusion with regex. i like the map function will need to read up on it more
CamperBot
@camperbot
May 25 2016 02:01
wendyr21 sends brownie points to @moigithub :sparkles: :thumbsup: :sparkles:
:star2: 1244 | @moigithub |http://www.freecodecamp.com/moigithub
liz
@lookingforbacon
May 25 2016 02:01

Hey guys, I'm working on the Increment a Number with JavaScript excercise, says to change the code to use the ++ operator on myVar.
var myVar = 87;

myVar = myVar;

I changed it to myVar = ++myVar; and it came up that it = 88 which it should, but it is saying myVar = myVar should be changed and that isn't done, what am I doing wrong?

Rather it was

var myVar = 87;
myVar = myVar + 1;

to begin with

Mahmoud Abdulazim
@aze3ma
May 25 2016 02:03
Hey there!
Moisés Man
@moigithub
May 25 2016 02:03
i++
i=i+1
i+=1
all those examples increases i by 1
@lookingforbacon
if i recall the exercise is telling u to use one of those (var++ )
Mahmoud Abdulazim
@aze3ma
May 25 2016 02:04
may I have help with make object properties private ex
Santosh Kumar Toleti
@Santosh456
May 25 2016 02:04
anybody help me to solve these problem

this is my code function orderMyLogic(val) {
if (val < 10) {
return "Less than 10";
} else if (val < 5) {
return "Less than 5";
} else {
return "Greater than or equal to 10";
}
}

// Change this value to test
orderMyLogic(7);

liz
@lookingforbacon
May 25 2016 02:05
Thanks @moigithub, but I guess I'm confused as to how to change the code to increase myVar = myVar + 1; using ++
CamperBot
@camperbot
May 25 2016 02:05
lookingforbacon sends brownie points to @moigithub :sparkles: :thumbsup: :sparkles:
:star2: 1245 | @moigithub |http://www.freecodecamp.com/moigithub
Santosh Kumar Toleti
@Santosh456
May 25 2016 02:05
this is my error orderMyLogic(4) should return "Less than 5"
Mahmoud Abdulazim
@aze3ma
May 25 2016 02:05
'''
CamperBot
@camperbot
May 25 2016 02:05
:bulb: to format code use backticks! ``` more info
Moisés Man
@moigithub
May 25 2016 02:06
@lookingforbacon keep the variable name.. remove all rest.. append ++ at the end :point_up: May 24, 2016 9:03 PM
Iago Breno
@ibacaraujo
May 25 2016 02:06
@Santosh456 Your first condition test if the val is less than 5?
Mahmoud Abdulazim
@aze3ma
May 25 2016 02:07
var Bike = function() {

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

  this.setGear = function() {

  };

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

};
Santosh Kumar Toleti
@Santosh456
May 25 2016 02:07
@ibacaraujo ok
Anusha
@anushavicky
May 25 2016 02:07
@Santosh456
function orderMyLogic(val) {
if (val < 5) {
return "Less than 5";
} else if (val < 10) {
return "Less than 10";
} else {
return "Greater than or equal to 10";
}
}
liz
@lookingforbacon
May 25 2016 02:07
@moigithub I tried that but still got an error, like this? myVar = ++myVar;
or even myVar = myVar++;
Moisés Man
@moigithub
May 25 2016 02:08
@lookingforbacon theVariable++ <-- just this.. nothing else
liz
@lookingforbacon
May 25 2016 02:08
yeah I had tried that unless I did it wrong from what I entered above
Iago Breno
@ibacaraujo
May 25 2016 02:08
@lookingforbacon did you try without the assignment?
Santosh Kumar Toleti
@Santosh456
May 25 2016 02:09
@anushavicky its coming error
Lisa
@aGirlWhoCodes
May 25 2016 02:09
Quick question: How do I declare a function in javascript to say it's coming up later?
function theFunction();
is that right?
liz
@lookingforbacon
May 25 2016 02:09
@ibacaraujo how so?
Norvin Burrus
@ndburrus
May 25 2016 02:09
@aGirlWhoCodes yes..
Laura Henderson
@HendersonCoder
May 25 2016 02:09
I'm on "profile lookup" and only getting 2/5 correct. Not sure why its not returning the arrays of info. Here is my code:
Moisés Man
@moigithub
May 25 2016 02:09
just myVar++ thats all..
no myVar=something <-- the exercise is not asking this
@lookingforbacon
liz
@lookingforbacon
May 25 2016 02:09
In an IDE of some sort?
Laura Henderson
@HendersonCoder
May 25 2016 02:10
function lookUpProfile(firstName, prop){
// Only change code below this line
for (var i = 0; i < contacts.length; i++) {
if (contacts[i].firstName === firstName && contacts[i].hasOwnProperty(prop)) {
return contacts[i][prop];
}
else if (contacts[i].firstName !== firstName)
{return "No such contact";
}
else return "No such property";
}
// Only change code above this line
}
Any ideas?
Iago Breno
@ibacaraujo
May 25 2016 02:11
@lookingforbacon removing the 'myVar =' part, just the variable followed by the increment operator
Lisa
@aGirlWhoCodes
May 25 2016 02:11
@ndburrus its giving me a red ! in codepen.. saying i should remove the ; but that's not working too..
liz
@lookingforbacon
May 25 2016 02:11
Ahh thanks @moigithub! I did not catch onto that for some reason.
CamperBot
@camperbot
May 25 2016 02:11
lookingforbacon sends brownie points to @moigithub :sparkles: :thumbsup: :sparkles:
:warning: lookingforbacon already gave moigithub points
Norvin Burrus
@ndburrus
May 25 2016 02:11
@aGirlWhoCodes this may be helpful: w3chools.com, Javascript Functions, Example {ref: http://www.w3schools.com/js/js_functions.asp }
Example
function myFunction(p1, p2) {
    return p1 * p2;              // The function returns the product of p1 and p2
}
Moisés Man
@moigithub
May 25 2016 02:12
@HendersonCoder u returning "no contact" too soon
first u need to check ALL contacts
Norvin Burrus
@ndburrus
May 25 2016 02:12
@aGirlWhoCodes What is the complete code?
Lisa
@aGirlWhoCodes
May 25 2016 02:13
i looked at the w3schools site but I can't find the information i want.. How can i declare the function before i actually working it out..
Moisés Man
@moigithub
May 25 2016 02:13
@aGirlWhoCodes u can use 2 ways to create function..
var myFunction = function( parameters){ .... }
function myFunction(){ .... }
Laura Henderson
@HendersonCoder
May 25 2016 02:13
thanks! so I need to switch the 2nd and 3rd return statements?
Chris Lacaille
@ChrisL108
May 25 2016 02:14
How would I access createUser() from within a getJSON() inside getUser()
Streamer.prototype.createUser = function() {...}

Streamer.prototype.getUser = function() {
     $.getJSON(makeURL, function(data)) {
            //this.createUser(data)  <--- doesn't work here?
     }
}
Norvin Burrus
@ndburrus
May 25 2016 02:14
@aGirlWhoCodes this?
The function declaration (function statement)
There is a special syntax for declaring functions (see function statement for details):

function name([param[, param[, ... param]]]) {
   statements
}
name
The function name.
param
The name of an argument to be passed to the function. A function can have up to 255 arguments.
statements
The statements comprising the body of the function.
jasmyn
@jasmynriadavis237
May 25 2016 02:14
I am needing help with the counting cards assignment.
I have the first 3 checks marked
Anusha
@anushavicky
May 25 2016 02:14
@Santosh456 put the (val < 5 ) as ur first condition .
jasmyn
@jasmynriadavis237
May 25 2016 02:14
however I dont know how to end my return
Santosh Kumar Toleti
@Santosh456
May 25 2016 02:15

see my code function orderMyLogic(val) {
if (val < 5) {
return "Less than 10";
} else if (val < 10) {
return "Less than 5";
} else {
return "Greater than or equal to 10";
}
}

// Change this value to test
orderMyLogic(7);

@jasmynriadavis237 can u show your code once
Norvin Burrus
@ndburrus
May 25 2016 02:15
@Santosh456 which challenge?
Iago Breno
@ibacaraujo
May 25 2016 02:15
@Santosh456 just change the message
in the if val < 5, your return is "Less than 10"
Anusha
@anushavicky
May 25 2016 02:15
@Santosh456 function orderMyLogic(val) {
if (val < 5) {
return "Less than 5";
} else if (val < 10) {
return "Less than 10";
} else {
return "Greater than or equal to 10";
}
}
Norvin Burrus
@ndburrus
May 25 2016 02:16
@Santosh456 review/check the logic... :) ok, that's better... should be fine... check punctuation..
jasmyn
@jasmynriadavis237
May 25 2016 02:16

var aGlobalvar;
if (3,4,4,5,6) {
aGlobalvar ++;
}

return "aGlobalVar + ";

@Santosh456
I only know how to copy and paste it
Lisa
@aGirlWhoCodes
May 25 2016 02:17
@ndburrus @moigithub Ok so i can just leave the {} part empty when i am declaring the function only?
Norvin Burrus
@ndburrus
May 25 2016 02:17
help format @jasmynriadavis237
CamperBot
@camperbot
May 25 2016 02:17

:point_right: code formatting [wiki]

Multi line Code

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

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

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

Single line Code

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

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

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

Santosh Kumar Toleti
@Santosh456
May 25 2016 02:17
@jasmynriadavis237 can u send me the link
Moisés Man
@moigithub
May 25 2016 02:17
@aGirlWhoCodes no :).. thats an example.. ur function probably should DO something.. so u need to include whatever code it needs
Jake
@Jaketh
May 25 2016 02:18
This message was deleted
Stephen James
@sjames1958gm
May 25 2016 02:18
@nickangtc Sorry, went off line for a bit. In case you didn't get answers. function checkObj(checkProp) defines the variable checkProp in the function as the function parameter. When you use this syntax return myObj.checkProp js is selecting a property specifically called checkProp to tell it to look in the variable use []
Jake
@Jaketh
May 25 2016 02:18
This message was deleted
Lisa
@aGirlWhoCodes
May 25 2016 02:18
@moigithub Ok so it's not possible to just declare a function.. You always should put the function in front of the code where you use it in js?
Jake
@Jaketh
May 25 2016 02:19
wrong forum. ignore me.
Lisa
@aGirlWhoCodes
May 25 2016 02:19
I know like in C you can declare it before you actually write it out..
Norvin Burrus
@ndburrus
May 25 2016 02:19
@aGirlWhoCodes the following statement shows no errors...
function nameFunction() {

}
jasmyn
@jasmynriadavis237
May 25 2016 02:19
@Santosh456
Stephen James
@sjames1958gm
May 25 2016 02:20
@jasmynriadavis237 reread the instructions, you are supposed to increment count based on card value and then test count vs. 0 to see what to return
Moisés Man
@moigithub
May 25 2016 02:20
@aGirlWhoCodes ur function should exist on ur code.. before calling it.. dont matter if on top or at the end (if thats what u mean )
jasmyn
@jasmynriadavis237
May 25 2016 02:20
@sjames1958gm what?
Lisa
@aGirlWhoCodes
May 25 2016 02:21
@ndburrus @moigithub Thank you !
CamperBot
@camperbot
May 25 2016 02:21
agirlwhocodes sends brownie points to @ndburrus and @moigithub :sparkles: :thumbsup: :sparkles:
:cookie: 421 | @ndburrus |http://www.freecodecamp.com/ndburrus
:star2: 1246 | @moigithub |http://www.freecodecamp.com/moigithub
Norvin Burrus
@ndburrus
May 25 2016 02:21
@aGirlWhoCodes you're welcome! :+1:
Stephen James
@sjames1958gm
May 25 2016 02:22
@ChrisL108 Did you get an answer?
Norvin Burrus
@ndburrus
May 25 2016 02:23
@jasmynriadavis237 why not use ranges for the card values? wouldn't that be easier/simpler? hint: try using the Count Change/Cards chart to model the conditions & actions.... :)
Stephen James
@sjames1958gm
May 25 2016 02:23
Streamer.prototype.createUser = function() {...}

Streamer.prototype.getUser = function() {
     var that = this;
     $.getJSON(makeURL, function(data)) {
            that.createUser(data)  <--- doesn't work here?
     }
}
Chris Lacaille
@ChrisL108
May 25 2016 02:24
@sjames1958gm No but I got it working by calling Streamer.prototype.createUser(args)
jasmyn
@jasmynriadavis237
May 25 2016 02:24
@ndburrus how do we test it against 0
you*
Stephen James
@sjames1958gm
May 25 2016 02:24
@ChrisL108 Ah, since you are creating a new user, don't really need this.
Moisés Man
@moigithub
May 25 2016 02:24
probably should be var that = this; instead
Nick Ang
@nickangtc
May 25 2016 02:25
@sjames1958gm got it - thanks a lot for your help!
CamperBot
@camperbot
May 25 2016 02:25
nickangtc sends brownie points to @sjames1958gm :sparkles: :thumbsup: :sparkles:
:star2: 1241 | @sjames1958gm |http://www.freecodecamp.com/sjames1958gm
Chris Lacaille
@ChrisL108
May 25 2016 02:25
@sjames1958gm I figured there was a easier way lol
Stephen James
@sjames1958gm
May 25 2016 02:25
@moigithub Details details :)
Norvin Burrus
@ndburrus
May 25 2016 02:25
@jasmynriadavis237 well, if we are using a running card count var/iable there is actually no change in its' value for those cards. note: the card values drive the running card count value...
Stephen James
@sjames1958gm
May 25 2016 02:25
@nickangtc :+1:
Chris Lacaille
@ChrisL108
May 25 2016 02:26
@sjames1958gm It's my twitch.tv app I've already completed, I'm just going back and redoing it using prototypal inheritance to practice
Laura Henderson
@HendersonCoder
May 25 2016 02:26
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 contact";
}
return "No such property";
}
}
when I updated the other 3 are now correct but the original one is wrong...not sure if I just need to switch my brackets? depending on where the brackets are different goals are right but never all 5.
Norvin Burrus
@ndburrus
May 25 2016 02:28
@HendersonCoder what happens with the result value?
Laura Henderson
@HendersonCoder
May 25 2016 02:28
also how do I send brownie points? are those helpful for the people that are bearing with all of us newbies and helping us out?
It changes from an array to saying "no such contact"
Norvin Burrus
@ndburrus
May 25 2016 02:29
help brownie points @HendersonCoder
CamperBot
@camperbot
May 25 2016 02:29

:point_right: brownie points [wiki]

Brownie Points

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

A user profile picture next to a with Brownie Points score

There are two ways you can get Brownie Points:

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

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

They also add to your Streak.

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

jasmyn
@jasmynriadavis237
May 25 2016 02:29
Can you show me an example of what you are trying to explain because I am highly confused
@ndburrus
Laura Henderson
@HendersonCoder
May 25 2016 02:30
if I move the brackets above the return "no such property" it moves the answer to "no such property. so confusing!
Stephen James
@sjames1958gm
May 25 2016 02:30
@ChrisL108 Sounds good, I reworked my tic tac toe with classes as well.
Laura Henderson
@HendersonCoder
May 25 2016 02:30
and thanks @ndburrus
CamperBot
@camperbot
May 25 2016 02:31
hendersoncoder sends brownie points to @ndburrus :sparkles: :thumbsup: :sparkles:
:cookie: 422 | @ndburrus |http://www.freecodecamp.com/ndburrus
Norvin Burrus
@ndburrus
May 25 2016 02:31
@HendersonCoder does it work?
Stephen James
@sjames1958gm
May 25 2016 02:31
@HendersonCoder Your else for hasOwnProperty should be the one that returns "no such property"
Laura Henderson
@HendersonCoder
May 25 2016 02:32
whoops! i did the brownie points wrong. I will get this lol. thanks @moihithub
CamperBot
@camperbot
May 25 2016 02:32
hendersoncoder sends brownie points to @moihithub :sparkles: :thumbsup: :sparkles:
:warning: could not find receiver for moihithub
Miguel Asse
@cubang8r
May 25 2016 02:32
Hey everyone
stuck on the getIndexToIns problem
Norvin Burrus
@ndburrus
May 25 2016 02:32
@jasmynriadavis237 moment...
Laura Henderson
@HendersonCoder
May 25 2016 02:32
i mean lol thanks @moigithub
CamperBot
@camperbot
May 25 2016 02:32
hendersoncoder sends brownie points to @moigithub :sparkles: :thumbsup: :sparkles:
:star2: 1247 | @moigithub |http://www.freecodecamp.com/moigithub
Miguel Asse
@cubang8r
May 25 2016 02:32
ultimately having trouble understanding IndexOf function

function getIndexToIns(arr, num) {
  // Find my place in this sorted array.
  var sortedArray = arr.sort(function(a,b){
    return a - b;
  });

  for(i = 0; i < arr.length; i++){
    if(num < sortedArray[i]){
      return sortedArray[i - 1].indexOf(num);
    }
  }
}

getIndexToIns([10, 20, 30, 40, 50], 35);
Stephen James
@sjames1958gm
May 25 2016 02:32
@HendersonCoder Imagine that you were going through a stack of business cards (that is what this is essentially). When would you decide to declare no such contact?
Miguel Asse
@cubang8r
May 25 2016 02:33
getting a "sortedArray[i].indexOf is not a function
Stephen James
@sjames1958gm
May 25 2016 02:33
@cubang8r sortedArray[i] is simply a number and not an array
Norvin Burrus
@ndburrus
May 25 2016 02:34
@jasmynriadavis237 would you consider using a switch statement? you could map the card values (case/s) to "categories," and adjust the count value accordingly... :) the code would look cleaner/neater/more organized...
Stephen James
@sjames1958gm
May 25 2016 02:34
@cubang8r I have a feeling i - 1 is the index that you need to return.
Andrew Schmidthuber
@calicode
May 25 2016 02:34
unless i'm missing something indexOf(35) is going to return -1 on that array
Miguel Asse
@cubang8r
May 25 2016 02:35
@sjames1958gm let me try declaring sortedArray as an array, one second
Laura Henderson
@HendersonCoder
May 25 2016 02:35
ok here it is now, i'm still only getting 4/5 correct. I've also tried changing the last return to an else and it doesn't like that.

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";

}
}

Stephen James
@sjames1958gm
May 25 2016 02:36
@HendersonCoder You are returning no such contact on the first firstname mismatch, does that sound right?
Miguel Asse
@cubang8r
May 25 2016 02:36
@sjames1958gm no luck. it's definitely the correct index, I tried reutrning just the number
Santosh Kumar Toleti
@Santosh456
May 25 2016 02:37
anyone can help me to solve these problem

function golfScore(par, strokes) {
// Only change code below this line

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

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

Stephen James
@sjames1958gm
May 25 2016 02:37
@cubang8r Isn't the number what you are looking for? i - 1 is an index into the array
Laura Henderson
@HendersonCoder
May 25 2016 02:37

["Pizza","Coding","Brownie Points"]

"Kristian", "lastName" should return "Vos"
"Sherlock", "likes" should return ["Intriguing Cases", "Violin"]
"Harry","likes" should return an array
"Bob", "number" should return "No such contact"
"Akira", "address" should return "No such property"

Miguel Asse
@cubang8r
May 25 2016 02:37
@sjames1958gm nope the problem askes us to return the index of the number
Laura Henderson
@HendersonCoder
May 25 2016 02:37
I'm missing number 4 for the contact one.
Miguel Asse
@cubang8r
May 25 2016 02:37
where the "num" argument would be inserted
Stephen James
@sjames1958gm
May 25 2016 02:38
@cubang8r and the value i is an index into the array so i -1 is the index that you are looking for>
Miguel Asse
@cubang8r
May 25 2016 02:38
so for example, [10, 20, 30], with a num of 25, should return "1" because it fits inbetween 1st and 2nd index
Stephen James
@sjames1958gm
May 25 2016 02:38
So when you get to 30 i is 2 and you return i - 1 which is 1
Laura Henderson
@HendersonCoder
May 25 2016 02:38
so yes thanks @sjames1958gm
CamperBot
@camperbot
May 25 2016 02:38
hendersoncoder sends brownie points to @sjames1958gm :sparkles: :thumbsup: :sparkles:
:star2: 1242 | @sjames1958gm |http://www.freecodecamp.com/sjames1958gm
Santosh Kumar Toleti
@Santosh456
May 25 2016 02:38

@Santosh456
anyone can help me to solve these problem
function golfScore(par, strokes) {
// Only change code below this line

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

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

Miguel Asse
@cubang8r
May 25 2016 02:39
right @sjames1958gm but I can't get my function to return "2" versus "30" which is where i run itno a wall
and i think I need to use the "indexOf" function to to get the position, but I'm not utilizing it right
Stephen James
@sjames1958gm
May 25 2016 02:40
@cubang8r return i - 1; ?
Laura Henderson
@HendersonCoder
May 25 2016 02:40
whoa, just put the last return at the end and it worked. hallelujah.
Stephen James
@sjames1958gm
May 25 2016 02:40
@HendersonCoder :+1: !
Laura Henderson
@HendersonCoder
May 25 2016 02:40
it told me i'm the king of the world. it must be true
Stephen James
@sjames1958gm
May 25 2016 02:41
@HendersonCoder if the first name matched then both paths returned. So the only way to get to the end of the for loop is to have never matched a first name
Santosh Kumar Toleti
@Santosh456
May 25 2016 02:41

@HendersonCoder @Santosh456
anyone can help me to solve these problem
function golfScore(par, strokes) {
// Only change code below this line

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

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

Norvin Burrus
@ndburrus
May 25 2016 02:41
@Santosh456 ok, you may want to setup a conditional (statement/s) to model the Strokes/Return table ... the return values will be those in the Return column...
Laura Henderson
@HendersonCoder
May 25 2016 02:42
ok great thanks so much all this computer logic is making my brain hurt. in a good way though. I think.
Stephen James
@sjames1958gm
May 25 2016 02:42
@HendersonCoder Sexist - you are the Queen of the World :)
Miguel Asse
@cubang8r
May 25 2016 02:42
@sjames1958gm sometimes it's the little things :-). Thank you! Need to fix a bit of my logic but that worked!
CamperBot
@camperbot
May 25 2016 02:42
cubang8r sends brownie points to @sjames1958gm :sparkles: :thumbsup: :sparkles:
:star2: 1243 | @sjames1958gm |http://www.freecodecamp.com/sjames1958gm
Laura Henderson
@HendersonCoder
May 25 2016 02:42
haha yes, i mean king in the gender neutral sense :)
Stephen James
@sjames1958gm
May 25 2016 02:43
@cubang8r Got to be careful to not overthink and over code :)
Norvin Burrus
@ndburrus
May 25 2016 02:43
@Santosh456 have you decided on a conditional statement to use?
Santosh Kumar Toleti
@Santosh456
May 25 2016 02:43
@ndburrus no
Norvin Burrus
@ndburrus
May 25 2016 02:44
@Santosh456 let's do that... what types of conditional statements/functions are there?
Santosh Kumar Toleti
@Santosh456
May 25 2016 02:45
@ndburrus If else
Norvin Burrus
@ndburrus
May 25 2016 02:46
@Santosh456 WebCheatSheet.com, JavaScript: Conditional Statements, {ref: http://webcheatsheet.com/javascript/if_else_switch.php } right... so, can we model the chart. now? the function input values are shown as par & strokes
ALMY91
@ALMY91
May 25 2016 02:47
hi guys
do i have to write the factorial code myself?
try {
var n = Number(prompt("Please enter a positive integer","")); //Ask the user to enter a number
var f = factorial(n)
//Compute the factorial of the number, assuming the input is valid
alert(n+"!="+f); // Display the results

}

catch (ex) {alert(ex);

}
Norvin Burrus
@ndburrus
May 25 2016 02:49
@ALMY91 hi, is this "Factorialize a Number"?
Tonye Iyalla
@tiyalla
May 25 2016 02:52
can anyone please help me. i'm having trouble finding pens on codepen that i worked on and saved earlier. Anyone have similar problems?
Miguel Asse
@cubang8r
May 25 2016 02:52
@sjames1958gm last question
Stephen James
@sjames1958gm
May 25 2016 02:53
@cubang8r shoot
Miguel Asse
@cubang8r
May 25 2016 02:53
can't get the last bit if the answer is NULL or undefined (if the number is greater than anything in the arry
Coy Sanders
@coymeetsworld
May 25 2016 02:53
@tiyalla if you're logged in you should be able to see them under codepen.io/username/pens/public
Stephen James
@sjames1958gm
May 25 2016 02:53
@cubang8r So you fall out of the for loop without returning something?
Joseph
@revisualize
May 25 2016 02:53
// Write a function nextInLine which takes 
// an array (arr) and a number (item) as arguments.
function nextInLine(arr, item) {
    // Add the number to the end of the array,

    // then remove the first element of array.
    // The nextInLine function should 
    // then return the element that was removed.
    return item; // Change this line
}

// Write a function which takes:
//  an id, a property (prop), and a value.
function updateRecords(id, prop, value) {
// If value is non-blank (value !== "") 
// and prop is not "tracks" 
// then update or set the value for the prop.
    // Your code here

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

// If value is blank, 
// delete that prop.
    // Your code here

// Always return the entire collection object.
  return collection;
}
Miguel Asse
@cubang8r
May 25 2016 02:53

function getIndexToIns(arr, num) {
  // Find my place in this sorted array.
  var sortedArray = arr.sort(function(a,b){
    return a - b;
  });

  for(var i = 0; i < arr.length; i++){
    if(num <= sortedArray[i]){
      return i;
    }
  }
}

getIndexToIns([2, 5, 10], 15);
@sjames1958gm yes
so I was thinking the logic could be if num >= last number in the index
return i+1 of the last index
Stephen James
@sjames1958gm
May 25 2016 02:54
@cubang8r You probably need a return after the for loop returning the correct value
Tonye Iyalla
@tiyalla
May 25 2016 02:55
they're there but not updated and i saved them whilst working on a different computer. I don't know why the new changes aren't showing on here.
Stephen James
@sjames1958gm
May 25 2016 02:55
@cubang8r i + 1 of the last index is also arr.length
Miguel Asse
@cubang8r
May 25 2016 02:55
ooooh, that'st true
Coy Sanders
@coymeetsworld
May 25 2016 02:55
were you logged in on your other computer?
Miguel Asse
@cubang8r
May 25 2016 02:55
okay
Tonye Iyalla
@tiyalla
May 25 2016 02:55
@coymeetsworld last message was a reply to you
Miguel Asse
@cubang8r
May 25 2016 02:55
let me play around with that, thanks @sjames1958gm !
CamperBot
@camperbot
May 25 2016 02:55
cubang8r sends brownie points to @sjames1958gm :sparkles: :thumbsup: :sparkles:
:warning: cubang8r already gave sjames1958gm points
Tonye Iyalla
@tiyalla
May 25 2016 02:56
@coymeetsworld yep i was. i deleted some pens whilst logged in on another computer and i can see the new pens i worked on but the ones i deleted still appear here
Coy Sanders
@coymeetsworld
May 25 2016 02:57
hmm i see 5 total that are public, nothing forked
looks like you have them all set for auto-save too
dumb idea but try refreshing your browser or logging out of codepen logging back in?
Tonye Iyalla
@tiyalla
May 25 2016 03:00
@coymeetsworld yeah i did that. nothing changed. I changed the font on my random quote pen and i can't see the changes when i log on with this computer. but i see the new weather app pen i created.
ALMY91
@ALMY91
May 25 2016 03:00
try {
var n = Number(prompt("Please enter a positive integer","")); //Ask the user to enter a number

var f = Function factorial(n)

{ 
if (n==0) return 1;
return n*factorial(n-1);}//Compute the factorial of the number, assuming the input is valid
alert(n+"!="+f); // Display the results

}

catch (ex) {
alert(ex);
}
unexpected identifier
anyone?
Coy Sanders
@coymeetsworld
May 25 2016 03:02
@tiyalla noticed for font family you have sans serif listed, but it should be sans-serif with a dash
Tonye Iyalla
@tiyalla
May 25 2016 03:02
@coymeetsworld yeah i changed that previously whilst working on a different computer.
Coy Sanders
@coymeetsworld
May 25 2016 03:04
I'm not sure what the problem is then @tiyalla, i've had no issues using codepen on different computers
not sure what the Delicious font is, don't see any import statements
Tonye Iyalla
@tiyalla
May 25 2016 03:07
@coymeetsworld okay thanks. i'll clear my cache and see if that works.
CamperBot
@camperbot
May 25 2016 03:07
tiyalla sends brownie points to @coymeetsworld :sparkles: :thumbsup: :sparkles:
:cookie: 946 | @coymeetsworld |http://www.freecodecamp.com/coymeetsworld
Stephen Mansfield
@StephenMansfield
May 25 2016 03:09
Hey guys, having trouble with the profile lookup, pretty sure something is wrong with my if state
jasmyn
@jasmynriadavis237
May 25 2016 03:11
you should use bracket notation to access testObj
how do i do this i have 3/4 right
but I have bracket notation
Stephen Mansfield
@StephenMansfield
May 25 2016 03:12
```
This message was deleted
Santosh Kumar Toleti
@Santosh456
May 25 2016 03:17
@ndburrus this is my code

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

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

I am getting the error
golfScore(4, 3) should return "Birdie"
Santosh Kumar Toleti
@Santosh456
May 25 2016 03:23

@Santosh456
@ndburrus this is my code

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

// Change these values to test
golfScore(5, 4);
I am getting the error
golfScore(4, 3) should return "Birdie"

Joseph
@revisualize
May 25 2016 03:23
@Santosh456 Did you change the code?
@Santosh456 Did you use the website that I just linked?
Santosh Kumar Toleti
@Santosh456
May 25 2016 03:26
I am seeing the link but i am not understanding anything
rphares
@rphares
May 25 2016 03:27
@revisualize , thats just a typo, you could do him a favour and point it out...
Joseph
@revisualize
May 25 2016 03:27
@Santosh456 You're also not following the instructions
Strokes   |   Return
-----------------------
1             "Hole-in-one!"
<= par - 2    "Eagle"
par - 1       "Birdie"
par           "Par"
par + 1       "Bogey"
par + 2       "Double Bogey"
>= par + 3    "Go Home!"
else if (strokes <= par - 1){ // Correct this line to follow the instructions
return "Eagle";
}
Santosh Kumar Toleti
@Santosh456
May 25 2016 03:31
ya i got it
Charissa Wilson
@gottalovelattes
May 25 2016 03:36
This message was deleted
blob
Not sure why I am getting the right output but it's not letting the code pass when I run it.
I need the help in this link
Jaren Escueta
@jarenescueta731
May 25 2016 03:42
hi guys, so i just completed the Seek and Destroy basic algorithm challenge. Even though my program passed, I had a warning that told me I shouldn't make functions within loops, leaving me with the feeling I should've solved it differently. I googled the issue and all i found was that it could make the program behave unexpectedly. Would anyone be able to shed more light on this?
Anusha
@anushavicky
May 25 2016 03:42
@gottalovelattes there are two "oopsGlobal" in ur code...
Jaren Escueta
@jarenescueta731
May 25 2016 03:44
@Santosh456 by the way you should be using switch case, and don't return the value after each "score"
Douglas Hoang
@DouglasHoang
May 25 2016 03:46
Hey guys! Im building a random quote app and I need help with trying to update the information every time I click the button. http://codepen.io/DouglasHoang/pen/XKrJKa
OneRandomJamie
@OneRandomJamie
May 25 2016 03:50
Why does the stand in line challenge say to write a function that is already there?
NEETWizardJanus
@NEETWizardJanus
May 25 2016 03:52
I've been spending an hour or two with a math logic problem that I can't get right. How do I figure it out? I'm trying to resize a canvas size with a fixed width-to-height ratio to be the maximum size within a browser window.
Samuel Cupidon
@Zerazera
May 25 2016 03:52
@NEETWizardJanus Minimum of screen width and screen height
NEETWizardJanus
@NEETWizardJanus
May 25 2016 03:53
@Zerazera that only gets you a square.
Santosh Kumar Toleti
@Santosh456
May 25 2016 03:53

@jarenescueta731 this is my code function caseInSwitch(val) {
var answer = " ";
// Only change code below this line
switch(answer) {

  case 1:
  console.log("alpha");
  break;

  case 2:
  console.log("beta");
  break;

  case 3:
  console.log("gamma");
  break;

  case 4:
  console.log("delta");
  break;

}

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

// Change this value to test
caseInSwitch(1);

Samuel Cupidon
@Zerazera
May 25 2016 03:54
@NEETWizardJanus OK, if you don't want a square, just get the minimum and use that to proportion the sides however you want
Jaren Escueta
@jarenescueta731
May 25 2016 03:54
@Santosh456 what's the problem?
NEETWizardJanus
@NEETWizardJanus
May 25 2016 03:55
@Zerazera it still messes up in the middle.
Santosh Kumar Toleti
@Santosh456
May 25 2016 03:55
can u tell me what should we give the value to answer
Samuel Cupidon
@Zerazera
May 25 2016 03:57
@NEETWizardJanus You mentioned a canvas. Does the issue maybe have to do with the line widths?
Jaren Escueta
@jarenescueta731
May 25 2016 03:58
@Santosh456 why are you printing the answers? since your program is returning the variable called answer, you should be assigning each case's string to answer
Mariusz Bachurski
@embahr
May 25 2016 03:58
find profile lookup
CamperBot
@camperbot
May 25 2016 03:59

find profile lookup

:zero: challenge profile lookup

Jaren Escueta
@jarenescueta731
May 25 2016 03:59
@Santosh456 all console.log() will do is print to the console, but not return the answer
@Santosh456 making sense?
NEETWizardJanus
@NEETWizardJanus
May 25 2016 04:01
@Zerazera no. it's a manually created canvas. It's really just a <div>
Samuel Cupidon
@Zerazera
May 25 2016 04:02
@NEETWizardJanus Hmm. Do you have a link to your pen?
NEETWizardJanus
@NEETWizardJanus
May 25 2016 04:03
@Zerazera surely the canvas width = window width has to change at a point different from when the window width is equal to the window height.
@Zerazera it's down in the JS for canvasresize
Samuel Cupidon
@Zerazera
May 25 2016 04:08
@NEETWizardJanus Ah. If you want it to change differently you just have to figure out what you want it to look like.
NEETWizardJanus
@NEETWizardJanus
May 25 2016 04:08
@Zerazera I know what I want it to look like. I just don't know how to tell the computer that.
I wanted an 8x9 canvas.
Jacob Bogers
@jacobbogers
May 25 2016 04:10
@dagman, nice animation,
odiscious
@odiscious
May 25 2016 04:11
Anybody solve Falsy Bouncer?
Jaren Escueta
@jarenescueta731
May 25 2016 04:12
@odiscious yup, what do you need help with
odiscious
@odiscious
May 25 2016 04:12
Hey Jaren
Islam Ibakaev
@dagman
May 25 2016 04:12
@jacobbogers thx not sure about skills part animation though
CamperBot
@camperbot
May 25 2016 04:12
dagman sends brownie points to @jacobbogers :sparkles: :thumbsup: :sparkles:
:cookie: 347 | @jacobbogers |http://www.freecodecamp.com/jacobbogers
odiscious
@odiscious
May 25 2016 04:12
Well, I don't have a specific question.... I've spent quite a bit of time on this one and I'm throwing in the white towel
My code should work but it's not passing the test cases for some reason
Jaren Escueta
@jarenescueta731
May 25 2016 04:13
@odiscious btw ctrl-click person's name to mention
NEETWizardJanus
@NEETWizardJanus
May 25 2016 04:13
hmm... ... maybe... window-width / unit-width compared to window-height / unit-height? so that if I dynamically changed my canvas for 9x6 or 8x8 it would work for both.
odiscious
@odiscious
May 25 2016 04:13
@jarenescueta731 cheers!
Jaren Escueta
@jarenescueta731
May 25 2016 04:14
@odiscious do you use any external editors to test? i use js bin
odiscious
@odiscious
May 25 2016 04:14
@jarenescueta731 I'm happy to share my code.. how do you take and paste it here?
Jaren Escueta
@jarenescueta731
May 25 2016 04:14
explain format
CamperBot
@camperbot
May 25 2016 04:14

:point_right: code formatting [wiki]

Multi line Code

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

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

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

Single line Code

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

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

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

odiscious
@odiscious
May 25 2016 04:14
@jarenescueta731 I used an online javascript tester
Jaren Escueta
@jarenescueta731
May 25 2016 04:15
@odiscious hope that helps ^^
NEETWizardJanus
@NEETWizardJanus
May 25 2016 04:15
uhg. but then I have to factor in the difference in hexagon height and width... which is why my confusion is multiplied, as I can't wrap my head around where that multiplier goes.
Jaren Escueta
@jarenescueta731
May 25 2016 04:15
@odiscious i wish i could help out more but i g2g. good luck!
odiscious
@odiscious
May 25 2016 04:15

'''var count = 0;

function side(val){
count++;
if(val === undefined){
console.log("undefined");
return false;
}
else if(val === false){
console.log("false");
return false;
}
else if(val === ""){
console.log(count + " empty char \" \"");
return false;
}'''

CamperBot
@camperbot
May 25 2016 04:15
:bulb: to format code use backticks! ``` more info
odiscious
@odiscious
May 25 2016 04:16

'''
var count = 0;

function side(val){
count++;
if(val === undefined){
console.log("undefined");
return false;
}
else if(val === false){
console.log("false");
return false;
}
else if(val === ""){
console.log(count + " empty char \" \"");
return false;
}

CamperBot
@camperbot
May 25 2016 04:16
:bulb: to format code use backticks! ``` more info
odiscious
@odiscious
May 25 2016 04:17
var count = 0;

function side(val){
    count++;
  if(val === undefined){
      console.log("undefined");
    return false;
  }
  else if(val === false){
      console.log("false");
    return false;
  }
  else if(val === ""){
      console.log(count + " empty char \" \"");
    return false;
  }
var count = 0;

function side(val){
    count++;
  if(val === undefined){
      console.log("undefined");
    return false;
  }
  else if(val === false){
      console.log("false");
    return false;
  }
  else if(val === ""){
      console.log(count + " empty char \" \"");
    return false;
  }
  else if(val === null){
      console.log(count + " null");
    return false;
  }
  else if(val === 0){
      console.log(count + " 0");
    return false;
  }
  else if(isNaN(val) && (val[0].toUpperCase() == val.toLowerCase())){
      console.log("val: " + val);
      console.log(count + " This is NaN");
    return false;
  }
  else
    return true;
}
function bouncer(arr) {
  console.log("initial size: " + arr.length);
  console.log("initial arr: " + arr);
  // Don't show a false ID to this bouncer.
 /*arr = arr.filter(NaN);
  arr = arr.filter(0);
  arr = arr.filter(undefined);
  arr = arr.filter(null);
  arr = arr.filter(false);
  console.log(arr);*/
  var arr2 = [];


    arr2.push(arr.filter(side));

  console.log("total count: " + count);
  console.log("ending array: " + arr);
  console.log("second array: " + arr2.toString());
  return arr2;
}
console.log("bouncer initial test");
bouncer([7, "ate", "", false, 9]);
console.log("abc test: ");
bouncer(["a", "b", "c"]);
@jarenescueta731 Thanks! My code is above... any ideas what I'm doing wrong?
CamperBot
@camperbot
May 25 2016 04:18
odiscious sends brownie points to @jarenescueta731 :sparkles: :thumbsup: :sparkles:
:cookie: 273 | @jarenescueta731 |http://www.freecodecamp.com/jarenescueta731
NEETWizardJanus
@NEETWizardJanus
May 25 2016 04:21
so I have 3 sets of numbers. window size, canvas size in units, and unit size which is x0.866 shorter than it is tall. where do I put the multipliers to resize the canvas to the window?
why does it take me so many hours to figure this out?
what do I need to study to be better at this?
It's what's always slowed me down in programming. as soon as an equation isn't in front of me or gets too long, I can't keep track of it.
Isaac Pak
@pak11273
May 25 2016 04:29
@NEETWizardJanus just a suggestion, but take things in small steps, don't do in your head and draw it out.
Samuel Cupidon
@Zerazera
May 25 2016 04:29
@NEETWizardJanus Why couldn't you just have one side be .866 * the minimum of screen width and height?
ALMY91
@ALMY91
May 25 2016 04:32
what does a with keyword do?
is anybody able to come up with a simple code illustration to show the effects of this keyword?
and what happens when it is not used where it should be used
NEETWizardJanus
@NEETWizardJanus
May 25 2016 04:33
@Zerazera because then it wouldn't fill as much space as possible if it were squashed one way or the other.
It would basically be a canvas inside a square inside a window
odiscious
@odiscious
May 25 2016 04:33
@jarenescueta731 Did you see my code?
NixonRichard
@NixonRichard
May 25 2016 04:34
fuck
sorry
i just testing if they fixed bad words
help counting cards
CamperBot
@camperbot
May 25 2016 04:34

:point_right: challenge counting cards [wiki]

Challenge 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 challenge counting cards on the FCC Wiki

Jaren Escueta
@jarenescueta731
May 25 2016 04:39
@odiscious sorry for the late reply, i just got back from eating dinner. you don't need to use the push() method. the array.filter(function) method automatically takes the values returned from function and puts them in the array.
@odiscious try assigning to arr2 instead
@odiscious also, your side function should be returning values, not booleans
NixonRichard
@NixonRichard
May 25 2016 04:47
var count = 0;

function cc(card) {
  // Only change code below this line
  switch(card)
    { case 2:
      case 3:
      case 4:
      case 5:
      case 6:
        count +1;break;
      case 7:
      case 8:
      case 9:
        count 0;break;
      case 10:
      case 'j':
      case 'q':
      case 'k':
      case 'a':
        count -1;break;}
  if (card > 0){return "Bet";}
  else {return "Hold";}


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

// Add/remove calls to test your function.
// Note: Only the last will display
cc(2); cc(3); cc(7); cc('K'); cc('A');
help guyz doesnt work
CamperBot
@camperbot
May 25 2016 04:48
no wiki entry for: guyz doesnt work
OneRandomJamie
@OneRandomJamie
May 25 2016 04:48
This message was deleted
innovatorandcreator
@innovatorandcreator
May 25 2016 04:50
hey all working on #224 and have been stumped on this Profile Lookup exercise. I have pasted my code below (hopefully the correct formatting this time, apologize ahead of time for the rookie mistake). I am only getting 2 out of 5 to work. Thank you!

function lookUpProfile(firstName, prop){
// Only change code below this line
for (var i = 0; i < contacts.length; i++){
  var selectedFirstName = contacts[i].firstName;
  var selectedProp = contacts[i][prop];
  if(selectedFirstName == firstName && contacts[i].hasOwnProperty(prop)) {
    return selectedProp;
  }
  else if (selectedFirstName !== firstName) {
    return "No such contact";
  }
  else {
    return "No such property";
  }
}
// Only change code above this line
}
Muhamad Firhat
@firhatsungkar
May 25 2016 04:50
This message was deleted
Hi, i get difficulty on Sum All Odd Fibonacci Numbers. How can sumFibs(1000) get result of 1785. Mine is 11708364174233842
OneRandomJamie
@OneRandomJamie
May 25 2016 04:52
Could someone show me the answer for a challenge? I have asked 5 different people to explain it and I still dont understand it.
innovatorandcreator
@innovatorandcreator
May 25 2016 04:52
@NixonRichard check your count syntax..try something like count +=1 or ++
Joe Daoud
@joedaouddotcom
May 25 2016 04:52
find switch statements
innovatorandcreator
@innovatorandcreator
May 25 2016 04:54
also @NixonRichard check your last if statement. Looks like a type for card instead of what it should be
NixonRichard
@NixonRichard
May 25 2016 04:56
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"Bet";}
  else { return count+"Hold";}


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

// Add/remove calls to test your function.
// Note: Only the last will display
cc(2);
is this right ?
cuz it still not working
NEETWizardJanus
@NEETWizardJanus
May 25 2016 04:58
I bet I suck at this because I didn't get a classical Greek education including geometry.
NixonRichard
@NixonRichard
May 25 2016 04:58
i deleted count+ change me
Muhamad Firhat
@firhatsungkar
May 25 2016 04:59

Hi ! please help me ...

function sumFibs(num) {
  var i, fib=[0,1];
  for(i = 2; i <= num; i++) {
    fib[i] = fib[i-2] + fib[i-1];
  }
  num = fib.reduce(function(prev,curr){
    return prev + (curr%2 === 0 ? 0 : curr);
  });
  return num;
}

sumFibs(1000);

i already sum all odd number only, but the result is not 1785. Help me understand the instructions.
instructions: Return the sum of all odd Fibonacci numbers up to and including the passed number if it is a Fibonacci number.

The first few numbers of the Fibonacci sequence are 1, 1, 2, 3, 5 and 8, and each subsequent number is the sum of the previous two numbers.

As an example, passing 4 to the function should return 5 because all the odd Fibonacci numbers under 4 are 1, 1, and 3.

innovatorandcreator
@innovatorandcreator
May 25 2016 05:00
@NixonRichard you are mistaken with where you have placed your conditionals and breaks
ex for first sets of cases
switch(card) {
  case 2:
  case 3:
  case 4:
  case 5:
  case 6:
   count++;
    if (count >0) {
    return count + " Bet";
    }
    else {
      return count + " Hold";
    }
      break;
NixonRichard
@NixonRichard
May 25 2016 05:05
switch(card)
{
case 2:
case 3:
case 4:
case 5:
case 6:
count++;
if (count >0){return count + " Bet";}
else{
return count + " Hold";
}break;
ur code doesnt work
innovatorandcreator
@innovatorandcreator
May 25 2016 05:06
that is because that is only example for the first set of cases
as i instructed you, it was an example. You should follow that structure but apply it for the appropriate other two sets
OneRandomJamie
@OneRandomJamie
May 25 2016 05:07
Could someone show me the answer for a challenge? I have asked 5 different people to explain it and I still dont understand it.
innovatorandcreator
@innovatorandcreator
May 25 2016 05:07

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++;
    if (count >0) {
    return count + " Bet";
    }
    else {
      return count + " Hold";
    }
      break;
  case 7:
  case 8:
  case 9:
      count = count + 0;
    if (count >0) {
    return count + " Bet";
    }
    else {
      return count + " Hold";
    }
      break;
  case 10:
  case "J":
  case "Q":
  case "K":
  case "A":
    count --;
    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
that is full correct code although i do not think u learn as well that way.
best of luck
Muhamad Firhat
@firhatsungkar
May 25 2016 05:07
@innovatorandcreator hi there! do you have any idea to solve mine ?
NixonRichard
@NixonRichard
May 25 2016 05:09
ya got it
why count = count +0 work but count = count ++ dont ?
Chris Fornesa
@cftxp
May 25 2016 05:10
This message was deleted
innovatorandcreator
@innovatorandcreator
May 25 2016 05:12
@firhatsungkar I wish i could help but i think you are actually further along than I. Can't seem to get past Profile LookUp exercise
function lookUpProfile(firstName, prop){
// Only change code below this line
for (var i = 0; i < contacts.length; i++){
  var selectedFirstName = contacts[i].firstName;
  var selectedProp = contacts[i][prop];
  if(contacts[i].hasOwnProperty(prop)===false) {
    return "No such property";
  }
  else if (selectedFirstName !== firstName) {
    return "No such contact";
  }
  else {
    return selectedProp;
  }
}
// Only change code above this line
count ++ is equivalent to writing "count = count + 1"
so if you write "count = count++" thats like writing "count = count=count + 1"
Matt Schlenker
@m4ttsch
May 25 2016 05:15
Hey there, taking a break from exercises for the moment! Anyone need help with anything?
Muhamad Firhat
@firhatsungkar
May 25 2016 05:16

@m4ttsch help me pls

Hi ! please help me ...

```
function sumFibs(num) {
var i, fib=[0,1];
for(i = 2; i <= num; i++) {
fib[i] = fib[i-2] + fib[i-1];
}
num = fib.reduce(function(prev,curr){
return prev + (curr%2 === 0 ? 0 : curr);
});
return num;
}

sumFibs(1000);
```
i already sum all odd number only, but the result is not 1785. Help me understand the instructions.
instructions: Return the sum of all odd Fibonacci numbers up to and including the passed number if it is a Fibonacci number.

The first few numbers of the Fibonacci sequence are 1, 1, 2, 3, 5 and 8, and each subsequent number is the sum of the previous two numbers.

As an example, passing 4 to the function should return 5 because all the odd Fibonacci numbers under 4 are 1, 1, and 3.

NEETWizardJanus
@NEETWizardJanus
May 25 2016 05:16
Well, I did it. I don't know how, but I did it. Similar to how I typed out last, I divided window width by units wide, window height by units tall multiplied by the hexagon height-to-width ratio that makes them short, and my canvas scales to window size.
Matt Schlenker
@m4ttsch
May 25 2016 05:18
@firhatsungkar, couple things:
var i, fib=[0,1]
doesn't set i
and fib should equal [1,1] as per the instructions, if I remember correclty
NixonRichard
@NixonRichard
May 25 2016 05:19
my iq s 80
NEETWizardJanus
@NEETWizardJanus
May 25 2016 05:19
Well, I also kept the crazy calculation of canvas size height = window width 0.888 (which is ... crap, what is that? units wide to units tall ratio??} and 0.866 {which is the hexagon ratio again}
NixonRichard
@NixonRichard
May 25 2016 05:19
is that genius ?
cuz i heard that average ppl iq s just 10 ?
innovatorandcreator
@innovatorandcreator
May 25 2016 05:20
@m4ttsch appreciate you checking in the chats on your break from exercises. If possible, any assistance on #224 Profile Lookup would be appreciated. I feel like I am close but don't like how i am leaving the array value up to the last "else". Not sure if thats whats causing my issue though. Thank you!
function lookUpProfile(firstName, prop){
// Only change code below this line
for (var i = 0; i < contacts.length; i++){
  var selectedFirstName = contacts[i].firstName;
  var selectedProp = contacts[i][prop];
  if(contacts[i].hasOwnProperty(prop)===false) {
    return "No such property";
  }
  else if (selectedFirstName !== firstName) {
    return "No such contact";
  }
  else {
    return selectedProp;
  }
}
// Only change code above this line
CamperBot
@camperbot
May 25 2016 05:20
innovatorandcreator sends brownie points to @m4ttsch :sparkles: :thumbsup: :sparkles:
:cookie: 277 | @m4ttsch |http://www.freecodecamp.com/m4ttsch
innovatorandcreator
@innovatorandcreator
May 25 2016 05:22
@m4ttsch thanks brotha
CamperBot
@camperbot
May 25 2016 05:22
innovatorandcreator sends brownie points to @m4ttsch :sparkles: :thumbsup: :sparkles:
:warning: innovatorandcreator already gave m4ttsch points
Markus Kiili
@Masd925
May 25 2016 05:22
@innovatorandcreator The simplest structure is two nested if clauses inside contact loop. FirstName check and property existence check. Then just the returns on correct spots. You are returning "No such contact" based on one contact, which is wrong.
Matt Schlenker
@m4ttsch
May 25 2016 05:23
@innovatorandcreator, what is the name of the exercise? I need to see what is passed in/what is expected
NEETWizardJanus
@NEETWizardJanus
May 25 2016 05:24
well, I was wrong. it is REALLY messed up. not that anyone's paying attention to me.
Muhamad Firhat
@firhatsungkar
May 25 2016 05:24

@m4ttsch I already fix it.


function sumFibs(num) {
  var fib=[1,1];
  for(var i = 2; i < num; i++) {
    fib[i] = fib[i-2] + fib[i-1];
  }
  num = fib.reduce(function(prev,curr){
    return prev + (curr%2 === 0 ? 0 : curr);
  });
  return num;
}

sumFibs(1000);

but the result is still the same.

Zach
@Moose1551
May 25 2016 05:25
Would it be possible to use an incredibly long and annoying switch case statement for the bonfire challenge "Caesars cipher"?
Chris Fornesa
@cftxp
May 25 2016 05:25
Hey everyone, I'm having some trouble with the Stand In Line exercise and I'm not really quite sure what I'm supposed to do. So far, I have this code:
function nextInLine(arr, item) {
// Your code here
testArr.push(arr[4]+1);
testArr.shift(arr[0]);
return arr[0]; // Change this line
}
Markus Kiili
@Masd925
May 25 2016 05:26
@Moose1551 Sure you can.
Matt Schlenker
@m4ttsch
May 25 2016 05:26
@Moose1551 It wouldn't be annoying, but think about how much work it would be, if I told you to change it from rot13 to rot14...
Zach
@Moose1551
May 25 2016 05:27
Good point, @m4ttsch , haha.
buiphuking
@buiphuking
May 25 2016 05:27
anyone good at z-index or have some tutorial about that, plz share with me, i build pomodoro clock, by the way !!!
Markus Kiili
@Masd925
May 25 2016 05:27
@m4ttsch Only Caesar can do that change.
Matt Schlenker
@m4ttsch
May 25 2016 05:28
@firhatsungkar, in your for, make sure that you go up to AND INCLUDING num
Kelvin-penang
@Kelvin-penang
May 25 2016 05:29
Good afternoon to all
NEETWizardJanus
@NEETWizardJanus
May 25 2016 05:30
uhg... is there a way I can see my <div> size and also see the debug text I'm printing into my HTML at the same time? when I color my div it covers the text at the precise moment I need to see it. ... if I could only draw a rectangle at full size without it going outside the <div> element. I wonder if I can just ... use 100% for it somehow...
innovatorandcreator
@innovatorandcreator
May 25 2016 05:30
got past the profile lookup. Thank you all for comments and help. Much appreciated
Kelvin-penang
@Kelvin-penang
May 25 2016 05:31
I need some help on making the array "I, like, corgis,so,much" into
"[I],[l,i,k,e],[c,o,r,g,i,s],[s,o],[m,u,c,h]"
Can anybody help?
Anusha
@anushavicky
May 25 2016 05:31

@cftxp
function nextInLine(arr, item) {
// Your code here

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

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

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

NEETWizardJanus
@NEETWizardJanus
May 25 2016 05:32
ok. svg rectangle. let's try that. watch me fail this simple task.
yedlahs
@yedlahs
May 25 2016 05:33
I'm on "Record Collection" challenge. I'm seeing this error: TypeError: collection.id is undefined.
What am I missing?
Kelvin-penang
@Kelvin-penang
May 25 2016 05:33
Hi all
I need some help on making the array
"I, like, corgis,so,much"
into
"[I],[l,i,k,e],[c,o,r,g,i,s],[s,o],[m,u,c,h]"
Can anybody help?
Chris Fornesa
@cftxp
May 25 2016 05:34
@anushavicky Much appreciated, thank you very much! I was overthinking it as I suspected :D
CamperBot
@camperbot
May 25 2016 05:34
cftxp sends brownie points to @anushavicky :sparkles: :thumbsup: :sparkles:
:cookie: 231 | @anushavicky |http://www.freecodecamp.com/anushavicky
NEETWizardJanus
@NEETWizardJanus
May 25 2016 05:34
yup. big surprise there. I can't make a rectangle appear. I can never do anything. Not the simplest of tasks.
yedlahs
@yedlahs
May 25 2016 05:34
@Kelvin-penang - split the string using comma as the delimited. This would give you each word. Split that further into each alphabet and store it in an array.
Markus Kiili
@Masd925
May 25 2016 05:35
@Kelvin-penang Do you mean: var arr = ["I","like","corgis","so","much"];
Kelvin-penang
@Kelvin-penang
May 25 2016 05:35
nope, I need letters of each word to become a subarray of the entire array
@yedlahs how do I split further?
yedlahs
@yedlahs
May 25 2016 05:36
str.split(",")
That will give you each word
Markus Kiili
@Masd925
May 25 2016 05:36
@Kelvin-penang var arr = [["I"],["l","i","k","e"],[...],[...],[...]];
NEETWizardJanus
@NEETWizardJanus
May 25 2016 05:36
I hate myself. why does this keep happening. I hate the world. the world keeps letting this happen.
Kelvin-penang
@Kelvin-penang
May 25 2016 05:37
@Masd925 yes, exactly, but how do I achieve that?
Piyush Deshmukh
@PiyushDeshmukh
May 25 2016 05:37
I am on https://www.freecodecamp.com/challenges/profile-lookup, and I have written a statement like contacts[i]["firstName"], which seems to be problematic, my code passes 2 out of 5 tests, what should I do? If it's not against the honor code, I can put some code here on the forum
NEETWizardJanus
@NEETWizardJanus
May 25 2016 05:37
how many fucking hours will I waste trying to get a rectangle to appear just to debug a stupid program that doesn't work right to begin with?
Zach
@Moose1551
May 25 2016 05:38
Gang, these for loops are absolutely killing me. After two months, going through the chapters over and over again, I still don't understand them. How do I get the loop to continue after something has passed as true? For example: in Ceasars Cipher, I can get "S" to come back as "F", but I can't get any of the other characters to work. Any suggestions?
str.split("");
var answer = " ";
var holder = [];

  for (var i = 0; i <= str.length; i++) {
  answer = answer[i] + str[i];


switch (str[i]) {
case "A": answer = "N";
break;
case "B": answer = "O";
break;
case "C": answer = "P"; //code continues through rest of alphabet
NEETWizardJanus
@NEETWizardJanus
May 25 2016 05:38
can I not put a rectangle in a div that has another div inside it? like <div> <rect> <div></div> </div> ?
RakeshNerkar
@Rakesh18754
May 25 2016 05:38
return "translate(" + c[0]1.5 +"," + c11.5 + ")"; i want to store this value in a variable hwo to do it???
Markus Kiili
@Masd925
May 25 2016 05:38
@Kelvin-penang How do you get the input strings?
Kelvin-penang
@Kelvin-penang
May 25 2016 05:39
I used str.split(" ") on the original string
NEETWizardJanus
@NEETWizardJanus
May 25 2016 05:39
can I not put a rectangle in a div that has another div inside it? like <div> <rect> <div></div> </div> ?
Kelvin-penang
@Kelvin-penang
May 25 2016 05:39
@Masd925 I originally thought that I could use a loop to further split the string fragments inside the array, but i couldn't get it
NEETWizardJanus
@NEETWizardJanus
May 25 2016 05:40
can I not put a rectangle in a div that has another div inside it? like <div> <rect> <div></div> </div> ?
Markus Kiili
@Masd925
May 25 2016 05:40
@Kelvin-penang .map() method is useful there.
NixonRichard
@NixonRichard
May 25 2016 05:40
my iq s 69
NEETWizardJanus
@NEETWizardJanus
May 25 2016 05:40
fucking god damn the world.
Kelvin-penang
@Kelvin-penang
May 25 2016 05:41
.map? sorry, a real noob...what does .map do?
Markus Kiili
@Masd925
May 25 2016 05:41
var str = "Cat has pants";
var arr = str.split(" ");
arr=arr.map(function(elem){
    return elem.split(""); // [ [ 'C', 'a', 't' ], [ 'h', 'a', 's' ], [ 'p', 'a', 'n', 't', 's' ] ]
});
Surbhi Oberoi
@surbhioberoi
May 25 2016 05:41
I just published an article on how I learnt better programming by creating games on canvas https://medium.com/@thesurbhioberoi/how-creating-simple-canvas-games-helped-me-6eef839f450e#.nsum0j4ab
Muhamad Firhat
@firhatsungkar
May 25 2016 05:41

@m4ttsch

function sumFibs(num) {
  var fib=[1,1];
  for(var i = 2; i < num; i++) {
    fib[i] = (fib[i-2] + fib[i-1]) < num ? fib[i-2] + fib[i-1] : 0;
  }
  num = fib.reduce(function(prev,curr){
    return prev + (curr%2 === 0 ? 0 : curr);
  });
  return num;
}

sumFibs(1000);

The result is reduce to 649257, but the answer is 1785. How can i get that number ?

NEETWizardJanus
@NEETWizardJanus
May 25 2016 05:41
why did I buy all those cookies? I just want to eat them all now that I'm mad. I have nothing else to feel good about.
why can't I feel good? other people can.
there are people more retarded than me that can feel good.
yedlahs
@yedlahs
May 25 2016 05:42
@Kelvin-penang - try this. <code> var words = str.split(","); for (var i =0; i < words.length; i++) finalarray[i] = words[i].split("");</code>
Kelvin-penang
@Kelvin-penang
May 25 2016 05:42
@Masd925 thanks....will try to work with that
CamperBot
@camperbot
May 25 2016 05:42
kelvin-penang sends brownie points to @masd925 :sparkles: :thumbsup: :sparkles:
:star2: 1592 | @masd925 |http://www.freecodecamp.com/masd925
NEETWizardJanus
@NEETWizardJanus
May 25 2016 05:42
I wonder what's defective in my brain.
Matt Schlenker
@m4ttsch
May 25 2016 05:42
@firhatsungkar I was making the same mistake you are, num not what you think it is, when num is 1000, you add up all the odd fibs below 1000, not all of the odd fibs after 1000 iterations
NEETWizardJanus
@NEETWizardJanus
May 25 2016 05:42
there must be a lot that's defective.
Kelvin-penang
@Kelvin-penang
May 25 2016 05:42
@yedlahs thanks too. will try this out too :)
CamperBot
@camperbot
May 25 2016 05:42
kelvin-penang sends brownie points to @yedlahs :sparkles: :thumbsup: :sparkles:
:cookie: 222 | @yedlahs |http://www.freecodecamp.com/yedlahs
yedlahs
@yedlahs
May 25 2016 05:43
collection.id.prop.value !== ""
NEETWizardJanus
@NEETWizardJanus
May 25 2016 05:43
uhg. maybe that nausea I've been having for the past 2 months is from slouching from feeling so depressed.
Markus Kiili
@Masd925
May 25 2016 05:43
@Kelvin-penang It tells map method to replace arr elements (strings) with splitted elements (arrays of characters).
yedlahs
@yedlahs
May 25 2016 05:43
I'm on "Record Collection" challenge. I'm seeing this error: TypeError: collection.id is undefined.
Markus Kiili
@Masd925
May 25 2016 05:43
@yedlahs
The dot notation only works if the property key string is a valid JS identifier (for example "12" and "lives left" are not) and you write the key after the dot: var cat={clothes:"pants", "lives left":3}; cat.clothes; //returns "pants". Bracket notation works with keys that can be arbitrary strings cat["lives left"]; //returns 3, variables var key="clothes"; cat[key]; //returns "pants", or expressions cat["lives"+" "+"left"]; //returns 3.
Kelvin-penang
@Kelvin-penang
May 25 2016 05:44
:+1:
Markus Kiili
@Masd925
May 25 2016 05:44
@yedlahs So .id and .propdon't work there.
NEETWizardJanus
@NEETWizardJanus
May 25 2016 05:44
how am I supposed to deal with all of this? nobody else gives a shit about me for more than a few seconds, which isn't enough time to accomplish anything. I'm too old to be parented, so it's just me trying to fix the horrible mess I've become.
yedlahs
@yedlahs
May 25 2016 05:45
@Masd925 Thanks.
CamperBot
@camperbot
May 25 2016 05:45
yedlahs sends brownie points to @masd925 :sparkles: :thumbsup: :sparkles:
:star2: 1593 | @masd925 |http://www.freecodecamp.com/masd925
NEETWizardJanus
@NEETWizardJanus
May 25 2016 05:46
I spent decades just minding my own business for the most part. It hasn't done me any good. Sometimes I just feel really pissed off that everyone has let me fail so hard. what does it matter if they're inconvenienced or upset at my behavior?
what are we going to do
in these stupid internet bubbles.
I wonder if kids who grew up with cell phones are trapped in bubbles any more than me. or if they move to new platforms more easily.
NixonRichard
@NixonRichard
May 25 2016 05:50
?
NEETWizardJanus
@NEETWizardJanus
May 25 2016 05:51
I don't know how a break will help me. but maybe they're not long enough. I dunno. maybe I'll go for a walk. Damnit, it's so late at night. I'll never have a normal sleep cycle. I guess I'll have to allow that ebay sniper service to do all my bidding tomorrow afternoon.
NixonRichard
@NixonRichard
May 25 2016 05:52
explain ur problem in few words
CamperBot
@camperbot
May 25 2016 05:52
no wiki entry for: ur problem in few words
NixonRichard
@NixonRichard
May 25 2016 05:52
the center the core
i think tha t u feel suck about ur work
NixonRichard
@NixonRichard
May 25 2016 06:01
help Accessing Objects Properties with Variables
CamperBot
@camperbot
May 25 2016 06:01

:point_right: challenge accessing objects properties with variables [wiki]

Challenge Accessing Objects Properties with Variables

Another use of bracket notation on objects is to use a variable to access a property. This can be very useful for iterating through lists of the object properties or for doing the lookup.

Here is an example of using a variable to access a property:

var someProp = "propName";
var myObj = {
  propName: "Some Value"
}

myObj[someProp]; // "Some Value" Note that we do not use quotes around the variable name when using it to access the property because we are using the value of the variable, not the name.

:pencil: read more about challenge accessing objects properties with variables on the FCC Wiki

JimmyBonez
@JimmyBonez
May 25 2016 06:01
in a str.replace method how would I get right of spaces/whitespace?
rid*
Matt Schlenker
@m4ttsch
May 25 2016 06:02
@JimmyBonez js str.replace(/\s/)
JimmyBonez
@JimmyBonez
May 25 2016 06:02
@m4ttsch thanks
CamperBot
@camperbot
May 25 2016 06:02
jimmybonez sends brownie points to @m4ttsch :sparkles: :thumbsup: :sparkles:
:cookie: 279 | @m4ttsch |http://www.freecodecamp.com/m4ttsch
Matt Schlenker
@m4ttsch
May 25 2016 06:02
str.replace(/\s/g, "")
second one is correct, sorry about that
Manan Kalra
@manankalra
May 25 2016 06:03

```function titleCase(str) {
var lower = str.toLowerCase();
var split = lower.split(' ');

for(var i=0;i<split.length;i++){
split[i][0].toUpperCase();
}

return split.join(' ');

}

titleCase("I'm a little tea pot");```

Jack Lyons
@JackEdwardLyons
May 25 2016 06:03
hi guys, does anyone have experience with multiple API ajax calls
Manan Kalra
@manankalra
May 25 2016 06:03
Can someone tell why my array is not being updated?
Jack Lyons
@JackEdwardLyons
May 25 2016 06:03
i have two urls i want to fetch
Markus Kiili
@Masd925
May 25 2016 06:04
@JimmyBonez str.replace(/\s/g,""); would remove all the whitespace.
Matt Schlenker
@m4ttsch
May 25 2016 06:04
@JackEdwardLyons cool, tell me more
Markus Kiili
@Masd925
May 25 2016 06:04
@mananKalra Strings are immutable, so you cannot set characters.
DJ
@qualitymanifest
May 25 2016 06:04
@mananKalra strings are immutable. you can't change them. you could reassign each word to the first letter capitalized + the rest of the word
NixonRichard
@NixonRichard
May 25 2016 06:05
var testObj = {
  12: "Namath",
  16: "Montana",
  19: "Unitas"
};

// Only change code below this line;
var player = "Montana";
var playerNumber = 16;     // Change this Line
var player = testObj[];  // Change this Line
Manan Kalra
@manankalra
May 25 2016 06:05
@Masd925 @qualitymanifest
Thanks, I'll give it a try.
CamperBot
@camperbot
May 25 2016 06:05
manankalra sends brownie points to @masd925 and @qualitymanifest :sparkles: :thumbsup: :sparkles:
:star2: 1173 | @qualitymanifest |http://www.freecodecamp.com/qualitymanifest
:star2: 1594 | @masd925 |http://www.freecodecamp.com/masd925
NixonRichard
@NixonRichard
May 25 2016 06:05
guyz help me with this lesson
DJ
@qualitymanifest
May 25 2016 06:06
@JackEdwardLyons i used jquery .when() (both calls are) .done() for that
Markus Kiili
@Masd925
May 25 2016 06:06
@NixonRichard Use the variable as property key when you access the object there.
Jack Lyons
@JackEdwardLyons
May 25 2016 06:06
yeah
but how do you display data1, and data2
in this tut
var firstPromise = $.get("http://example.com/first");
var secondPromise = $.get("http://example.com/second");

$.when(firstPromise, secondPromise).done(function(firstData, secondData) {
  // do something
});
Muhamad Firhat
@firhatsungkar
May 25 2016 06:07

@m4ttsch You're Hero of the day dude... I made it !


function sumFibs(num) {
  var fib=[1,1];
  for(var i = 2; i < 1000; i++) {
    fib[i] = fib[i-2] + fib[i-1];
  }
  num = fib.filter(function(val){return val <= num & val%2 > 0;});
  num = num.reduce(function(prev,curr){return prev + curr;});
  return num;
}

sumFibs(1000);

Thanks you very much :D

CamperBot
@camperbot
May 25 2016 06:07
firhatsungkar sends brownie points to @m4ttsch :sparkles: :thumbsup: :sparkles:
:cookie: 280 | @m4ttsch |http://www.freecodecamp.com/m4ttsch
Jack Lyons
@JackEdwardLyons
May 25 2016 06:07
how do you display firstData and secondData
Matt Schlenker
@m4ttsch
May 25 2016 06:07
@firhatsungkar nice bro
Jack Lyons
@JackEdwardLyons
May 25 2016 06:07
@qualitymanifest
DJ
@qualitymanifest
May 25 2016 06:07
@JackEdwardLyons try console.logging them to see what firstData and secondData give you... then put them in the DOM inside the .done() function
Jack Lyons
@JackEdwardLyons
May 25 2016 06:08
ok
ill try that
here's what i think im trying to do
for (var i = 0; i < userName.length; i++) {

      var urlName = "https://api.twitch.tv/kraken/channels/" + userName[i];
      var urlStream = "https://api.twitch.tv/kraken/streams/" + userName[i];


    var promise1 = $.ajax({
      url: urlName,  
      method: 'get',
      format: 'jsonp'
    });

var promise2 = $.ajax({
      url: urlStream,  
      method: 'get',
      format: 'jsonp'
    });

    $.when(promise1, promise2).done(function(data1, data2) {
      data1 = function() {

      data2 = function() {

      }
    });
JimmyBonez
@JimmyBonez
May 25 2016 06:08
Doesn't work. And when I try to .join an array that doesn't do the job either. So how would you go about getting rid of spaces/whitespace in an array instead? Or am I just using the .join wrong, since MDN is so vague in desricptions.
Jack Lyons
@JackEdwardLyons
May 25 2016 06:08
im not sure if that's the right way to set it up?
Markus Kiili
@Masd925
May 25 2016 06:09
@JimmyBonez If you need to remove whitespace from an array of characters, you can join them to a string and use replace. Or use .filter() method on the array.
JimmyBonez
@JimmyBonez
May 25 2016 06:10
Tried all. None have done as advertised. Doesn't seem like it should really be that complicated.
NixonRichard
@NixonRichard
May 25 2016 06:11
var playerNumber = 16;     // Change this Line
var player = testObj[ 16];
sorry it doesnt work
DJ
@qualitymanifest
May 25 2016 06:11
@JackEdwardLyons i used a foreach to go through each username and used $.getJSON for each of the calls. if you use getJSON you will need to add ?callback=? to the end of the URLs
Jack Lyons
@JackEdwardLyons
May 25 2016 06:13
so with getJSON, i don't need method get and format jsonp if I use callback=?
NixonRichard
@NixonRichard
May 25 2016 06:13
help plz
CamperBot
@camperbot
May 25 2016 06:13
no wiki entry for: plz
NixonRichard
@NixonRichard
May 25 2016 06:13
guyz
i use bracket notation
UDAY PRAPHULLA MALANGAVE
@malangaveuday
May 25 2016 06:13
var createCards = function(data){
    var count = Object.keys(data).length;     
    var dataArray = [];
    for(var key in data){
      var value = data[key];
      dataArray.push(value);
    }   
   for(var i = 0; i < count; i++){    

          setTimeout(function(){
               var html = '<div class="wiki-card"><div><h3>'+ dataArray[i].title +'</h3><div></div>';  
               $(".wiki-container").append(html);
             },1000 * i); 
          }     
  };
console.log(dataArray[i].title); its working fine in loop but its not working propery in setTimeout function please help me
DJ
@qualitymanifest
May 25 2016 06:13
@JackEdwardLyon correct
Markus Kiili
@Masd925
May 25 2016 06:14
@NixonRichard Use the variable here instead of 16: testObj[ 16]; <- put the variable here that contains value 16
NixonRichard
@NixonRichard
May 25 2016 06:15
var playerNumber = testObj[16];     // Change this Line
var player = testObj[16];  // Change this Line
like this ?
Jack Lyons
@JackEdwardLyons
May 25 2016 06:16
@qualitymanifest so would it look like this?
   $.getJSON({
    url: urlName + "&callback=?",
    success: function(data) {
cause that's not working?
Markus Kiili
@Masd925
May 25 2016 06:17
@NixonRichard No. On the first line you declare a variable called playerNumber that has value 16. On the second line you access an object property with bracket notation. There you should use the variable declared on the first line as the key (instead of 16).
DJ
@qualitymanifest
May 25 2016 06:17
@JackEdwardLyons
foreach loop here
URL vars to use for calls here
when
both getJSON calls using the above URLS are
done
put it on the page
NixonRichard
@NixonRichard
May 25 2016 06:17
really it worked
lol
DJ
@qualitymanifest
May 25 2016 06:18

@JackEdwardLyons that getJSON call isn't quite right. it's

$.getJSON(URL goes here, or var containing URL)

that's all

NixonRichard
@NixonRichard
May 25 2016 06:18
thx @Masd925
CamperBot
@camperbot
May 25 2016 06:18
nixonrichard sends brownie points to @masd925 :sparkles: :thumbsup: :sparkles:
:star2: 1595 | @masd925 |http://www.freecodecamp.com/masd925
Jack Lyons
@JackEdwardLyons
May 25 2016 06:18
@qualitymanifest so no callback=?
i thought that was important
DJ
@qualitymanifest
May 25 2016 06:20
@JackEdwardLyons that goes at the end of the URL, which can be a var that you use in the getJSON call or you could just put the URL in the getJSON with that at the end
Jack Lyons
@JackEdwardLyons
May 25 2016 06:20
?jsoncallback=?
that works
thanks @qualitymanifest
CamperBot
@camperbot
May 25 2016 06:21
jackedwardlyons sends brownie points to @qualitymanifest :sparkles: :thumbsup: :sparkles:
:star2: 1174 | @qualitymanifest |http://www.freecodecamp.com/qualitymanifest
DJ
@qualitymanifest
May 25 2016 06:21
yw
Jack Lyons
@JackEdwardLyons
May 25 2016 06:26

now i get nothing :(

  "use strict"
$(document).ready(function() {
  // eventually add in channel genre's - music, programming, poker, sport
  var userName = ['freecodecamp', 'pajlada', 'make', 'dutchboyd', 'jcarverpoker', 'upswingpoker', 'nanonoko', 'george_danzer', 'kevinmartin987'];

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

      var urlName = "https://api.twitch.tv/kraken/channels/" + userName[i];
      var urlStream = "https://api.twitch.tv/kraken/streams/" + userName[i];


    var promise1 = $.ajax({
    url: urlName + "?jsoncallback=?",
    });

    var promise2 = $.ajax({
    url: urlStream + "?jsoncallback=?",
    });

    $.when(promise1, promise2).done(function(data1, data2) {
      data1 = function() {
       console.log(data1);
      }
      data2 = function() {
        console.log(data2);
      }
  });
  }
});

@qualitymanifest

NEETWizardJanus
@NEETWizardJanus
May 25 2016 06:30
how do I make a rectangle properly? the examples are easy, but I can't apply it correctly. http://codepen.io/NEETWizardJanus/pen/JXzeeq
shariquemaaz
@shariquemaaz
May 25 2016 06:31
hey guys .. could you please help me with the details aof any API which will help me tweeting a status.. (API or any related stuff to post a status to twitter from our application).
Jonathan Mitchell
@Vanhealen
May 25 2016 06:31

Does anybody know why I can push in something thats neither a string nor anything in this example.

Here is an implementation of .forEach to save certain properties and their values from an array consisting of objects

function() {
    var newReleases = [
            {
                "id": 70111470,
                "title": "Die Hard",
                "boxart": "http://cdn-0.nflximg.com/images/2891/DieHard.jpg",
                "uri": "http://api.netflix.com/catalog/titles/movies/70111470",
                "rating": [4.0],
                "bookmark": []
            },
            {
                "id": 654356453,
                "title": "Bad Boys",
                "boxart": "http://cdn-0.nflximg.com/images/2891/BadBoys.jpg",
                "uri":