These are chat archives for FreeCodeCamp/HelpJavaScript

4th
Jan 2017
Simon Cordova
@gbsimon87
Jan 04 2017 00:00
@MikeJSchorah I sent about three a day maybe, but with cover letters and stuff, and whenever I ot a response I made sure to learn that company a bit
Brownie points in the interview
Mike
@MikeJSchorah
Jan 04 2017 00:00
@gbsimon87 Wow, but you sent out 1,000? So it took a whole year?
Simon Cordova
@gbsimon87
Jan 04 2017 00:01
Not literally a thousand
But honestly a lot...I just went all over linkedin
Mike
@MikeJSchorah
Jan 04 2017 00:01
Oh ok. Couple months
HeebieGeeBee
@HeebieGeeBee
Jan 04 2017 00:01
@gbsimon87 were they all local? where do you live?
Simon Cordova
@gbsimon87
Jan 04 2017 00:01

Yeah, from when I started sending them out it tookd 2.5 - 3 months

London, all local yeah

HeebieGeeBee
@HeebieGeeBee
Jan 04 2017 00:02
oh ok london
Simon Cordova
@gbsimon87
Jan 04 2017 00:02
To be perfectly honest I've learned quite a bit this past month at work, but I learn more here in FCC on a day to day basis
HeebieGeeBee
@HeebieGeeBee
Jan 04 2017 00:02
yeah london sho0uld always have lots
Simon Cordova
@gbsimon87
Jan 04 2017 00:02
Yeah, it's a mecca for them
Mike
@MikeJSchorah
Jan 04 2017 00:02
@gbsimon87 Wow really? So, the job is nowhere near as difficult as FCC?
I started struggling since the algorithms. I completed everything before that in less than 2-3 days.
Simon Cordova
@gbsimon87
Jan 04 2017 00:03
It can be challenging for sure, and it will also depend on your job details, but my job mainly requires using jQuery for DOM manipulations...
Traversing the DOM and stuff
But it gets complicated when you're looking at 2000 lines of code lol
I'm hoping one day I can get to the same level as some of the pros here on FCC
Kevin White
@Knowledge0417
Jan 04 2017 00:06
need a little help on challenge 131
It asks that I change myVar = myVar + 1 so that I use the ++ operator
Simon Cordova
@gbsimon87
Jan 04 2017 00:07
@Knowledge0417 what's the challenge's name?
Kevin White
@Knowledge0417
Jan 04 2017 00:07
I input this, myVar = ++myVar and everything is checked but "myVar = myVar should be changed
Increment a Number with JavaScript
Dogemon
@Dogemon
Jan 04 2017 00:07
Why won't my trueOrFalse(true/false) give me a result?
Bozhidar Stoyanov Kabzamalov
@BozhidarKabzamalov
Jan 04 2017 00:08
function factorialize(num) {
  if (num === 0) {
    return 1;
  } else {
    for (var i = 1; i <= num; i++) {
      num = num * i;
    }
  }
  return num;
}
factorialize(5);
Dogemon
@Dogemon
Jan 04 2017 00:08
or a string
Bozhidar Stoyanov Kabzamalov
@BozhidarKabzamalov
Jan 04 2017 00:08
can someone tell me why it doesn't work?
Jason Luboff
@JLuboff
Jan 04 2017 00:09
@BozhidarKabzamalov Becuase you can't alter num. You should instead create a new variable and manipulate that
@Dogemon whats your code?
Dogemon
@Dogemon
Jan 04 2017 00:09

// javascript

// Example
function ourTrueOrFalse(isItTrue) {
if (isItTrue) {
return "Yes, it's true";
}
return "No, it's false";
}

// Setup
function trueOrFalse(wasThatTrue) {

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

// Only change code above this line.

}

// Change this value to test
trueOrFalse(false);
//

ignore the //javascript and the // at the end
Kevin White
@Knowledge0417
Jan 04 2017 00:11
@gbsimon87 I figured it out
Jason Luboff
@JLuboff
Jan 04 2017 00:11
@Dogemon Becuase you have the line function trueOrFalse(wasThatTrue){ twice
Simon Cordova
@gbsimon87
Jan 04 2017 00:11
@Knowledge0417 sounds good :)
Kevin White
@Knowledge0417
Jan 04 2017 00:11
@gbsimon87 thanks
CamperBot
@camperbot
Jan 04 2017 00:11
:cookie: 378 | @gbsimon87 |http://www.freecodecamp.com/gbsimon87
knowledge0417 sends brownie points to @gbsimon87 :sparkles: :thumbsup: :sparkles:
Simon Cordova
@gbsimon87
Jan 04 2017 00:11
no worries :)
Dogemon
@Dogemon
Jan 04 2017 00:11
well one of them is the setup
@gbsimon87
CamperBot
@camperbot
Jan 04 2017 00:12
:bulb: to format code use backticks! ``` more info
Bozhidar Stoyanov Kabzamalov
@BozhidarKabzamalov
Jan 04 2017 00:12
function factorialize(num) {
  var factorialize = num;
  if (factorialize === 0) {
    return 1;
  } else {
    for (var i = 1; i <= factorialize; i++) {
      factorialize = factorialize * i;
    }
  }
  return factorialize;
}
factorialize(5);
Jason Luboff
@JLuboff
Jan 04 2017 00:13
@Dogemon Remove the second line. You incorrectly added a second function that is not needed
Bozhidar Stoyanov Kabzamalov
@BozhidarKabzamalov
Jan 04 2017 00:13
potential infinite loop at line 8, why's that?
Jason Luboff
@JLuboff
Jan 04 2017 00:13
@BozhidarKabzamalov Why not have factorialize = 1 and still have our loop be i<=num?
Stephen James
@sjames1958gm
Jan 04 2017 00:13
@BozhidarKabzamalov You are growing factorialize while trying to get to it.
Dogemon
@Dogemon
Jan 04 2017 00:13
// Example
function ourTrueOrFalse(isItTrue) {
  if (isItTrue) { 
    return "Yes, it's true";
  }
  return "No, it's false";
}

// Setup
function trueOrFalse(wasThatTrue) {

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



  // Only change code above this line.

}

// Change this value to test
trueOrFalse(false);
CamperBot
@camperbot
Jan 04 2017 00:13
:bulb: to format code use backticks! ``` more info
Stephen James
@sjames1958gm
Jan 04 2017 00:14
@Dogemon Don't repeat the function definition.
@BozhidarKabzamalov Bad practice to have variables the same name as the function
Jason Luboff
@JLuboff
Jan 04 2017 00:14
@sjames1958gm I've told him that twice already :confused:
Bozhidar Stoyanov Kabzamalov
@BozhidarKabzamalov
Jan 04 2017 00:15
Oh, it worked, thanks @JLuboff @sjames1958gm
CamperBot
@camperbot
Jan 04 2017 00:15
bozhidarkabzamalov sends brownie points to @jluboff and @sjames1958gm :sparkles: :thumbsup: :sparkles:
:cookie: 559 | @jluboff |http://www.freecodecamp.com/jluboff
:star2: 5141 | @sjames1958gm |http://www.freecodecamp.com/sjames1958gm
Dogemon
@Dogemon
Jan 04 2017 00:16
@JLuboff @sjames1958gm That did nothing
Jason Luboff
@JLuboff
Jan 04 2017 00:16
@Dogemon Show your current code
Stephen James
@sjames1958gm
Jan 04 2017 00:17
@Dogemon did you remove the extra } as well?
Dogemon
@Dogemon
Jan 04 2017 00:19
// Example
function ourTrueOrFalse(isItTrue) {
  if (isItTrue) { 
    return "Yes, it's true";
  }
  return "No, it's false";
}

// Setup


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


  // Only change code above this line.

}

// Change this value to test
trueOrFalse(true);
Nvm
Lila Mohamed
@Lila-Mohamed
Jan 04 2017 00:19
Anyone know what's the answer to this var arr = ['a', 'b', 'c']; for(var i = arr.length - 1, > -1; i--) { console.log(arr[i]); }
Dogemon
@Dogemon
Jan 04 2017 00:20
I got it
Jason Luboff
@JLuboff
Jan 04 2017 00:20
@Dogemon You have an extra }
InSugyo
@Luich
Jan 04 2017 00:21
val1>val2 ? j++:i++;
(Expected an assignment or function call and instead saw an expression)
Is it wrong syntax?
mitron6
@mitron6
Jan 04 2017 00:22
@Lila-Mohamed var arr = ['a', 'b', 'c']; for(var i = arr.length - 1; i > -1; i--) { console.log(arr[i]); }
@Lila-Mohamed Use semicolon to separate parts of a for statements. Include i so >-1 becomes i > -1 in middle part of for statement.
Stephen James
@sjames1958gm
Jan 04 2017 00:24
@Dogemon You should acknowledge when people help you
Lila Mohamed
@Lila-Mohamed
Jan 04 2017 00:25
@mitron6 Thanks for clearing that up.
CamperBot
@camperbot
Jan 04 2017 00:25
:cookie: 426 | @mitron6 |http://www.freecodecamp.com/mitron6
lila-mohamed sends brownie points to @mitron6 :sparkles: :thumbsup: :sparkles:
Dylan Hsiao
@greedylan
Jan 04 2017 00:25
why is .replace() not doing its work??
function myReplace(str, before, after) {
  var newStr = str.replace(/before/g, after);
  return newStr;
}
myReplace("A quick brown fox jumped over the lazy dog", "jumped", "leaped");
Jason Luboff
@JLuboff
Jan 04 2017 00:27
@greedylan Try removing the / and the g
mitron6
@mitron6
Jan 04 2017 00:30
@greedylan Are you trying to replace the text 'before' or the contents of the function argument called before?
@greedylan Maybe you want var newStr = str.replace(before, after);
Kim Crayton
@kmcrayton7
Jan 04 2017 00:32
hello...I need some help with Stand In Line. I understand the concept of .push to add a number to the end of the arr and .unshift to remove the first element from the arr. I'm just confused by the instructions and what I'm expected to do.
mitron6
@mitron6
Jan 04 2017 00:32
@greedylan Also you don't really need newStr. You can just return str.replace(before, after);
Kim Crayton
@kmcrayton7
Jan 04 2017 00:35
function nextInLine(arr, item) {
  // Your code here

  return item;  // Change this line
}

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

// Display Code
console.log("Before: " + JSON.stringify(testArr));
console.log(nextInLine(testArr, 6)); // Modify this line to test
console.log("After: " + JSON.stringify(testArr));
Trenton Dragon
@DragonAce01
Jan 04 2017 00:35
i need help in escape sequences in strings
Jason Luboff
@JLuboff
Jan 04 2017 00:36
@kmcrayton7 Our number is the parameter item. Therefore, how can we use push to place our number (item) into our array?
mitron6
@mitron6
Jan 04 2017 00:37
@kmcrayton7 Hi kim. Does this console log help?
> var arr = [1,2]
undefined
> arr.push(3)
3
> arr
[1, 2, 3]
Trenton Dragon
@DragonAce01
Jan 04 2017 00:37
it keeps saying unexpected \ or it thought it was a function
Kim Crayton
@kmcrayton7
Jan 04 2017 00:38
@mitron6 Ok, this looks like what I was thinking but when I look at the code and where I'm supposed to edit I got lost
Instruction state to "write a function nextInLine" which has already been started
Joseph
@revisualize
Jan 04 2017 00:39
@kmcrayton7
// How do you add a number (item) to the end of an array (arr)? What does this method return?
// How do you remove the first element from an array (arr)? What does this method return?
@kmcrayton7 The base of the function has already been written for you.
mitron6
@mitron6
Jan 04 2017 00:40
@kmcrayton7 Right the skeleton of the function is already written. You just have to fill it in.
jv775
@jv775
Jan 04 2017 00:40

Can someone help please. I'm stuck in the following problem:

function convertToF(celsius) {
//only change code below this line

//only change code above this line
}

//change the inputs below to this line
convertToF(0)

Zak
@zaksanderford
Jan 04 2017 00:41
@jv775 What issues are you having with that problem?
Jason Luboff
@JLuboff
Jan 04 2017 00:41
@jv775 Why did you change the code above and below where it tells you not to?
Kim Crayton
@kmcrayton7
Jan 04 2017 00:41
@revisualize arr.push(#) arr.unshift(#)?
Zak
@zaksanderford
Jan 04 2017 00:42
@jv775 Also, reset your code below the second js //only change code above this line should be js return fahrenheit;
andercodder
@andercodder
Jan 04 2017 00:43
hello guys
Joseph
@revisualize
Jan 04 2017 00:43

@jv775 Some example code:

function addThree (num) {
    var result;
    result = num + 3;
    return result;
}

You can see how the parameter is used like a variable inside of the function.
And you can do mathmatical operations to the parameter and assign the value to the variable result

Kim Crayton
@kmcrayton7
Jan 04 2017 00:43
@revisualize
testArr.push(6);
testArr.unshift(0);
jv775
@jv775
Jan 04 2017 00:44
@zak, I have tried to solve the problem for the past hour and can't seem to get it.
@zak: I have written Fahrenheit = Celsius;
but it doesn't work
andercodder
@andercodder
Jan 04 2017 00:44
guys u good
jv775
@jv775
Jan 04 2017 00:45
on the assignments I have written:
Fahrenheit = 0*9/5+32;
Jason Luboff
@JLuboff
Jan 04 2017 00:45
@jv775 You need to remember that javascript is case-sensitive Celsius != celsius
jv775
@jv775
Jan 04 2017 00:45
fahreinheit = -30*9/5+32;
yes, fahrenheit = celsius
JLuboff
Zak
@zaksanderford
Jan 04 2017 00:46
@jv775 Instead of inputting numerical values, change the celsius temperature to a variable.
In the second example you provided replace -30 with a variable, specifically the one being passed in by the function (the bit in parentheses at the top of the code).
andercodder
@andercodder
Jan 04 2017 00:48
some one help me please
jv775
@jv775
Jan 04 2017 00:48
@zaksanderford ???
sorry, but I'm still new at this
Zak
@zaksanderford
Jan 04 2017 00:49
@jv775 An example of what your equation should look like var1 = (5 * var2) + 82
@jv775 var1 will be the variable you're trying to return and var2 will be the variable being operated on.
Camilo Silva Caviedes
@camilosilvac
Jan 04 2017 00:50
Hi!
jv775
@jv775
Jan 04 2017 00:51
@zaksanderford thanks, I am going to give it a try
CamperBot
@camperbot
Jan 04 2017 00:51
jv775 sends brownie points to @zaksanderford :sparkles: :thumbsup: :sparkles:
:cookie: 177 | @zaksanderford |http://www.freecodecamp.com/zaksanderford
jv775
@jv775
Jan 04 2017 00:52
To all in this room, thanks for your help guys, I really appreciate it
Zak
@zaksanderford
Jan 04 2017 00:52
@jv775, let me know what your outcome was.
Camilo Silva Caviedes
@camilosilvac
Jan 04 2017 00:53
can someone help me with the challange #145? please? :) it said that i have to use the "+" operator
i have this code

// Example
var myStr = "This is the start. " + "This is the end.";

// Only change code below this line

var myStr;

Stephen James
@sjames1958gm
Jan 04 2017 00:53
@greedylan toUpperCase is a function but you're are not calling it -
@camilosilvac Where is your code?
@camilosilvac Change the code below the comment that says only change below the comment
Camilo Silva Caviedes
@camilosilvac
Jan 04 2017 00:54
// Example
var myStr = "This is the start. " + "This is the end.";

// Only change code below this line

var myStr;
Christopher Richards
@way3edgyentertainment
Jan 04 2017 00:55
Same problem as @kmcrayton7
Camilo Silva Caviedes
@camilosilvac
Jan 04 2017 00:55
wow! i have to improve my english skills hahaha sorry! and thank you very much! @sjames1958gm
CamperBot
@camperbot
Jan 04 2017 00:55
camilosilvac sends brownie points to @sjames1958gm :sparkles: :thumbsup: :sparkles:
:star2: 5142 | @sjames1958gm |http://www.freecodecamp.com/sjames1958gm
Stephen James
@sjames1958gm
Jan 04 2017 00:57
@camilosilvac :+1:
Dylan Hsiao
@greedylan
Jan 04 2017 00:58
@sjames1958gm add the parenthesis but still not working
Christopher Richards
@way3edgyentertainment
Jan 04 2017 00:58
@kmcrayton7 Created a var for the removed item to return, then pushed in the item passed originally
Stephen James
@sjames1958gm
Jan 04 2017 00:59
@greedylan Failing all the tests? or only the upperCase one?
@way3edgyentertainment That is not correct - push the item then remove the first item @kmcrayton7
@greedylan Can you post first.
Kim Crayton
@kmcrayton7
Jan 04 2017 01:01
@greedylan but where does it go? The comments are not really helping me. I know if it's not exactly where they want it won't work
andercodder
@andercodder
Jan 04 2017 01:01
var myStr = "FirstLIne\n\SecondLine\ \rThirdLine"; // Change this line
Dylan Hsiao
@greedylan
Jan 04 2017 01:02
@sjames1958gm @kmcrayton7 @mitron6
function myReplace(str, before, after) {

  return str.replace(before, replaceIt);

  function replaceIt(){
    if(before[0] == before[0].toUpperCase()){
      return after[0].toUpperCase(); 
    }else if(before[0] == before.toLowerCase()){
      return after;
    }
  }
}

myReplace("A quick brown fox jumped over the lazy dog", "jumped", "leaped");
Stephen James
@sjames1958gm
Jan 04 2017 01:02
@andercodder There is a captial I in that should be i
andercodder
@andercodder
Jan 04 2017 01:02
guys i changed the code according to the question
Stephen James
@sjames1958gm
Jan 04 2017 01:02
@greedylan This returns one letter return after[0].toUpperCase();
andercodder
@andercodder
Jan 04 2017 01:03
but i get this error myStr should have encoded text with the proper escape sequences and no spacing.
@sjames1958gm i took theI
Stephen James
@sjames1958gm
Jan 04 2017 01:03
@andercodder I see at least one space in the string
Lorrie Pearson
@Lorrie01
Jan 04 2017 01:04
Woo hoo! Just finished the Card Count Challenge!
Stephen James
@sjames1958gm
Jan 04 2017 01:04
@Lorrie01 :+1:
@andercodder You should have six tottal \
andercodder
@andercodder
Jan 04 2017 01:04
ok
Dylan Hsiao
@greedylan
Jan 04 2017 01:04
@sjames1958gm it returns "undefined". I can certainly concat or splice into the whole word for var after
Lorrie Pearson
@Lorrie01
Jan 04 2017 01:04
thanks @sjames1958gm
CamperBot
@camperbot
Jan 04 2017 01:04
lorrie01 sends brownie points to @sjames1958gm :sparkles: :thumbsup: :sparkles:
:star2: 5143 | @sjames1958gm |http://www.freecodecamp.com/sjames1958gm
andercodder
@andercodder
Jan 04 2017 01:05
i will try it
Stephen James
@sjames1958gm
Jan 04 2017 01:05
@greedylan What tests are passing or failing?
Dylan Hsiao
@greedylan
Jan 04 2017 01:05
@sjames1958gm all tests are failing :) returns "undefined"
Fabio Andrade
@kaytesith
Jan 04 2017 01:07
Guys, I'm currently doing the profile lookup exercise on the site and I kinda got stuck on how to verify if a prop on the array is true or not
andercodder
@andercodder
Jan 04 2017 01:07
i have six \ i still got the error
Stephen James
@sjames1958gm
Jan 04 2017 01:07
@greedylan remove the if part of the else if -
@andercodder Can you post again?
andercodder
@andercodder
Jan 04 2017 01:08
var myStr = "FirstLine\n\SecondLine\ \rThirdLine"; // Change this line
Stephen James
@sjames1958gm
Jan 04 2017 01:09
@andercodder I see a space before \r
andercodder
@andercodder
Jan 04 2017 01:11
ok i got it
very thank you @sjames1958gm
CamperBot
@camperbot
Jan 04 2017 01:11
andercodder sends brownie points to @sjames1958gm :sparkles: :thumbsup: :sparkles:
:star2: 5144 | @sjames1958gm |http://www.freecodecamp.com/sjames1958gm
Stephen James
@sjames1958gm
Jan 04 2017 01:11
@andercodder :+1:
Jacob Peterman
@jdpeterman
Jan 04 2017 01:11
I'm stuck on an issue with my JS calculator. Every time I press a button, the whole keypad disappears. Any ideas? http://codepen.io/jpeterman/pen/rrGzmN
Connor
@cjmelnick
Jan 04 2017 01:12
import java.util.*;

public class countVowels {

    public static void main(String[] args) {
        //create a string to hold user input
        String input = "";
        int vowels = 0;

        //create scanner to accept user input
        System.out.println("Enter a string");
        @SuppressWarnings("resource")
        Scanner in = new Scanner(System.in);

        //set user input to variable input
        input = in.nextLine();

        int length = input.length();

        for (int i = length - 1; i >= 0; i --){
            String letter = Character.toString(input.charAt(i));
            System.out.println(letter);
            if (letter == "a"){
                vowels = vowels + 1;
            }
            System.out.println("There are " + vowels + " vowels in the string you provided");
        }
    }
}
Im trying to write a program that counts the number of vowels in a string. Why wont my if statement work? if i input the letter a it doesnt add 1 to the vowels
andercodder
@andercodder
Jan 04 2017 01:13
hoe do i send brownie points
Rebecca
@alimily
Jan 04 2017 01:13
help
help,please
Connor
@cjmelnick
Jan 04 2017 01:14
@andercodder just tag the person you want to thank and say "thank you"
CamperBot
@camperbot
Jan 04 2017 01:14
:cookie: 129 | @andercodder |http://www.freecodecamp.com/andercodder
cjmelnick sends brownie points to @andercodder :sparkles: :thumbsup: :sparkles:
Rebecca
@alimily
Jan 04 2017 01:14
myStr should have encoded text with the proper escape sequences and no spacing.
myStr should have one newline character \n
myStr should have one carriage return character \r
myStr should have two correctly escaped backslash characters \
and my answer is this var myStr="\FirstLine \t SecondLine \b gfdg \r gfg \n Th\";
why the answer is not right
andercodder
@andercodder
Jan 04 2017 01:15
@sjames1958gm thank you
CamperBot
@camperbot
Jan 04 2017 01:15
andercodder sends brownie points to @sjames1958gm :sparkles: :thumbsup: :sparkles:
:warning: andercodder already gave sjames1958gm points
Rebecca
@alimily
Jan 04 2017 01:15
what should i put down
Fabio Andrade
@kaytesith
Jan 04 2017 01:16
How do I verify if a property of an array exists or not, resulting in a boolean?
Rebecca
@alimily
Jan 04 2017 01:17
help
everyone
please,help me
Jie
@BEBEDYDY
Jan 04 2017 01:18
hasOwnProperty
Fabio Andrade
@kaytesith
Jan 04 2017 01:18
@BEBEDYDY tyvm (:
Rebecca
@alimily
Jan 04 2017 01:20
myStr should have encoded text with the proper escape sequences and no spacing.
myStr should have one newline character \n
myStr should have one carriage return character \r
myStr should have two correctly escaped backslash characters \
why i write code like this is wrong
var myStr="\FirstLine \t SecondLine \b gfdg \r gf
Q_zheng
@zhengbusinesscontact
Jan 04 2017 01:20
hey, guys, silly question. how to return a numerical variable in quote in Js. I want to return an output like "13 Hold" or "-5 Bet"
Rebecca
@alimily
Jan 04 2017 01:20
any one please help me
Jie
@BEBEDYDY
Jan 04 2017 01:21
yourArray.hasOwnProperty("property");//true or false if is true you can try to use typeof to find out
Tyler Collins
@tjscollins
Jan 04 2017 01:22

@zhengbusinesscontact

numberVariable + strVariable

Javascript will convert the number to a string for you.

@alimily
What are you trying to do?
Rebecca
@alimily
Jan 04 2017 01:24
myStr should have encoded text with the proper escape sequences and no spacing.
myStr should have one newline character \n
myStr should have one carriage return character \r
myStr should have two correctly escaped backslash characters \
Q_zheng
@zhengbusinesscontact
Jan 04 2017 01:24
@tjscollins for example: return count + "Hold"; //?
Rebecca
@alimily
Jan 04 2017 01:24
according this condition write some sentence
var myStr="\FirstLine \t SecondLine \b gfdg \r gf
Tyler Collins
@tjscollins
Jan 04 2017 01:25
@zhengbusinesscontact you probably want a space in " Hold", but yes.
Fabio Andrade
@kaytesith
Jan 04 2017 01:25
@BEBEDYDY yup, got it to work, thank you
CamperBot
@camperbot
Jan 04 2017 01:25
:cookie: 218 | @bebedydy |http://www.freecodecamp.com/bebedydy
kaytesith sends brownie points to @bebedydy :sparkles: :thumbsup: :sparkles:
Rebecca
@alimily
Jan 04 2017 01:25
var myStr="\FirstLine \t SecondLine \b gfdg \r gfg \n Th\";
i write this ,but is not ok
this is my code
Jie
@BEBEDYDY
Jan 04 2017 01:25
@kaytesith great.lol
Rebecca
@alimily
Jan 04 2017 01:25
@tjscollins
Jacob Peterman
@jdpeterman
Jan 04 2017 01:25
@alimily var myStr = "FirstLine\n\SecondLine\\rThirdLine";
Q_zheng
@zhengbusinesscontact
Jan 04 2017 01:26
@tjscollins TY!!!
CamperBot
@camperbot
Jan 04 2017 01:26
zhengbusinesscontact sends brownie points to @tjscollins :sparkles: :thumbsup: :sparkles:
:cookie: 331 | @tjscollins |http://www.freecodecamp.com/tjscollins
Tyler Collins
@tjscollins
Jan 04 2017 01:26
@alimily Jacob's answer looks like what you want

@alimily Except probably without the \ before the S

var myStr = "FirstLine\nSecondLine\\rThirdLine";

or something like that. I'm not sure what the problem is actually asking you based on what you put.

Jie
@BEBEDYDY
Jan 04 2017 01:28
C9A64996-EF1D-46B1-A558-DF0E1ED79A0A.png
@tjscollins hi, sorry to bothering you. but i really don't know who to ask. i tried to looking answer online but nobody tell me . why the return "No such contact " is out of the for loop as the image i just upload?
Tyler Collins
@tjscollins
Jan 04 2017 01:30
@BEBEDYDY Switch lines 43 and 44
Rebecca
@alimily
Jan 04 2017 01:30
@tjscollins @jdpeterman thank you very much
CamperBot
@camperbot
Jan 04 2017 01:30
alimily sends brownie points to @tjscollins and @jdpeterman :sparkles: :thumbsup: :sparkles:
:cookie: 327 | @jdpeterman |http://www.freecodecamp.com/jdpeterman
:cookie: 332 | @tjscollins |http://www.freecodecamp.com/tjscollins
Jie
@BEBEDYDY
Jan 04 2017 01:30
@tjscollins I knew the correct code but i dont understand why
Tyler Collins
@tjscollins
Jan 04 2017 01:31
@BEBEDYDY You close the for loop on line 43 with the }
Connor
@cjmelnick
Jan 04 2017 01:31
Can anyone help me with the code i previously posted above
Rebecca
@alimily
Jan 04 2017 01:31
@jdpeterman but i want to know is why it is \n\ \r,not my code like \n or \t
Tyler Collins
@tjscollins
Jan 04 2017 01:31
@BEBEDYDY Although, that doesn't look right, give me a second
Rebecca
@alimily
Jan 04 2017 01:31
why
Jie
@BEBEDYDY
Jan 04 2017 01:32
@tjscollins 1> yes, the correct code return "No such contact" should be outside of the for loop, is weird? why is not in the for loop which is after the first if statement? 2> contacts[i][prop] contacts[i].prop not the same?
Tyler Collins
@tjscollins
Jan 04 2017 01:33
@BEBEDYDY It needs to be outside the loop because otherwise you don't check every contact in the list. If you put it in the loop, you'll only check the first contact. The return statement breaks the for loop
Bryan Reese
@breese8009
Jan 04 2017 01:34
Whats up campers? im back
Jie
@BEBEDYDY
Jan 04 2017 01:36
oh i see !!!! got this part. 2> contacts[i][prop] and contacts[i].prop not the same?i checked some website told they are not the same... i confused. I remember array[i]===array.i right? but why here array[i][j] !==array[i].j ?
agustashd
@agustashd
Jan 04 2017 01:37
Hi, I'm currently on 'Using Objects for Lookups' challenge and getting a little confused as to why sometimes when writing a properti of an object with brackets theres ["propertieName"] or [propertieName] directly
Jie
@BEBEDYDY
Jan 04 2017 01:38
@breese8009 Is mess. a lot people need help. At least i know Im not the only one who needs help.
Fabio Andrade
@kaytesith
Jan 04 2017 01:38
@agustashd "propertieName" you are searching for the property using a string while propertieName without quotes is using a variable
HeebieGeeBee
@HeebieGeeBee
Jan 04 2017 01:39
$('#next-canvas').animate({opacity: '1'}, 1000ms); can anyone tell me why this is causing an illegal token error in codepen?
agustashd
@agustashd
Jan 04 2017 01:39
@kaytesith i see, thanks! And what about dot notation? I tired using that first and got an error
CamperBot
@camperbot
Jan 04 2017 01:39
agustashd sends brownie points to @kaytesith :sparkles: :thumbsup: :sparkles:
:cookie: 218 | @kaytesith |http://www.freecodecamp.com/kaytesith
Jie
@BEBEDYDY
Jan 04 2017 01:39
@agustashd Object["property"] or Object.property so if you use the first way you should put "" .
Fabio Andrade
@kaytesith
Jan 04 2017 01:40
@agustashd From what i've been seeing, we tend to use [] notations when we need to access info from a nested array or get a value from a variable
@agustashd While we use dot notation to simplify things... maybe? Still learning it right now :D
ADIL KARMOUZI
@mradil16
Jan 04 2017 01:42
Hi everyone. I included a small script to show and hide a dropdown menu, but even I wrote the code right the script refuse to run ( I used bootstrap navbar) , please check this pen : http://codepen.io/mradil16/pen/apbGPj
Tyler Collins
@tjscollins
Jan 04 2017 01:42

@BEBEDYDY You're confusing arrays with objects:

array[i][j]

looks for the jth element in the ith element in array.

array[i].j

looks for a property named "j" in the ith element in array

agustashd
@agustashd
Jan 04 2017 01:43
@kaytesith hehe i liked the dot notation thats why i tried using that and got nothing :smile: I'll stick to brackets for variables then
Tyler Collins
@tjscollins
Jan 04 2017 01:45
@agustashd Yes, if your property name is stored in a variable you have to use the brackets
HeebieGeeBee
@HeebieGeeBee
Jan 04 2017 01:45
@mradil16 whats your problem exactly? your drop down menus not showing?
Joseph
@revisualize
Jan 04 2017 01:48
Hello.
ADIL KARMOUZI
@mradil16
Jan 04 2017 01:48
@HeebieGeeBee the problem is : when I hover the "english" list Item the dropdown menu doesn't show up (the script I included supposed to show the menu on hover)
HeebieGeeBee
@HeebieGeeBee
Jan 04 2017 01:50
why did you hide it with the first bit of code?
Joseph
@revisualize
Jan 04 2017 01:50
Dot Notation is converting the value to a string (string literal). Example: myObj.name; is the same as myObj["name"]; and as we all know quotes define strings. If you want to use a variable for accessing the value of object properties you cannot use Dot Notation. You have to use Bracket Notation. Example: var num = 42; myObj[num];
HeebieGeeBee
@HeebieGeeBee
Jan 04 2017 01:51
not sure the effect you want but when i comment out this line // $(".navbar-nav > li > .dropdown-menu").css({visibility: "hidden"}); the drop down menus show when you hover over and dont when you leave them @mradil16
Joseph
@revisualize
Jan 04 2017 01:53
I know what it is.... I join and everyone runs away.
Everyone is all.. Damn it. That jerkface is back.
:P
Fabio Andrade
@kaytesith
Jan 04 2017 01:53
@revisualize Is it possible to use dot notations to define a property and a bracket notation afterwards ? Example myObj[num].property[num][num]
@revisualize Or is it considered bad practice?
HeebieGeeBee
@HeebieGeeBee
Jan 04 2017 01:54
maybe they just think they need to up their game with you around
karimpremji1990
@karimpremji1990
Jan 04 2017 01:54
i think in some cases you have to use bracket AND dot. like, if you're trying to access a property of an object with a space.
Joseph
@revisualize
Jan 04 2017 01:54
@kaytesith Yes.
@kaytesith You'd have a really complex object.
HeebieGeeBee
@HeebieGeeBee
Jan 04 2017 01:54
speaking of which
$('#next-canvas').animate({opacity: 1}, 200ms);
any idea why this is giving me an illegal token error?
Joseph
@revisualize
Jan 04 2017 01:55
@kaytesith It just matters the shape of your data / object.
Fabio Andrade
@kaytesith
Jan 04 2017 01:56
@revisualize Alright, I'm trying to understand everything thoroughly from start, so I don't miss on details that could help me
HeebieGeeBee
@HeebieGeeBee
Jan 04 2017 01:57
anyone? any ideas?
Joseph
@revisualize
Jan 04 2017 01:57
@kaytesith Why you would have 3 of the same properties in an object. I have no idea. But, yeah.. Just depends on the shape of your data.
Doegena Fennich
@Doegena
Jan 04 2017 01:57
@HeebieGeeBee try to remove ms
HeebieGeeBee
@HeebieGeeBee
Jan 04 2017 01:58
derp thanks
Fabio Andrade
@kaytesith
Jan 04 2017 01:58
@revisualize It's just that I was imagining a highly nested object, which I guess would be unnecessary?
Doegena Fennich
@Doegena
Jan 04 2017 01:58
:)
HeebieGeeBee
@HeebieGeeBee
Jan 04 2017 01:58
ty @Doegena
CamperBot
@camperbot
Jan 04 2017 01:58
heebiegeebee sends brownie points to @doegena :sparkles: :thumbsup: :sparkles:
:warning: could not find receiver for doegena
HeebieGeeBee
@HeebieGeeBee
Jan 04 2017 01:58
forget which language likes ms and doesnt
camperbot is getting really crap at finding ppl
Doegena Fennich
@Doegena
Jan 04 2017 01:59
@HeebieGeeBee Js only uses numbers so 100 = 200ms 1000 = 1000ms etc, np thanks anyways :)
CamperBot
@camperbot
Jan 04 2017 01:59
doegena sends brownie points to @heebiegeebee :sparkles: :thumbsup: :sparkles:
:cookie: 430 | @heebiegeebee |http://www.freecodecamp.com/heebiegeebee
HeebieGeeBee
@HeebieGeeBee
Jan 04 2017 02:00
lol thats just mean camperbot
ty @Doegena
CamperBot
@camperbot
Jan 04 2017 02:00
:warning: could not find receiver for doegena
heebiegeebee sends brownie points to @doegena :sparkles: :thumbsup: :sparkles:
Doegena Fennich
@Doegena
Jan 04 2017 02:00
lol
Ion Leahu
@forza11879
Jan 04 2017 02:00
hey guys ! i am stacked at JavaScript 153
Dylan Hsiao
@greedylan
Jan 04 2017 02:00

how do I return 'Sitting' with .splice()?

return 'sitting'.split("").splice(0, 1, 'sitting'[0].toUpperCase());

.splice(0, 1, "S"). index = 0 , remove "s", add "S"

Joseph
@revisualize
Jan 04 2017 02:01
@greedylan String Concatenation.
Dylan Hsiao
@greedylan
Jan 04 2017 02:02
@revisualize I was wondering why splice is not working here?
gant123
@gant123
Jan 04 2017 02:02

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

// Your code above this line
return result;
}

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

HeebieGeeBee
@HeebieGeeBee
Jan 04 2017 02:03
@gant123 thats not going to work
Joseph
@revisualize
Jan 04 2017 02:03
@gant123 Why are you overwriting your variables parameters?
gant123
@gant123
Jan 04 2017 02:04
im a littl confused on what they wanted. i need help with getting on the right path
HeebieGeeBee
@HeebieGeeBee
Jan 04 2017 02:04
how would you write a function that added all those strings together @gant123 ?
Doegena Fennich
@Doegena
Jan 04 2017 02:04
@gant123 result = "My " + myNoun ; result += " and is " + myAdjective you finish the rest
gant123
@gant123
Jan 04 2017 02:05
I was about to make this harder than what it was , thanks yall
Joseph
@revisualize
Jan 04 2017 02:05
@Doegena Do you know giving people solutions isn't going to actually help them learn?
HeebieGeeBee
@HeebieGeeBee
Jan 04 2017 02:05
remember to include spaces @gant123
BAXHA
@baxha
Jan 04 2017 02:05
how do i assign processArg to processed?
gant123
@gant123
Jan 04 2017 02:06
i kne@heebieGeeBee i will
Joseph
@revisualize
Jan 04 2017 02:06
@baxha How do you assign the value of 7 to a variable num? ... var num = 7;
@baxha How do you assign the value of x to a variable y? ... var y = x;
wlagos1992
@wlagos1992
Jan 04 2017 02:07

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

function checkObj(checkProp) {
  // Your Code Here
  myObj.hasOwnProperty("gift");

  return myObj[checkProp];

}

// Test your code by modifying these values
checkObj("bed");
I have it to return but how do i make it return when there is value?
ADIL KARMOUZI
@mradil16
Jan 04 2017 02:07
@HeebieGeeBee the dropdown menu doesn't work as expected . I don't know why the script refuse to run ? is this problem has something to do with bootstrap ?
Doegena Fennich
@Doegena
Jan 04 2017 02:07
@revisualize well, he now knows how it works so next time he most likely wont have the same problem. but i know what you're trying to say. cheers
BAXHA
@baxha
Jan 04 2017 02:09
@revisualize var processed = processArg ain;t correct
David
@SimbaKali
Jan 04 2017 02:10
I am having trouble with the "Global Scope and Functions" lesson. I am supposed to assign 5 to oopsGlobal without using the var keyword within the fun1 function, but its not accepted as correct
Ion Leahu
@forza11879
Jan 04 2017 02:10
@gant123

@gant123 function wordBlanks(myNoun, myAdjective, myVerb, myAdverb) {
var result = "";
// Your code below this line
result = "My " + myAdjective + " lovely " + myNoun + " funny " + myVerb + " wovely " + myAdverb ;

// Your code above this line
return result;
}

// Change the words here to test your function
wordBlanks("cat", "little", "hit", "slowly");

wlagos1992
@wlagos1992
Jan 04 2017 02:10
when there is no value**
HeebieGeeBee
@HeebieGeeBee
Jan 04 2017 02:11
@mradil16 it runs fine for me and looks like i would expect it to look if you just get rid of the first bit of code in javascript,
but i dont know what else you want apart from the drop down menu dropping down when you hover over and going away when you leave it with the mouse
Joseph
@revisualize
Jan 04 2017 02:13
Studies have shown that giving people answers to problems instills an illusionary sense of learning. Because, it only puts information into short-term memory. Of which people think they are learning. Only through a little struggle and repetition that the human brain puts things into long-term memory. I don't know what your end goal. I don't know if you want to do this as a personal project, hobby, or if you want to move into industry. Because of this, I strongly feel that working with people to allow them to solve problems on their own is a far better outcome than giving away answers. But, others clearly don't agree with my methods for helping people learn.
@baxha I'm sorry. I don't know then. I don't know what lesson you're working on.
Jie
@BEBEDYDY
Jan 04 2017 02:14
@tjscollins I looked your answer again and again, I think I finally got it. haha.💗 object.j this j means a property named j , same as object["j"] ,which in this case array[i][j] means array[i]'s jth property, this j is a variable not a property name. So array[i]["j"] ===array[i].j which are not equal to array[i][j] . hahahaha Thank you.
CamperBot
@camperbot
Jan 04 2017 02:14
bebedydy sends brownie points to @tjscollins :sparkles: :thumbsup: :sparkles:
:cookie: 333 | @tjscollins |http://www.freecodecamp.com/tjscollins
gant123
@gant123
Jan 04 2017 02:15
@forza11879 Thanks i got it. i cleaned what i had :)
CamperBot
@camperbot
Jan 04 2017 02:15
gant123 sends brownie points to @forza11879 :sparkles: :thumbsup: :sparkles:
:warning: could not find receiver for forza11879
BAXHA
@baxha
Jan 04 2017 02:15
@revisualize if you give answers to people then they can practice it and use the time they would figure the answer to actuaclly practice it, and the reason i lack at this stage is because i havent learned variables yet and i actually suck at english , therefore i ask for help, thx :)
CamperBot
@camperbot
Jan 04 2017 02:15
baxha sends brownie points to @revisualize :sparkles: :thumbsup: :sparkles:
:star2: 2815 | @revisualize |http://www.freecodecamp.com/revisualize
Joseph
@revisualize
Jan 04 2017 02:16
@baxha Honestly, how many people do you think really "practice" after you give them an answer?
@baxha Humans are lazy.
The brain is lazy.
nicknoel251289
@nicknoel251289
Jan 04 2017 02:16
that's a generalized statement
Joseph
@revisualize
Jan 04 2017 02:17
Generalized to the masses.
BAXHA
@baxha
Jan 04 2017 02:18
@revisualize you cannot choose the other's decisions, you give them the help, its their duty to choose whether they want to succeed or to lie themselves.
nicknoel251289
@nicknoel251289
Jan 04 2017 02:18
As long as YOU know that your comment is generalized. State humans are lazy as a whole is ignorant.
Joseph
@revisualize
Jan 04 2017 02:19
@nicknoel251289 I don't agree. I know that my statement is generalized to the masses.
Stating humans are lazy is going to the 90%. If only 5 to 10% of people are not lazy. It isn't a reflection on the human race as a whole.
There are people out there that work harder than I ever will.
Work 18 hour days every day.
ZOE
@ZOEGITHUB
Jan 04 2017 02:20
array[i][0]=array[i][0].toUpperCase();//reprot a type error
array[i] = array[i][0].toUpperCase() + array[i].substring(1);//turn out to be right.why??
Joseph
@revisualize
Jan 04 2017 02:20
Should be compare the human race to those people?
No.
Mar Bocatcat
@Marbocatcat
Jan 04 2017 02:20
do you guys see anything wrong with my code?
it keeps comming out as null
in line 7
Joseph
@revisualize
Jan 04 2017 02:21
@ZOEGITHUB Strings are immutable?
BAXHA
@baxha
Jan 04 2017 02:21
what do you define with "lazy" @revisualize
Mar Bocatcat
@Marbocatcat
Jan 04 2017 02:21

var leftHand = document.querySelector('.wrapper');
leftHand.style.display = "none";

function slideOut(){
  var wrap = document.querySelector('.wrapper');
  wrap.style.animation = "slideOut 1s ease-in-out 1";
  wrap.style.display = "flex";
}

setTimeout(slideOut, 3000);
leftHand.style.display = "none"; keeps coming out as null
Joseph
@revisualize
Jan 04 2017 02:21
@baxha Depends on the context.
@baxha In this context of learning web development. I'd say someone that just goes through the lessons copying and pasting and not actually learning why they're doing something.
@baxha If I see someone working on one of the challenges and I ask them a simple question about a previous challenge that relates to what they're working on... And they can't answer it. I have to assume that they were lazy and didn't learn the material from the previous lesson.
@baxha But still...
@baxha You haven't told me which lesson you're working on.
ZOE
@ZOEGITHUB
Jan 04 2017 02:27

function titleCase(str) {
var array=str.toLowerCase().split(" ");
for (i=0;i<array.length;i++){
// array[i][0]=array[i][0].toUpperCase();
array[i] = array[i][0].toUpperCase() + array[i].substring(1);
}
var string=array.join(" ");
return string;
}

titleCase("I'm a little tea pot");
//it should return to be "I'm A Little Tea Pot"@Joseph

@revisualize
Cory
@CoryThePresby
Jan 04 2017 02:28
Hey, I need help. I'm having difficulty understanding what I need to do for Challenge 173.
eeflores
@eeflores
Jan 04 2017 02:28
@Marbocatcat how are you testing the value of leftHand.style.display?
@Marbocatcat maybe you could put the line console.log(leftHand.style.display); after the assignment to check the value
Joseph
@revisualize
Jan 04 2017 02:30
@ZOEGITHUB You're not declaring var i = 0;
@CoryThePresby Challenges don't have numbers. So.... What's the name of the challenge.
Mar Bocatcat
@Marbocatcat
Jan 04 2017 02:31
@eeflores hey Erwin , i tested it using the console browser
Idowu Ogedengbe
@idowuogedengbe
Jan 04 2017 02:31
@revisualize please am I on the right track

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

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

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

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

var Bike = function() {

// Only change code below this line.
var gear=2;
this.getGear=function()
{
return gear;
};
this.setGear=function(gear){
gear +=gear;
};

};

var myCar = new Car();

var myBike = new Bike();

Mar Bocatcat
@Marbocatcat
Jan 04 2017 02:31
@eeflores the value return as null , im not sure why
ZOE
@ZOEGITHUB
Jan 04 2017 02:31
for (var i=0;i<array.length;i++) return the same
Cory
@CoryThePresby
Jan 04 2017 02:32
@revisualize "Stand in Line"
Joseph
@revisualize
Jan 04 2017 02:32
@ZOEGITHUB Not when I ran it.
Mar Bocatcat
@Marbocatcat
Jan 04 2017 02:32
@eeflores i even type the logic in the browser console and it worked
Doegena Fennich
@Doegena
Jan 04 2017 02:32
@revisualize well, depends on the difficulty of the question, if its like "make a slideshow on your own" and you dont know anything about Js then yeah the person will not learn anything by copy and pasting, that i agree with you completely. but questions like "make a sentence and shorten the code with +=" is quite easy to understand even if you dont know anything of Js.
eeflores
@eeflores
Jan 04 2017 02:32
@Marbocatcat I copy/pasta your code into chrome console - I'm getting an error
Joseph
@revisualize
Jan 04 2017 02:33
@ZOEGITHUB The only change that I made was that I added var in front of your i and I solved the challenge.
Mar Bocatcat
@Marbocatcat
Jan 04 2017 02:33
@eeflores what are you getting
Joseph
@revisualize
Jan 04 2017 02:33
@CoryThePresby What's your function?
Dilip Kumar Joshi
@DILIPKUMARJOSHI
Jan 04 2017 02:33

var myStr = "This is the start. " + "This is the end.";

whats wrong in this code

Joseph
@revisualize
Jan 04 2017 02:33
@Doegena Can I PM you?
eeflores
@eeflores
Jan 04 2017 02:33
@Marbocatcat cannot read property 'style' of null at anonymous ...
Idowu Ogedengbe
@idowuogedengbe
Jan 04 2017 02:34

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

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

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

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

var Bike = function() {

// Only change code below this line.
var gear=2;
this.getGear=function()
{
return gear;
};
this.setGear=function(gear){
gear +=gear;
};

};

var myCar = new Car();

var myBike = new Bike();

Dilip Kumar Joshi
@DILIPKUMARJOSHI
Jan 04 2017 02:34

var myStr = "This is the start. " + "This is the end.";

whats wrong in this code Eror : myStr should have a value of This is the start. This is the end.

Mar Bocatcat
@Marbocatcat
Jan 04 2017 02:34
@eeflores yup thats what im confused about
eeflores
@eeflores
Jan 04 2017 02:34
@Marbocatcat am guessing document.querySelector() for me is returning null
Doegena Fennich
@Doegena
Jan 04 2017 02:34
@revisualize sure
Cory
@CoryThePresby
Jan 04 2017 02:34

@revisualize

function nextInLine(arr, item) {

return item;
}

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

Mar Bocatcat
@Marbocatcat
Jan 04 2017 02:35
@eeflores yup im not sure why thats happening , i have the same method inside a functino and it works fine
Mark Wartman
@markwartman1
Jan 04 2017 02:35
Hello, I'm stuck on Reverse a String. My lower for loop will not iterate the full length of the array. Does anyone know why? Thanks!
function reverseString(str) {

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

   var revString = "";
/*  The proble with the code below
is that it will only itterate 3 times
why?

*/
//   for (j = 0; j< arr.length; j++){
//     revString += arr.pop(); 
//   }


  return arr;
}

reverseString("hello");
Joseph
@revisualize
Jan 04 2017 02:35
@CoryThePresby
How do you add a number (item) to the end of an array (arr)? What does this method return?
How do you remove the first element from an array (arr)? What does this method return?
ZOE
@ZOEGITHUB
Jan 04 2017 02:35
array[i][0]=array[i][0].toUpperCase();//use this in for loop, u cannot solve,and report a error
array[i] = array[i][0].toUpperCase() + array[i].substring(1);//but this can.
eeflores
@eeflores
Jan 04 2017 02:36
@Marbocatcat I do this in the console: console.log(document.querySelector(".wrapper")) and get null
Dilip Kumar Joshi
@DILIPKUMARJOSHI
Jan 04 2017 02:36
Help somebody
CamperBot
@camperbot
Jan 04 2017 02:36
no wiki entry for: somebody
ZOE
@ZOEGITHUB
Jan 04 2017 02:36
i can't understand the different @revisualize
Idowu Ogedengbe
@idowuogedengbe
Jan 04 2017 02:36
@revisualize can you pls help me out

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

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

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

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

var Bike = function() {

// Only change code below this line.
var gear=2;
this.getGear=function()
{
return gear;
};
this.setGear=function(gear){
gear +=gear;
};

};

var myCar = new Car();

var myBike = new Bike();

eeflores
@eeflores
Jan 04 2017 02:37
@Marbocatcat so I guess in the scope of the browser console, .wrapper doesn't exist
BAXHA
@baxha
Jan 04 2017 02:37
@revisualize oh sry didn't understand what u said challenge is at front end dev, called assignment with a returned value
Joseph
@revisualize
Jan 04 2017 02:37
@ZOEGITHUB All I did was copy and paste your code and add var in front of the i.
Dilip Kumar Joshi
@DILIPKUMARJOSHI
Jan 04 2017 02:37

// Example
var ourStr = "I come first. " + "I come second.";

// Only change code below this line
var myStr = "This is the start. " + "This is the end.";

error: myStr should have a value of This is the start. This is the end.
eeflores
@eeflores
Jan 04 2017 02:38
@Marbocatcat I'm guessing you have that code within a function that is defined in a page, and there's an HTML element using the ".wrapper" class and that's being selected
Dilip Kumar Joshi
@DILIPKUMARJOSHI
Jan 04 2017 02:38
help whats wrong in this pls
CamperBot
@camperbot
Jan 04 2017 02:38
no wiki entry for: whats wrong in this pls
Joseph
@revisualize
Jan 04 2017 02:38
@ZOEGITHUB See:
blob
ZOE
@ZOEGITHUB
Jan 04 2017 02:39
because the wrong one was behind '//' @revisualize
Joseph
@revisualize
Jan 04 2017 02:39
@ZOEGITHUB That's a comment. It doesn't get parsed.
@CoryThePresby Are you still here?
eeflores
@eeflores
Jan 04 2017 02:40
@idowuogedengbe this.gear = gear;
ZOE
@ZOEGITHUB
Jan 04 2017 02:40
array[i][0]=array[i][0].toUpperCase(); why this one is a comment??
wlagos1992
@wlagos1992
Jan 04 2017 02:41
the goal is to return "not found" if i search a query that doesnt exist, i feel like i did something similar in the past can anyone help??

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

function checkObj(checkProp) {
  // Your Code Here
  myObj.hasOwnProperty("gift");

  return myObj[checkProp];

}

// Test your code by modifying these values
checkObj("bed");
lh15
@lh15
Jan 04 2017 02:41
Any tips on tackling the roman numeral challenge?
eeflores
@eeflores
Jan 04 2017 02:42
@DILIPKUMARJOSHI I just tried the challenge - works for me
@DILIPKUMARJOSHI copied from the challenge: var myStr = "This is the start. " + "This is the end.";
ZOE
@ZOEGITHUB
Jan 04 2017 02:42
i mean why i wrote" array[i][0]=array[i][0].toUpperCase();" i reported a type error, while " array[i] = array[i][0].toUpperCase() + array[i].substring(1);" doesn't.
Joseph
@revisualize
Jan 04 2017 02:43
@ZOEGITHUB Strings are Immutable.
You have to completely reassign the string or create a new string.
ZOE
@ZOEGITHUB
Jan 04 2017 02:44
but i had split it into an array
haider
@candh
Jan 04 2017 02:44
hey whats up guys
Joseph
@revisualize
Jan 04 2017 02:44
@ZOEGITHUB The array element is still a string.
Dilip Kumar Joshi
@DILIPKUMARJOSHI
Jan 04 2017 02:45
@eeflores okay i tried but its not passing,its giving this error: myStr should have a value of This is the start. This is the end.
Idowu Ogedengbe
@idowuogedengbe
Jan 04 2017 02:46
@eeflores aftersetting the private property this.gear=gear; still not working
Joseph
@revisualize
Jan 04 2017 02:46
@wlagos1992 .hasOwnProperty() returns a boolean.
Mar Bocatcat
@Marbocatcat
Jan 04 2017 02:47
how do you hide div using vanilla javascript?
eeflores
@eeflores
Jan 04 2017 02:47
@idowuogedengbe what error are you getting?
Mar Bocatcat
@Marbocatcat
Jan 04 2017 02:47
is this code correct?
var hide = document.querySelector('.div');
hide.style.display = "none";
would above work to hide an object?
eeflores
@eeflores
Jan 04 2017 02:49
Idowu Ogedengbe
@idowuogedengbe
Jan 04 2017 02:49

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

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

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

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

var Bike = function() {

// Only change code below this line.
//var gear=10;
this.gear=gear;
this.getGear=function()
{
return gear;
};
this.setGear=function(gear){
gear +=gear;
};

};

var myCar = new Car();

var myBike = new Bike();

gear is not defined
Mar Bocatcat
@Marbocatcat
Jan 04 2017 02:49
@eeflores that also says "null" :( not really sure what im doing wrong
wlagos1992
@wlagos1992
Jan 04 2017 02:49
@revisualize i get that but i dont get how to use that function
eeflores
@eeflores
Jan 04 2017 02:50
@idowuogedengbe the original var gear = 10 is probably right. Put the this.gear = gear within the setGear function
Idowu Ogedengbe
@idowuogedengbe
Jan 04 2017 02:50
@eeflores gear is not defined
eeflores
@eeflores
Jan 04 2017 02:50
@idowuogedengbe replace the gear += gear line
Joseph
@revisualize
Jan 04 2017 02:50
@wlagos1992 What's a boolean value?
eeflores
@eeflores
Jan 04 2017 02:51
@Marbocatcat maybe instead of .div (which is trying to select a class) it should just be div?
Joseph
@revisualize
Jan 04 2017 02:52
@wlagos1992
Modify the function checkObj to test myObj for checkProp. If the property is found, return that property's value. If not, return "Not Found".
wlagos1992
@wlagos1992
Jan 04 2017 02:52
@revisualize means built in true or false
Joseph
@revisualize
Jan 04 2017 02:52
@wlagos1992 Great.
eeflores
@eeflores
Jan 04 2017 02:52
@Marbocatcat maybe that would hide all divs
Joseph
@revisualize
Jan 04 2017 02:53
@wlagos1992 Those are the instructions, maybe you should read them again? Because you know if and all.
eeflores
@eeflores
Jan 04 2017 02:53
@Marbocatcat what you may want to try to do is to target class elements (with the preceding dot notation) or id elements (with the preceding hash notation)
Ahm98
@Ahm98
Jan 04 2017 02:54
var madLibs = "Once upon a time, there was a " + myNoun + "that was really " + myAdjective + "and his owner " + myVerb + "into a University way too" + myAdverb;
Sorry but would anyone be able to tell me why that turns up a blank string for the Word Blanks challenge?
wlagos1992
@wlagos1992
Jan 04 2017 02:54
@revisualize i think im at the end of my day i cant rememeber how to check if it found a value and i am sure it went over that,
Maryna Nogtieva
@MarynaNogtieva
Jan 04 2017 02:54

Hello everyone

I'm working on twitchTV API project from FreeCodeCamp

when I reload the page, the status and the game of any 2 useers are displayed as undefined.
Please help me to figure out the reason.
Here is my code

$(document).ready(function(){
var channelArr = ["ESL_SC2",  "cretetion", "freecodecamp", "storbeck", "habathcx",  "noobs2ninjas","brunofin","comster404"];

function getUrl(type,channel){
  var url ='https://wind-bow.gomix.me/twitch-api/' + type + '/'      +channel + '?callback=?';
    return url;
}

function getAllurls(){
  channelArr.forEach(function(el,i){
     var status, game, channelName=el;
    var  preview,stream;
      var html ="";
  $.getJSON(getUrl("streams",el),function(data){
     //console.log(data);

     status= typeof status==="undefined" ? "offline" : status;
      game= typeof game==="undefined" ? "offline" : game;
   // var status, game;
    if(data.stream==null){
       status="Offline";
       game ="";
    }

    else{
      game = data.stream.game;
      status = "online";
      preview='<img srs="'+data.stream.preview.large.slice(6)+'"/>';
    }

    });
    var getTwitchInfo = function(){

    }
    $.getJSON(getUrl("channels",el),function(data){
   console.log(data);

      var error = data.error !=null ? data.error : " ";
      if (error !=" "){
        status="";
        game="";
      }
      var logo = data.logo != null ? data.logo : 'http://yf-personaltraining.ch/wp-content/uploads/2016/03/blank-profile.jpg';
      html+='<div class="row" style=" border-bottom:1px solid           blue;">';
      html+='<a target="_blank" href="https://www.twitch.tv/'+channelName+'">';
      html+='<div class="col-md-2 img">';
      html+='<img src="'+logo+'" /> <br/>';
      html+='</div>';//end of cokl-md-2
        html+='</a>';
      html+='<div class="col-md-8 ">';
      html+='<p>'+channelName+'  ' +status+ ' ' + game + '</p>';
      html+='<p>'+error+'</p>';
      html+='</div>';//end of cokl-md-8
      html+='<div class="col-md-2 ">';
      html+='</div>';//end of cokl-md-2

       html+='</div>';//end of row

      $("#info").append(html);
    });


  });

};


 getAllurls();


});
and this is my codepen page http://codepen.io/MarynaNight/pen/Roegdq
Joseph
@revisualize
Jan 04 2017 02:55
@wlagos1992 Yeah, it's called an if statement.
eeflores
@eeflores
Jan 04 2017 02:55
@Ahm98 with your strings, put a space at the beginning and end
Joseph
@revisualize
Jan 04 2017 02:55
@MarynaNogtieva Get help on our basic JavaScript and Algorithms Challenges. If you are posting code that is large use Gist - https://gist.github.com/ paste the link here.
eeflores
@eeflores
Jan 04 2017 02:56
@Ahm98 eg. " this is a " + myVerb + " and blah blah " etc
Maryna Nogtieva
@MarynaNogtieva
Jan 04 2017 02:56
@revisualize Thank you
wlagos1992
@wlagos1992
Jan 04 2017 02:56
so how do i say if its not true?
if false Return "Not Found"?
CamperBot
@camperbot
Jan 04 2017 02:56
:star2: 2817 | @revisualize |http://www.freecodecamp.com/revisualize
marynanogtieva sends brownie points to @revisualize :sparkles: :thumbsup: :sparkles:
Joseph
@revisualize
Jan 04 2017 02:57
@wlagos1992 if / else ?
Ahm98
@Ahm98
Jan 04 2017 02:58
@eeflores it looks like the result is still turning out blank after doing that
wlagos1992
@wlagos1992
Jan 04 2017 02:58
I am using an if else but it is giving me Red x's
Mar Bocatcat
@Marbocatcat
Jan 04 2017 02:59
@eeflores thanks man i think thers just something wrong with my link page to my external js
CamperBot
@camperbot
Jan 04 2017 02:59
marbocatcat sends brownie points to @eeflores :sparkles: :thumbsup: :sparkles:
:cookie: 890 | @eeflores |http://www.freecodecamp.com/eeflores
Mar Bocatcat
@Marbocatcat
Jan 04 2017 02:59
@eeflores when i did it on my index.html and putting it under <script></script> it works
eeflores
@eeflores
Jan 04 2017 03:00
cool bananas @Marbocatcat
@Ahm98 what's the challenge name?
Dylan Hsiao
@greedylan
Jan 04 2017 03:00
how do we check if the first letter of given str a vowel?? charAt? str[0]? and how to define RegEx?
var vowels = /[aeiou]/gi
Nitivat Voraditee
@Nicstrendy
Jan 04 2017 03:00

I'm stuck at "Stand in Line" in basic JS

can't complete this one

After nextInLine(testArr, 10), testArr[4] should be 10

Ahm98
@Ahm98
Jan 04 2017 03:01
@eeflores it's "Word Blanks"
Joseph
@revisualize
Jan 04 2017 03:01
@greedylan Regexp
Dylan Hsiao
@greedylan
Jan 04 2017 03:01
var vowels = /[aeiou]/gi;

  if(str.charAt(0) == vowels){
    return true;
  }
@revisualize
eeflores
@eeflores
Jan 04 2017 03:01
@Ahm98 looks like you need to assign your string to result
Mar Bocatcat
@Marbocatcat
Jan 04 2017 03:02
@eeflores do i need to put a <script></script> tag on my external js?
Idowu Ogedengbe
@idowuogedengbe
Jan 04 2017 03:02
@eeflores always get value 10
Joseph
@revisualize
Jan 04 2017 03:02
@greedylan Regexp
Ahm98
@Ahm98
Jan 04 2017 03:02
@eeflores That was it! Thank you :)
CamperBot
@camperbot
Jan 04 2017 03:02
ahm98 sends brownie points to @eeflores :sparkles: :thumbsup: :sparkles:
:cookie: 891 | @eeflores |http://www.freecodecamp.com/eeflores
Mar Bocatcat
@Marbocatcat
Jan 04 2017 03:02
@eeflores im not using jquery or anyting like that and the link page seems to be accurate , im just not sure whats up
eeflores
@eeflores
Jan 04 2017 03:02
@Ahm98 or return your created var madLibs
wlagos1992
@wlagos1992
Jan 04 2017 03:02

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

function checkObj(checkProp) {
  // Your Code Here
  myObj.hasOwnProperty("gift");
 if (checkProp) {
  return myObj[checkProp];

}
   return "Not Found";
}
// Test your code by modifying these values
checkObj("bennd");
eeflores
@eeflores
Jan 04 2017 03:03
@idowuogedengbe so your code should look like this:
var Bike = function() {
// Only change code below this line.
var gear=10;

this.getGear=function()
{
return gear;
};
this.setGear=function(gear){
this.gear=gear;
};
};
(unless there's some ambiguity around this.gear and gear)
Ken Haduch
@khaduch
Jan 04 2017 03:05
@wlagos1992 - what is your code doing as far as the tests passing or failing?
Hasan
@MHAhmed
Jan 04 2017 03:05
can someone please explain to me when using regular expression selectors... what we use /\S+/g; counts only the number of words in a string but if we get rid of the + it counts the number of non-white space characters?
wlagos1992
@wlagos1992
Jan 04 2017 03:05
@khaduch its coming up blank its not logging i know its within the return part
Draidel
@Draidel
Jan 04 2017 03:06
Hello, I have a simple question but its about PHP, anyone could help me on that ?
Dominic Jones
@dhjfoodstech
Jan 04 2017 03:06
I'm on the Java part of free code camp, I'm doing the challeges, but don't really understand the whys of what i'm doing
Ken Haduch
@khaduch
Jan 04 2017 03:06
@Draidel - I might be able to, if I'm not too rusty on my PHP
wlagos1992
@wlagos1992
Jan 04 2017 03:07
@dhjfoodstech youll get used to it, sometimes its a bit vague
Ken Haduch
@khaduch
Jan 04 2017 03:07
@wlagos1992 - what is checkProp, and what do you think happens when you test it with if (checkProp)
Dominic Jones
@dhjfoodstech
Jan 04 2017 03:08
@wlagos1992 ok, thats just what i needed to know lol
Joseph
@revisualize
Jan 04 2017 03:08
@wlagos1992 .hasOwnProperty() returns a boolean.
@wlagos1992
Modify the function checkObj to test myObj for checkProp. If the property is found, return that property's value. If not, return "Not Found".
Stephen James
@sjames1958gm
Jan 04 2017 03:09
@MHAhmed because the + means match 1 or more of the previous character. With the + consecutive non-whitespace characters are matched as a whole not individually
lh15
@lh15
Jan 04 2017 03:10

function titleCase(str) {
  var strLC = str.toLowerCase();
  var strTitle = strLC.split(" ");
  var strTitleCase;
  for(var i = 0; i < strTitle.length; i++){
    strTitleCase = strTitle[i][0].toUpperCase();
  }
  return strTitleCase;
}

titleCase("sHoRt AnD sToUt");
Draidel
@Draidel
Jan 04 2017 03:10
@khaduch :) So I am uploading multiple files and this should return the number on it (thats not the main goal but i am stuck there), for example, if you upload HELLO25.jpg you should see 25
@khaduch but it says "array" however its not...
eeflores
@eeflores
Jan 04 2017 03:11
@lh15 maybe start by declaring var strTitleCase = "";
Stephen James
@sjames1958gm
Jan 04 2017 03:11
@lh15 That code will only return the first letter of the last word in upperCase()
Draidel
@Draidel
Jan 04 2017 03:11
@khaduch preg_match_all('#(\d+)#', $_FILES['archivos']['name'][1], $ancho); echo("<br>ancho: " . $ancho[0]);
eeflores
@eeflores
Jan 04 2017 03:11
@lh15 then concat by strTitleCase +=
Stephen James
@sjames1958gm
Jan 04 2017 03:11
@lh15 When you are in a loop you need to build up the result not use simple assignment
eeflores
@eeflores
Jan 04 2017 03:12
@lh15 I think use splice/split right?
Idowu Ogedengbe
@idowuogedengbe
Jan 04 2017 03:12
 var Bike = function() {

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

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

      };
};
Hasan
@MHAhmed
Jan 04 2017 03:13
@sjames1958gm if + means match 1 or more of the previous character i thought it would mean it would count the same character more than one times example "and" with the + it would count 3 and without the plus it would count 1 ? thats why i am confused
Stephen James
@sjames1958gm
Jan 04 2017 03:13
@MHAhmed with the + and is counted as one match - without the + it is counted as three matches a and n and d
hariharanguru83
@hariharanguru83
Jan 04 2017 03:14
function randomRange(myMin, myMax) {

  return math.floor(Math.random() * (myMax - myMin + 1)) + myMin; // Change this line

}
Stephen James
@sjames1958gm
Jan 04 2017 03:14
@hariharanguru83 Math not math
Idowu Ogedengbe
@idowuogedengbe
Jan 04 2017 03:14

@eeflores still not working```var Bike = function() {

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

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

}; ```

Hasan
@MHAhmed
Jan 04 2017 03:14
@sjames1958gm okay ty
CamperBot
@camperbot
Jan 04 2017 03:14
mhahmed sends brownie points to @sjames1958gm :sparkles: :thumbsup: :sparkles:
:star2: 5145 | @sjames1958gm |http://www.freecodecamp.com/sjames1958gm
Ken Haduch
@khaduch
Jan 04 2017 03:14

@Draidel - preg_match_all does this:

Searches subject for all matches to the regular expression given in pattern and puts them in matches in the order specified by flags

matches is the third argument and it should be an array - so I don't know if that's what you are seeing for the message? That you have to provide an array?

Nitivat Voraditee
@Nicstrendy
Jan 04 2017 03:14
K, got it
Idowu Ogedengbe
@idowuogedengbe
Jan 04 2017 03:15

``` var Bike = function() {

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

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

};```

Stephen James
@sjames1958gm
Jan 04 2017 03:15
@idowuogedengbe the parameter to setGear cannot be gear because you have to set gear inside of setGear
eeflores
@eeflores
Jan 04 2017 03:15
@idowuogedengbe maybe
this.setGear = function(newGear) {
  this.gear = newGear;
}
@idowuogedengbe what's the error?
@idowuogedengbe which challenge?
wlagos1992
@wlagos1992
Jan 04 2017 03:15

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

function checkObj(checkProp) {
  // Your Code Here

 if (checkProp.hasOwnProperty) 
   return myObj[checkProp];


  else return "Not Found";
}
// Test your code by modifying these values
checkObj("beddd");
okay i got the first half to work now the if not found is not working, sorry im slow
Stephen James
@sjames1958gm
Jan 04 2017 03:15
@idowuogedengbe But not this.gear = newGear it should be gear = newGear
hariharanguru83
@hariharanguru83
Jan 04 2017 03:15
thanks @sjames1958gm
CamperBot
@camperbot
Jan 04 2017 03:15
:star2: 5146 | @sjames1958gm |http://www.freecodecamp.com/sjames1958gm
hariharanguru83 sends brownie points to @sjames1958gm :sparkles: :thumbsup: :sparkles:
Ken Haduch
@khaduch
Jan 04 2017 03:16
@Draidel - or it will store it as an array of strings
haider
@candh
Jan 04 2017 03:16
anybody want any help lol
Draidel
@Draidel
Jan 04 2017 03:16
@khaduch yes so $ancho is an array, then $ancho[0] should be the result i am looking for
lh15
@lh15
Jan 04 2017 03:16
thanks @eeflores @sjames1958gm
CamperBot
@camperbot
Jan 04 2017 03:16
:cookie: 892 | @eeflores |http://www.freecodecamp.com/eeflores
:star2: 5147 | @sjames1958gm |http://www.freecodecamp.com/sjames1958gm
lh15 sends brownie points to @eeflores and @sjames1958gm :sparkles: :thumbsup: :sparkles:
jayisray
@jayisray
Jan 04 2017 03:17
Finally finished my WikipediaViewer :D (Without mobile responsive design lol) Can someone critique please?
Draidel
@Draidel
Jan 04 2017 03:17
@khaduch OMG, wait a minute $ancho[0][0] worked ! does that make sense?
Joseph
@revisualize
Jan 04 2017 03:17
@wlagos1992 Why did you go from myObj.hasOwnProperty("gift"); to checkProp.hasOwnProperty ??
Idowu Ogedengbe
@idowuogedengbe
Jan 04 2017 03:18

``` var Bike = function() {

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

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

};
```

eeflores
@eeflores
Jan 04 2017 03:18
@idowuogedengbe function parameter to setGear should be newGear
AliFox15
@AliFox15
Jan 04 2017 03:18
Hi,I just stuck at challenge "Word Blanks",I am not sure what exactly it want me to do,I added the following sentece to the function wordBlanks(),and it doesn't seem right.
result=myAdjective+myNoun +myVerb +myAdverb;
Hasan
@MHAhmed
Jan 04 2017 03:18
when writing JS objects whats the difference between saying engines: 1, and "engines": 1, is the first one assigning the value to a variable and the second one is assigning it to a string?
eeflores
@eeflores
Jan 04 2017 03:18
@idowuogedengbe this.setGear = function(newGear) {
John Calhoun
@DougCal
Jan 04 2017 03:19
@darkflikk Thanks! It's working well now!
CamperBot
@camperbot
Jan 04 2017 03:19
dougcal sends brownie points to @darkflikk :sparkles: :thumbsup: :sparkles:
:cookie: 241 | @darkflikk |http://www.freecodecamp.com/darkflikk
Dylan Hsiao
@greedylan
Jan 04 2017 03:19
anyone has a clue how to use Regex to check if the first letter of a given string a vowel?
var vowels = /[aeiou]/g;
var str = "apple";
Joseph
@revisualize
Jan 04 2017 03:20
@AliFox15 Dopeoplewritelikethis?
I don't think people write like that. Maybe you should add some spaces?
Idowu Ogedengbe
@idowuogedengbe
Jan 04 2017 03:20
@eeflores @sjames1958gm thanks
CamperBot
@camperbot
Jan 04 2017 03:20
idowuogedengbe sends brownie points to @eeflores and @sjames1958gm :sparkles: :thumbsup: :sparkles:
:cookie: 893 | @eeflores |http://www.freecodecamp.com/eeflores
:star2: 5148 | @sjames1958gm |http://www.freecodecamp.com/sjames1958gm
Ken Haduch
@khaduch
Jan 04 2017 03:20
@Draidel - I was going to confirm that, because the docs say that $matches[0] will be an array of full pattern matches, so you have to access it by $ancho[0][0], and if there was a second match $ancho[0][1], etc.
Joseph
@revisualize
Jan 04 2017 03:20
@greedylan Regexp
Dylan Hsiao
@greedylan
Jan 04 2017 03:21
T_T @revisualize
Doegena Fennich
@Doegena
Jan 04 2017 03:21
@AliFox15 What have you learned a couple challenges back? Ff you know that you will know the solution for the challenge you're currently stuck on.
Joseph
@revisualize
Jan 04 2017 03:21
@greedylan What? I'm giving you the answer.
eeflores
@eeflores
Jan 04 2017 03:21
@greedylan ^[aeoiu]
AliFox15
@AliFox15
Jan 04 2017 03:21
@revisualize oh...Thank you.
@Doegena yeah,Thanks for the tip
Ken Haduch
@khaduch
Jan 04 2017 03:23
@Draidel - http://php.net/manual/en/function.preg-match-all.php - you'll probably also have $ancho[1][0] because you have parentheses in your expression, as well.
Dylan Hsiao
@greedylan
Jan 04 2017 03:24
@eeflores @revisualize I dont know how to connect str and [aeiou]
Ken Haduch
@khaduch
Jan 04 2017 03:24
@greedylan - look for the String.match() documentation. Plus a little extra Regexp usage...
Mar Bocatcat
@Marbocatcat
Jan 04 2017 03:29
@eeflores omg dude , i just needed to put my <script> link in the bottom of the <body> page. Document is not loaded yet thats why its giving me null on all my script
@eeflores effing fail.
eeflores
@eeflores
Jan 04 2017 03:30
@Marbocatcat but yay you solved it!
Mar Bocatcat
@Marbocatcat
Jan 04 2017 03:31
@eeflores sigh 1 hour just to fix that , make sense though. Thanks again
CamperBot
@camperbot
Jan 04 2017 03:31
marbocatcat sends brownie points to @eeflores :sparkles: :thumbsup: :sparkles:
:warning: marbocatcat already gave eeflores points
Dylan Hsiao
@greedylan
Jan 04 2017 03:32
@khaduch so I have this. it returns ["a"]. Is there other method that return boolean value either true or false?
function translatePigLatin(str) {
  var vowels = /[aeiou]/g;
  return str[0].match(vowels);
}
translatePigLatin("apple");
eeflores
@eeflores
Jan 04 2017 03:33
@greedylan could just be str.match(vowels);
@greedylan but I think that will give you "ae"
Dylan Hsiao
@greedylan
Jan 04 2017 03:33
@eeflores I need to check only the first letter of a given string
Draidel
@Draidel
Jan 04 2017 03:34
@khaduch awesome ! thanks a lot !
CamperBot
@camperbot
Jan 04 2017 03:34
draidel sends brownie points to @khaduch :sparkles: :thumbsup: :sparkles:
:star2: 2207 | @khaduch |http://www.freecodecamp.com/khaduch
Stephen James
@sjames1958gm
Jan 04 2017 03:34
@greedylan If you checked for non-vowels you could use the length of the match.
eeflores
@eeflores
Jan 04 2017 03:34
@greedylan something like return str[0].match(vowels).length > 0 ? true : false;
Dylan Hsiao
@greedylan
Jan 04 2017 03:34
@eeflores @sjames1958gm yes thank you !
CamperBot
@camperbot
Jan 04 2017 03:34
greedylan sends brownie points to @eeflores and @sjames1958gm :sparkles: :thumbsup: :sparkles:
:cookie: 894 | @eeflores |http://www.freecodecamp.com/eeflores
:star2: 5149 | @sjames1958gm |http://www.freecodecamp.com/sjames1958gm
wlagos1992
@wlagos1992
Jan 04 2017 03:37
@revisualize sorry i got a phone call i changed it

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

function checkObj(checkProp) {
  // Your Code Here

 if (myObj.hasOwnProperty) 
   return myObj[checkProp];


  else return "Not Found";
}
// Test your code by modifying these values
checkObj("bedd");
eeflores
@eeflores
Jan 04 2017 03:38
@wlagos1992 hasOwnProperty is a function that needs an argument
wlagos1992
@wlagos1992
Jan 04 2017 03:39
@eeflores isnt my "else return" my argument
eeflores
@eeflores
Jan 04 2017 03:40
@wlagos1992 the else return is a return value from your checkObj function
@wlagos1992 hasOwnProperty should be written as hasOwnProperty(blah) (but substitute something for blah)
wlagos1992
@wlagos1992
Jan 04 2017 03:44
@eeflores im sorry but i am not a fan of this things teaching methods sometimes i am really not understanding it, i would rather work backwards.. okay so does this work
@eeflores at first you told me it was the arguement that was wrong and now youre telling me its the first part too?
Rebecca
@alimily
Jan 04 2017 03:46
hello,everyOne
wlagos1992
@wlagos1992
Jan 04 2017 03:46

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

function checkObj(checkProp) {
  // Your Code Here

 if (myObj.hasOwnProperty) 
   return myObj[checkProp];


  else return "Not Found";

}
// Test your code by modifying these values
checkObj("");
this works when i use a code that exists like "gift" when i put soemthing that is false it leaves it blank, so is the problem with my if part or with my else part?
Rebecca
@alimily
Jan 04 2017 03:46
myBike.getGear() should return 4 after calling myBike.setGear(4).
myBike.getGear() should return 3 after calling myBike.setGear(3).
myBike.getGear() should return 1 after calling myBike.setGear(1).
this what should i do
eeflores
@eeflores
Jan 04 2017 03:46
@wlagos1992 a function is made up of a few things: it's name, things you pass into it that it uses, and a return value
Rebecca
@alimily
Jan 04 2017 03:46
var Bike = function() {
this.getGear=function(){
return this.setGear;
};
this.setGear=function(arg){
return arg;
};
var gear;
};
this can be ok??
eeflores
@eeflores
Jan 04 2017 03:47
@wlagos1992 can you tell me the name of your function, and it's parameters/arguments?
wlagos1992
@wlagos1992
Jan 04 2017 03:47
@eeflores okay i have the name and the name of my value i can insert
@eeflores checkObj is the name of my func
eeflores
@eeflores
Jan 04 2017 03:47
yep
HeebieGeeBee
@HeebieGeeBee
Jan 04 2017 03:47
no @alimily
wlagos1992
@wlagos1992
Jan 04 2017 03:47
and you can enter anything in the form of checkProp
its parameters are gift bed pet
eeflores
@eeflores
Jan 04 2017 03:48
@wlagos1992 checkProp is the argument to the checkObj function
Rebecca
@alimily
Jan 04 2017 03:48
@HeebieGeeBee can youtell me
wlagos1992
@wlagos1992
Jan 04 2017 03:48
values of pony kitten sleigh
HeebieGeeBee
@HeebieGeeBee
Jan 04 2017 03:48
thats getting into a bit of a mess you might want to reset your code and rethink @alimily
Jerry Purvis
@MessiaHack
Jan 04 2017 03:48
function nextInLine(arr, item) {
  arr = testArr;
  arr.push(item);
  item = arr.shift();

  return item;  // Change this line
}

// Test Setup
var testArr = [5,6,7,8,9];

// Display Code
console.log("Before: " + JSON.stringify(testArr));
console.log(nextInLine(testArr, 10)); // Modify this line to test
console.log("After: " + JSON.stringify(testArr));
can someone tell me what I am doing wrong?
wlagos1992
@wlagos1992
Jan 04 2017 03:48
Okay that is my arguement, thank you that term wasnt solid in my head
Rebecca
@alimily
Jan 04 2017 03:49
@HeebieGeeBee how do i do
eeflores
@eeflores
Jan 04 2017 03:49
@wlagos1992 so the word hasOwnProperty is also a function (provided by the javascript environment)
Stephen James
@sjames1958gm
Jan 04 2017 03:49
@MessiaHack Dont overwrite the input parameter arr
wlagos1992
@wlagos1992
Jan 04 2017 03:49
@eeflores okay so i can use hasOwnProperty(WHAT DO I PUT HERE)
@eeflores do i use my arguement there?
Jerry Purvis
@MessiaHack
Jan 04 2017 03:50
@sjames1958gm I don't understand.
HeebieGeeBee
@HeebieGeeBee
Jan 04 2017 03:50
whats the name of the exercise again @alimily ?
eeflores
@eeflores
Jan 04 2017 03:50
@wlagos1992 close ... you know how you're using myObj[checkProp]?
Rebecca
@alimily
Jan 04 2017 03:50
Make Object Properties Private
Kevin Chandra
@Kaence
Jan 04 2017 03:50
guys
im stuck here and dont know what to do
help me out
CamperBot
@camperbot
Jan 04 2017 03:50
no wiki entry for: me out
eeflores
@eeflores
Jan 04 2017 03:51
@wlagos1992 you want to check that checkProp exists in myObj before being able to call myObj[checkProp]
Jerry Purvis
@MessiaHack
Jan 04 2017 03:51
nvm
thanks @sjames1958gm
CamperBot
@camperbot
Jan 04 2017 03:51
messiahack sends brownie points to @sjames1958gm :sparkles: :thumbsup: :sparkles:
:star2: 5150 | @sjames1958gm |http://www.freecodecamp.com/sjames1958gm
eeflores
@eeflores
Jan 04 2017 03:51
@wlagos1992 so you would check by if(myObj.hasOwnProperty(checkProp)
wlagos1992
@wlagos1992
Jan 04 2017 03:51
@eeflores
 if (hasOwnProperty(checkProp)) 
   return myObj[checkProp];
Dilip Kumar Joshi
@DILIPKUMARJOSHI
Jan 04 2017 03:52

// Example
var ourStr = "I come first. " + "I come second.";

// Only change code below this line

var myStr = "This is the start. " + "This is the end.";

whats wrong with above code its not passsing help

eeflores
@eeflores
Jan 04 2017 03:52
@wlagos1992 you would want to check the property in relation to myObj
wlagos1992
@wlagos1992
Jan 04 2017 03:52
@eeflores you are a saint! thank you the way you showed me i know have a far deeper understanding of how that works
CamperBot
@camperbot
Jan 04 2017 03:52
wlagos1992 sends brownie points to @eeflores :sparkles: :thumbsup: :sparkles:
:cookie: 895 | @eeflores |http://www.freecodecamp.com/eeflores
wlagos1992
@wlagos1992
Jan 04 2017 03:53
@eeflores thank you for taking the time too that meant a lot
CamperBot
@camperbot
Jan 04 2017 03:53
wlagos1992 sends brownie points to @eeflores :sparkles: :thumbsup: :sparkles:
:warning: wlagos1992 already gave eeflores points
eeflores
@eeflores
Jan 04 2017 03:53
@wlagos1992 good stuff ... does it make a little bit of sense?
Jerry Purvis
@MessiaHack
Jan 04 2017 03:53
So I've refactored my code as best as I know how, but I am still not happy. I have one long function, and I want to break it up into separate functions so that I can use the search function as well, but I am at a loss
wlagos1992
@wlagos1992
Jan 04 2017 03:54
@eeflores yes you dont even know i was close behind eery word haha thank you
CamperBot
@camperbot
Jan 04 2017 03:54
wlagos1992 sends brownie points to @eeflores :sparkles: :thumbsup: :sparkles:
:warning: wlagos1992 already gave eeflores points
eeflores
@eeflores
Jan 04 2017 03:54
@wlagos1992 anyway, good job, and onward!
wlagos1992
@wlagos1992
Jan 04 2017 03:54
@eeflores so wait
HeebieGeeBee
@HeebieGeeBee
Jan 04 2017 03:54
@alimily have you reset your code?
wlagos1992
@wlagos1992
Jan 04 2017 03:54
@eeflores i am essentially doing two functions on that one line is that correct?
@eeflores i am checking the checkProp of myObj exists
Rebecca
@alimily
Jan 04 2017 03:55
yes
wlagos1992
@wlagos1992
Jan 04 2017 03:55
@eeflores no wait so thats the only thing im doing in that line
Rebecca
@alimily
Jan 04 2017 03:55
now what should i do
Dilip Kumar Joshi
@DILIPKUMARJOSHI
Jan 04 2017 03:55
HI help

// Example
var ourStr = "I come first. " + "I come second.";

// Only change code below this line

var myStr = "This is the start. " + "This is the end.";

wlagos1992
@wlagos1992
Jan 04 2017 03:56
@eeflores i guess in my head i would have wanted to do if (myObj(checkProp).hasOwnProperty) that would have made more sense before i understoof
eeflores
@eeflores
Jan 04 2017 03:56
@wlagos1992 it's made up of a couple of parts: the function call to hasOwnProperty that returns true or false, and the if statement to act on the true/false value
HeebieGeeBee
@HeebieGeeBee
Jan 04 2017 03:57
lets go through what its asks you to do step by step @alimily Modify the Bike constructor to have a private property called gear
Rebecca
@alimily
Jan 04 2017 03:57
i just want to know how to let myBike.getGear return myBike.setGear(4).
Ken Haduch
@khaduch
Jan 04 2017 03:57
@DILIPKUMARJOSHI - which lesson is this?
HeebieGeeBee
@HeebieGeeBee
Jan 04 2017 03:57
do this first step first
Rebecca
@alimily
Jan 04 2017 03:57
yes,i have gear property
var gear;
HeebieGeeBee
@HeebieGeeBee
Jan 04 2017 03:58
have you defined it with some value?
Dilip Kumar Joshi
@DILIPKUMARJOSHI
Jan 04 2017 03:58
@khaduch Concatenating Strings with Plus Operator | Free Code Camp
Rebecca
@alimily
Jan 04 2017 03:58
no
Ken Haduch
@khaduch
Jan 04 2017 03:58
@DILIPKUMARJOSHI - never mind, I found it. Your code looks good. Try to save your code, reset the lesson, (maybe even reload the lesson) and paste your solution back in. Sometimes things get cached in the browser and don't want to leave...
eeflores
@eeflores
Jan 04 2017 03:59
@DILIPKUMARJOSHI could you reset the challenge and enter the code again?
HeebieGeeBee
@HeebieGeeBee
Jan 04 2017 03:59
you're going to have to
Rebecca
@alimily
Jan 04 2017 03:59
as the freecodecamp asked ,no value to gear
next ,what i should do
Dilip Kumar Joshi
@DILIPKUMARJOSHI
Jan 04 2017 03:59
@eeflores okay
@khaduch oh i see okay
HeebieGeeBee
@HeebieGeeBee
Jan 04 2017 04:00
where does it say that? @alimily
Rebecca
@alimily
Jan 04 2017 04:00
myBike.gear should remain undefined.
Stephen James
@sjames1958gm
Jan 04 2017 04:01
@alimily If myBike.gear is not undefined then you are likely setting this.gear somewhere
Dilip Kumar Joshi
@DILIPKUMARJOSHI
Jan 04 2017 04:02
@khaduch OMG its not passing.
@eeflores I did several times but its not passing.
Stephen James
@sjames1958gm
Jan 04 2017 04:02
@DILIPKUMARJOSHI Any specific test is failing?
HeebieGeeBee
@HeebieGeeBee
Jan 04 2017 04:03
@alimily well i dont see that but ok move onto the next step
Dilip Kumar Joshi
@DILIPKUMARJOSHI
Jan 04 2017 04:03
\
@sjames1958gm Error : myStr should have a value of This is the start. This is the end.
Stephen James
@sjames1958gm
Jan 04 2017 04:03
@DILIPKUMARJOSHI Hmm I copied your code to my editor and it passed :(
Dilip Kumar Joshi
@DILIPKUMARJOSHI
Jan 04 2017 04:04
@sjames1958gm oh my goodness then what i have to do now.
HeebieGeeBee
@HeebieGeeBee
Jan 04 2017 04:04
@alimily make the first public method of getGear to get the gear
Gant Allen
@I-Am-Booger
Jan 04 2017 04:04
Free code camp is making the brain hurt.
Ken Haduch
@khaduch
Jan 04 2017 04:05
@I-Am-Booger - it happens to all of us... ;)
Gant Allen
@I-Am-Booger
Jan 04 2017 04:05
Hopefully this pays off @khaduch :)
Rebecca
@alimily
Jan 04 2017 04:05
The method getGear of myBike should be accessible outside the object.
The method setGear of myBike should be accessible outside the object.
myBike.gear should remain undefined.
myBike.getGear() should return 4 after calling myBike.setGear(4).
myBike.getGear() should return 3 after calling myBike.setGear(3).
myBike.getGear() should return 1 after calling myBike.setGear(1).
Ken Haduch
@khaduch
Jan 04 2017 04:06
@DILIPKUMARJOSHI - can you go try a totally different browser? It should work if you reset your browser and reload... the code looks correct.
Rebecca
@alimily
Jan 04 2017 04:06
here is thefreecodecamp asked
Dilip Kumar Joshi
@DILIPKUMARJOSHI
Jan 04 2017 04:06
@khaduch okay i will try like that
Stephen James
@sjames1958gm
Jan 04 2017 04:06
@alimily Can you post your code?
Ken Haduch
@khaduch
Jan 04 2017 04:06
@I-Am-Booger - it depends what you're looking for. If you want to stretch your brain, this is a good place for it. The lessons are pretty good, but they take leaps in some places...
@DILIPKUMARJOSHI - maybe just re-enter your code after you do that, too, don't paste in case there is something strange in your original window? (Just making other guesses here.)
Gant Allen
@I-Am-Booger
Jan 04 2017 04:07
I can see that @khaduch
Rebecca
@alimily
Jan 04 2017 04:07

var Bike = function() {

// Only change code below this line.

var gear;
this.setGear=function(){

} ;

this.getGear=function(){

};

};

here is my code
but i want to know is how to let myBike.getGear() should return 1 after calling myBike.setGear(1).
HeebieGeeBee
@HeebieGeeBee
Jan 04 2017 04:09
how do you usually make a function return something? @alimily
Rebecca
@alimily
Jan 04 2017 04:10
once
i see the instance is funciton
so do i

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

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

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

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

you see ,it is also function
HeebieGeeBee
@HeebieGeeBee
Jan 04 2017 04:11
yeah look at the this-getSpeed function, its very similar to getGear
Gant Allen
@I-Am-Booger
Jan 04 2017 04:12
I'm on the Counting Cards part. I know I have the switch part down right. I think I do at least. I am just not for sure on what else I need to do ```
HeebieGeeBee
@HeebieGeeBee
Jan 04 2017 04:13
@I-Am-Booger compare the count to see if you need to return hold or bet
Rebecca
@alimily
Jan 04 2017 04:14

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

this.getGear=function getgear(gear){
return this.setGear();

};

};

how about this
HeebieGeeBee
@HeebieGeeBee
Jan 04 2017 04:15
no
Rebecca
@alimily
Jan 04 2017 04:15
why again
HeebieGeeBee
@HeebieGeeBee
Jan 04 2017 04:15
for setGear you just need to return what the gear has been changed to
and for getGear you just need to return what the gear is
well you dont need to return in setGear you just need to change the value of gear
Ogundele Olumide
@Lumexralph
Jan 04 2017 04:16
@I-Am-Booger increment or decrement count
Rebecca
@alimily
Jan 04 2017 04:16
how to change
the asked myBike.getGear() should return 3 after calling myBike.setGear(3).
HeebieGeeBee
@HeebieGeeBee
Jan 04 2017 04:18
in set gear change the gear to your setGear function parameter
Rebecca
@alimily
Jan 04 2017 04:19
oh,i see
HeebieGeeBee
@HeebieGeeBee
Jan 04 2017 04:19
and just for ths challenge use the word change for the function argument
its messes up if you use gear as the argument for the function and the variable
Rebecca
@alimily
Jan 04 2017 04:20
this.setGear=function setgear(arg){
gear=arg;
return gear;
} ;
this is ok??
HeebieGeeBee
@HeebieGeeBee
Jan 04 2017 04:20
you dont need to return gear there
return gear in the getGear function
Rebecca
@alimily
Jan 04 2017 04:21
yes,yes ,it is ok
you are so nice and smart
thank you
HeebieGeeBee
@HeebieGeeBee
Jan 04 2017 04:22
not sure about that but youre welcome
Rebecca
@alimily
Jan 04 2017 04:24
i want to tell you how i appreciate your help,it means too much
you are a so good person
Joseph
@revisualize
Jan 04 2017 04:33
Emily Sperry
@sperrye
Jan 04 2017 04:40
I finished my quote generator.
Alexander Køpke
@alexanderkopke
Jan 04 2017 04:41
:+1:
Ken Haduch
@khaduch
Jan 04 2017 04:44
@sperrye - great!
grantknaver
@grantknaver
Jan 04 2017 04:48
anyone have any ideas why this code keeps prompting an infinite loop
Ken Haduch
@khaduch
Jan 04 2017 04:48
@revisualize - thanks for posting that - I added it to my long list of udemy courses that I hope to get to eventually... :)
CamperBot
@camperbot
Jan 04 2017 04:48
khaduch sends brownie points to @revisualize :sparkles: :thumbsup: :sparkles:
:star2: 2822 | @revisualize |http://www.freecodecamp.com/revisualize
Ken Haduch
@khaduch
Jan 04 2017 04:48
@grantknaver - do you mean the chatroom? :)
it feels like an infinite loop... or groundhog's day... :)
James
@JaCorbett
Jan 04 2017 04:49
Hey everyone!
So, I am stuck

function functionWithArgs(c, d) {
console.log(c+d)
}

functionWithArgs(1,2)
functionWithArgs(7,9)

grantknaver
@grantknaver
Jan 04 2017 04:50
lol na. here is the code
James
@JaCorbett
Jan 04 2017 04:50
I am calling the function "functionWithArgs" .... aren't I?
Ken Haduch
@khaduch
Jan 04 2017 04:50
@JaCorbett - it looks like it? What is it telling you?
Joseph
@revisualize
Jan 04 2017 04:50
@sperrye Grats. You're further along than I am.
James
@JaCorbett
Jan 04 2017 04:50
Well, I have an "X" and it states: "Call functionWithArgs after you define it."
grantknaver
@grantknaver
Jan 04 2017 04:51

function fearNotLetter(str) {

  for (var i = 0; i < str.length -1; i++){
    for(var j = 1; j < str.length; j++){
    alert(String.fromCharCode(str.charCodeAt(j)));
    }
  }  
}

fearNotLetter("abce");
Joseph
@revisualize
Jan 04 2017 04:51
James
@JaCorbett
Jan 04 2017 04:51
everything else is checked off..
Emily Sperry
@sperrye
Jan 04 2017 04:53
@revisualize no, should I be?
Ken Haduch
@khaduch
Jan 04 2017 04:53
@JaCorbett @JaCorbett - you need to end your lines of code with ;
James
@JaCorbett
Jan 04 2017 04:54
son of bitch....I literally just realized that
hahahaha
Thanks @khaduch
CamperBot
@camperbot
Jan 04 2017 04:54
jacorbett sends brownie points to @khaduch :sparkles: :thumbsup: :sparkles:
:star2: 2208 | @khaduch |http://www.freecodecamp.com/khaduch
grantknaver
@grantknaver
Jan 04 2017 04:54
@khaduch any ideas
James
@JaCorbett
Jan 04 2017 04:54
I am literally LOLing and smh right now
Joseph
@revisualize
Jan 04 2017 04:56
@sperrye Yes.
foxdog
@foxdog
Jan 04 2017 04:56
Hello
Ken Haduch
@khaduch
Jan 04 2017 04:57
@grantknaver - no - are you seeing it flag infinite loop somewhere? Maybe they don't want you doing an alert inside a loop?
Emily Sperry
@sperrye
Jan 04 2017 04:57
Am I right in thinking there are two steps to this weather app? 1/Get location 2/Get weather for that location?
Joseph
@revisualize
Jan 04 2017 04:58
@sperrye There are a few more but... Sure.
Ken Haduch
@khaduch
Jan 04 2017 04:58
@sperrye - yes, that's about the size of it...
grantknaver
@grantknaver
Jan 04 2017 04:58
I think but when I console.log it, for some reason it keeps doing it. Might be a freeCodeCamp error
Ken Haduch
@khaduch
Jan 04 2017 04:58
@grantknaver - which lesson is this? I have to try it and see what it's doing...
foxdog
@foxdog
Jan 04 2017 04:59
So... I'm on lesson 173 and I'm stuck.
Ken Haduch
@khaduch
Jan 04 2017 05:00
@foxdog - what is "lesson 173" - the numbers don't correspond to the lessons. Please give the title, post code, ask questions, etc... :)
foxdog
@foxdog
Jan 04 2017 05:00
oh, Stand in Line is the title.
Ken Haduch
@khaduch
Jan 04 2017 05:01
@foxdog - okay, what is your sticking point?
ErikEBM
@ErikEBM
Jan 04 2017 05:01
Hi
I need help
foxdog
@foxdog
Jan 04 2017 05:02
I'm not really getting what its wanting me to do.... iterate over the numbers?
ErikEBM
@ErikEBM
Jan 04 2017 05:02
Somebody can help me, please?
Johnny
@JohnnyBizzel
Jan 04 2017 05:02
@sperrye One way to get the location is to use an IP addr API.
Ken Haduch
@khaduch
Jan 04 2017 05:02
@foxdog - you are working with an array, adding elements to the "end" of the array, and removing them from the head of the array. That's basically it.
Huzaifa Gadiwala
@huzaifa83
Jan 04 2017 05:03

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

switch is not work
not working
ErikEBM
@ErikEBM
Jan 04 2017 05:03

for(var e = 0; e < contacts.length; e++){
if(contacts[e][0] === "firstName"){
return contacts[e].firstName;
} else {
return "No such contact";
}

for(var i = 0; i < contacts[e].length; i++){
if(contacts[e][i].hasOwnProperty(prop) === true){
return contacts[e][i].prop;
} else {
return "No such property";
}
}
}

heroiczero
@heroiczero
Jan 04 2017 05:03
@huzaifa83 gotta set it to answer
ErikEBM
@ErikEBM
Jan 04 2017 05:03
What is wrong whit my code?
es the lesson 216
Ken Haduch
@khaduch
Jan 04 2017 05:04
@foxdog - the "line" is an analogy to a line such as a bank teller line, where a customer comes in, gets in the end of the line, the first person in line is served by the next teller. In Great Britain, they refer to it as a "queue", and in computer science, they refer to it as a queue. so the "Get in Line" is kind of a play on words, in my reckoning...
heroiczero
@heroiczero
Jan 04 2017 05:04
@huzaifa83 also it is switch of the parameter not your local variable of answer
aleeex
@rodneystrong
Jan 04 2017 05:04

i'm stuck on this one: https://www.freecodecamp.com/challenges/using-objects-for-lookups

It's titled "Using Objects for Lookups"

heroiczero
@heroiczero
Jan 04 2017 05:04
@huzaifa83 function caseInSwitch(val) val is your parameter
aleeex
@rodneystrong
Jan 04 2017 05:05

this is my code so far:

var lookup = {
alpha: "Adams",
bravo: "Boston",
charlie: "Chicago",
delta: "Denver",
echo: "Easy",
foxtrot: "Frank"
};

lookup['alpha'];

Johnny
@JohnnyBizzel
Jan 04 2017 05:05
@huzaifa83 Why do you switch answer and not val?
Huzaifa Gadiwala
@huzaifa83
Jan 04 2017 05:05
so in the switch in I need to put the parameter?
heroiczero
@heroiczero
Jan 04 2017 05:06
@rodneystrong gotta set it equal to result
Ken Haduch
@khaduch
Jan 04 2017 05:06
@foxdog - I messed up on my previous post: I didn't put your name. Check up about ten responses.
Johnny
@JohnnyBizzel
Jan 04 2017 05:06
@rodneystrong Looks fine (what you wrote).
@huzaifa83 I would
heroiczero
@heroiczero
Jan 04 2017 05:07
@rodneystrong make sure you use your parameter for your function
aleeex
@rodneystrong
Jan 04 2017 05:07
@heroiczero result = lookup['alpha']; ??
Huzaifa Gadiwala
@huzaifa83
Jan 04 2017 05:07

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

switch (val){
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);

foxdog
@foxdog
Jan 04 2017 05:08
@khaduch you are referring to the queue response?
Ken Haduch
@khaduch
Jan 04 2017 05:08
@foxdog - yes...
Huzaifa Gadiwala
@huzaifa83
Jan 04 2017 05:08
I have changed from variable to parameter
heroiczero
@heroiczero
Jan 04 2017 05:08
@rodneystrong then result will always return the alpha value of lookup gotta use the parameter. function(parameter)
aleeex
@rodneystrong
Jan 04 2017 05:08
thanks @JohnnyBizzel but somethin
CamperBot
@camperbot
Jan 04 2017 05:08
rodneystrong sends brownie points to @johnnybizzel :sparkles: :thumbsup: :sparkles:
:star2: 1091 | @johnnybizzel |http://www.freecodecamp.com/johnnybizzel
aleeex
@rodneystrong
Jan 04 2017 05:09
umm.. wow ok didn't know cmaperbot would do that
but @JohnnyBizzel its still not workin
Ken Haduch
@khaduch
Jan 04 2017 05:09
@foxdog - my response up there: about the queue
heroiczero
@heroiczero
Jan 04 2017 05:09
@huzaifa83 gotta use answer=instead of console.log
Johnny
@JohnnyBizzel
Jan 04 2017 05:09
@rodneystrong are you using a function?
foxdog
@foxdog
Jan 04 2017 05:09
I suppose I understand what is wanting, I think I just dont understand how to go about it.
heroiczero
@heroiczero
Jan 04 2017 05:10
@huzaifa83 return answer; you have that in your function
aleeex
@rodneystrong
Jan 04 2017 05:10
@JohnnyBizzel yes, i'll paste entire code here

// Setup
function phoneticLookup(val) {
var result = "";

// Only change code below this line
// switch(val) {
// case "alpha":
// result = "Adams";
// break;
// case "bravo":
// result = "Boston";
// break;
// case "charlie":
// result = "Chicago";
// break;
// case "delta":
// result = "Denver";
// break;
// case "echo":
// result = "Easy";
// break;
// case "foxtrot":
// result = "Frank";
// }

var lookup = {
alpha: "Adams",
bravo: "Boston",
charlie: "Chicago",
delta: "Denver",
echo: "Easy",
foxtrot: "Frank"
};

lookup['alpha'];

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

// Change this value to test
phoneticLookup("charlie");

it wants me to change from switch statement to object lookup. which is why i commented out their switch statement
Huzaifa Gadiwala
@huzaifa83
Jan 04 2017 05:10
Got
Johnny
@JohnnyBizzel
Jan 04 2017 05:10
@rodneystrong Use val
Huzaifa Gadiwala
@huzaifa83
Jan 04 2017 05:10
it
Johnny
@JohnnyBizzel
Jan 04 2017 05:10
@huzaifa83 Got what?
Huzaifa Gadiwala
@huzaifa83
Jan 04 2017 05:10
Thanks alot
Got the answer
Johnny
@JohnnyBizzel
Jan 04 2017 05:10
@huzaifa83 Who?
Nicolas
@annata83
Jan 04 2017 05:11
hey everybody
Huzaifa Gadiwala
@huzaifa83
Jan 04 2017 05:11
Thanks Johnny
aleeex
@rodneystrong
Jan 04 2017 05:11
@JohnnyBizzel use 'val' where ?
Nicolas
@annata83
Jan 04 2017 05:11
going crazy here
aleeex
@rodneystrong
Jan 04 2017 05:11
on my return statement ?
Ken Haduch
@khaduch
Jan 04 2017 05:11
@foxdog - the function receives two arguments - an array, in the variable arr, and an item, in the variable item. Sometimes the array has values, sometimes it is an empty array, but you can take the incoming item and add it to the "end of the line" (the array, arr) and take the first value out of the line and return it. You should always be using arr as the array within the function, and look at the Array methods that add elements to the end of the array and remove them from the start of the array.
Nicolas
@annata83
Jan 04 2017 05:11
coding its haaard!!!!
Johnny
@JohnnyBizzel
Jan 04 2017 05:11
@rodneystrong result = lookup[val]
@huzaifa83 anytime
Nicolas
@annata83
Jan 04 2017 05:12
i am stuck at 225
if anybody has some guidance i apreciate it
heroiczero
@heroiczero
Jan 04 2017 05:12
@annat83 what is the exercise called
aleeex
@rodneystrong
Jan 04 2017 05:13
@JohnnyBizzel oh that worked! thank you!
CamperBot
@camperbot
Jan 04 2017 05:13
rodneystrong sends brownie points to @johnnybizzel :sparkles: :thumbsup: :sparkles:
:warning: rodneystrong already gave johnnybizzel points
Ken Haduch
@khaduch
Jan 04 2017 05:13
@annat83 - the lesson name, please, the numbers are not meaningful...
Nicolas
@annata83
Jan 04 2017 05:13
@rodneystrong Testing Objects for Properties
Johnny
@JohnnyBizzel
Jan 04 2017 05:13
@rodneystrong :beers:
aleeex
@rodneystrong
Jan 04 2017 05:13
@JohnnyBizzel but how would I know to put that line of code there ?
Nicolas
@annata83
Jan 04 2017 05:13

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

dosent work

aleeex
@rodneystrong
Jan 04 2017 05:14
oooh oh oh oh nevermind
i got it @JohnnyBizzel
Johnny
@JohnnyBizzel
Jan 04 2017 05:14
@rodneystrong functions use parameters and arguments which makes them re-usable for different situations.
aleeex
@rodneystrong
Jan 04 2017 05:14
ugh
heroiczero
@heroiczero
Jan 04 2017 05:14
@annat83 (myObj.hasOwnProperty(checkProp))
aleeex
@rodneystrong
Jan 04 2017 05:14
yea i just re-read the instructions on needing to assign the associated string to the "result" variable
ErikEBM
@ErikEBM
Jan 04 2017 05:14
Hi, i need hel whit the lesson 216
Ken Haduch
@khaduch
Jan 04 2017 05:14
@annat83 - within the function, do not put checkProp in quotes, otherwise that is just a string value, not the variable value.
aleeex
@rodneystrong
Jan 04 2017 05:14
thanks again for that though
Nicolas
@annata83
Jan 04 2017 05:14
i try like 5 diferent things
ErikEBM
@ErikEBM
Jan 04 2017 05:14

for(var e = 0; e < contacts.length; e++){
if(contacts[e][0] == "firstName"){
return contacts[e].firstName;
} else {
return "No such contact";
}

for(var i = 0; i < contacts[e].length; i++){
if(contacts[e][i].hasOwnProperty(prop) === true){
return contacts[e][i].prop;
} else {
return "No such property";
}
}
}

aleeex
@rodneystrong
Jan 04 2017 05:14
'preciate it!
Nicolas
@annata83
Jan 04 2017 05:14
cant figure it out
@khaduch let me check
oh my Gog,
it so terrible to get stuck like this
thanks @khaduch
CamperBot
@camperbot
Jan 04 2017 05:15
annat83 sends brownie points to @khaduch :sparkles: :thumbsup: :sparkles:
:star2: 2209 | @khaduch |http://www.freecodecamp.com/khaduch
Nicolas
@annata83
Jan 04 2017 05:16
tahnks @heroiczero
thanks @heroiczero
CamperBot
@camperbot
Jan 04 2017 05:16
:cookie: 616 | @heroiczero |http://www.freecodecamp.com/heroiczero
annat83 sends brownie points to @heroiczero :sparkles: :thumbsup: :sparkles:
Nicolas
@annata83
Jan 04 2017 05:18
u know i really put focus into this... somedays its seems imposible to figure it out!!
'preciate it! GUYS
ErikEBM
@ErikEBM
Jan 04 2017 05:19
Help me please =(