These are chat archives for FreeCodeCamp/HelpJavaScript

3rd
Jun 2017
Joseph
@Big-jo
Jun 03 2017 00:03
@camperbot please can you write a snippet for me?
MrChizzy
@MrChizzy
Jun 03 2017 00:03
Can someone help me with newline backslashes and carriage-return backslashes please?
Matthew Greene
@mattkgreene
Jun 03 2017 00:04
@sjames1958gm hmm alright gunna give it a shot , thanks
CamperBot
@camperbot
Jun 03 2017 00:04
mattkgreene sends brownie points to @sjames1958gm :sparkles: :thumbsup: :sparkles:
:star2: 7596 | @sjames1958gm |http://www.freecodecamp.com/sjames1958gm
Stephen James
@sjames1958gm
Jun 03 2017 00:04
@mattkgreene :+1:
Joseph
@Big-jo
Jun 03 2017 00:04
@moigithub please can you write a snippet for me?
can some one please expalin the counting cards challenge
Jose Alejandro Becerra
@JoseeAlejandro
Jun 03 2017 00:07
HELP!!
Joseph
@Big-jo
Jun 03 2017 00:08
@JoseeAlejandro with what?
Andrew Gabriel
@Andrewngabriel
Jun 03 2017 00:08
Hello
BrunoM24
@BrunoM24
Jun 03 2017 00:09
hello
MrChizzy
@MrChizzy
Jun 03 2017 00:09
I need help with escape sequences
Andrew Gabriel
@Andrewngabriel
Jun 03 2017 00:09
I was wondering if anyone could help me with this algorithm problem, I have to return the largest numbers in array. I wrote the code blow and was wondering what is wrong with it.
function largestOfFour(arr) {
  // You can do this!
  var largestNumber = [0, 0, 0, 0];
  for (var indexVal = 0; indexVal < arr.length; indexVal++) {
    for (var subIndexVal = 0; subIndexVal < arr[indexVal].length; subIndexVal++) {
      if (arr[indexVal][subIndexVal] > largestNumber[subIndexVal]) {
        largestNumber[subIndexVal] = arr[indexVal][subIndexVal];
      }
    }
  }
  return largestNumber;
}

largestOfFour([[4, 5, 1, 3], [13, 27, 18, 26], [32, 35, 37, 39], [1000, 1001, 857, 1]]);
Joseph
@Big-jo
Jun 03 2017 00:11
@JoseeAlejandro you are ahead of me, can you help me with the counting cards challenge
mikesyoon
@mikesyoon
Jun 03 2017 00:11
could someone help with java escape sequences
BrunoM24
@BrunoM24
Jun 03 2017 00:11
@Andrewngabriel your variable largestNumber
it should be a number not a array
Jose Alejandro Becerra
@JoseeAlejandro
Jun 03 2017 00:11
@Big-jo what is that??
mikesyoon
@mikesyoon
Jun 03 2017 00:12
'''var myStr = "FirstLine\nSecondLine\nThirdLine"; // Change this line
CamperBot
@camperbot
Jun 03 2017 00:12
:bulb: to format code use backticks! ``` more info
mikesyoon
@mikesyoon
Jun 03 2017 00:12
```
Andrew Gabriel
@Andrewngabriel
Jun 03 2017 00:12
@BrunoM24 But the challenge mentions that the result should return an array
mikesyoon
@mikesyoon
Jun 03 2017 00:12
var myStr = "FirstLine\nSecondLine\nThirdLine"; // Change this line
BrunoM24
@BrunoM24
Jun 03 2017 00:12
@Andrewngabriel you should compare each number of each subArray with a number
Joseph
@Big-jo
Jun 03 2017 00:12
@JoseeAlejandro never mind
BrunoM24
@BrunoM24
Jun 03 2017 00:12
@Andrewngabriel yes but you need to campare the number, and them create the array
mikesyoon
@mikesyoon
Jun 03 2017 00:13
need to produce
FirstLine
\SecondLine\
ThirdLine
Andrew Gabriel
@Andrewngabriel
Jun 03 2017 00:13
@BrunoM24 Hmmmm, ok I will give that a try. Thanks
CamperBot
@camperbot
Jun 03 2017 00:13
andrewngabriel sends brownie points to @brunom24 :sparkles: :thumbsup: :sparkles:
:cookie: 293 | @brunom24 |http://www.freecodecamp.com/brunom24
BrunoM24
@BrunoM24
Jun 03 2017 00:13
@Andrewngabriel ok, good luck, say something after
Andrew Gabriel
@Andrewngabriel
Jun 03 2017 00:14
Will do @BrunoM24
I just figured out the problem
Dovydas Stirpeika
@Giveback007
Jun 03 2017 00:16
how to set a cool down on all click events after clicking one
BrunoM24
@BrunoM24
Jun 03 2017 00:16
@Andrewngabriel nice
Andrew Gabriel
@Andrewngabriel
Jun 03 2017 00:16
Here is the correction

function largestOfFour(arr) {
  // You can do this!
  var largestNumber = [0, 0, 0, 0];
  for (var indexVal = 0; indexVal < arr.length; indexVal++) {
    for (var subIndexVal = 0; subIndexVal < arr[indexVal].length; subIndexVal++) {
      if (arr[indexVal][subIndexVal] > largestNumber[indexVal]) {
        largestNumber[indexVal] = arr[indexVal][subIndexVal];
      }
    }
  }
  return largestNumber;
}

largestOfFour([[4, 5, 1, 3], [13, 27, 18, 26], [32, 35, 37, 39], [1000, 1001, 857, 1]]);
largestNumber should be checked using indexVal to target the index value
I was using subIndexValue
The iteration of indexVal is 4 however the iteration of subIndexVal is also 4 which doubles the evaluation when it comes to comparing the arr to largestNumber
however by using indexVal, we are only checking 4 times which is the array size we have to return
This one was a bit tricky, I spent about 6 - 8 hours thinking about it
Derek
@Dmdrapp
Jun 03 2017 00:22
How do I apply celcius code to fahrenheit?
I wrote the following code...
haris8
@haris8
Jun 03 2017 00:22
Hello, I need help with the Check for Palindromes
Derek
@Dmdrapp
Jun 03 2017 00:23
var fahrenheit = celcius * (9 / 5) + 32;
I know it's wrong, but I don't know what is causing it to be wrong... lol
Joseph
@Big-jo
Jun 03 2017 00:23
@Dmdrapp celcius *((9/5) + 32)
haris8
@haris8
Jun 03 2017 00:23
This is my code:

function palindrome(str) {
// Good luck!
var str1 = str.replace(/[\W\s_]+/gi, "");
str1.toLowerCase();
var str2 = str1.split('').reverse().join('');

if (str2.localeCompare(str1) === 0)
return true;
else
return false;
}

palindrome("A man, a plan, a canal. Panama");

Joseph
@Big-jo
Jun 03 2017 00:24
@Dmdrapp it's called precedence, like you have order of operations in maths
Derek
@Dmdrapp
Jun 03 2017 00:24
Thanks you @haris8! Does that mean that fahrenheit is correct?
CamperBot
@camperbot
Jun 03 2017 00:24
dmdrapp sends brownie points to @haris8 :sparkles: :thumbsup: :sparkles:
:cookie: 240 | @haris8 |http://www.freecodecamp.com/haris8
Derek
@Dmdrapp
Jun 03 2017 00:24
I see. That makes sense
Joseph
@Big-jo
Jun 03 2017 00:24
@Dmdrapp you're welcome
haris8
@haris8
Jun 03 2017 00:25
You sent the brownie point to the wrong person @Dmdrapp
Derek
@Dmdrapp
Jun 03 2017 00:25
I didn't know that I sent any 0_0
Thank you @Big-jo
CamperBot
@camperbot
Jun 03 2017 00:26
dmdrapp sends brownie points to @big-jo :sparkles: :thumbsup: :sparkles:
:cookie: 207 | @big-jo |http://www.freecodecamp.com/big-jo
haris8
@haris8
Jun 03 2017 00:26
I'm not sure how it works, I don't even know what they are
Derek
@Dmdrapp
Jun 03 2017 00:26
Haha. You and me both
Andrew Gabriel
@Andrewngabriel
Jun 03 2017 00:26
They are virtual brownies :D
haris8
@haris8
Jun 03 2017 00:26
How do you send or is it automatic?
Andrew Gabriel
@Andrewngabriel
Jun 03 2017 00:27
I think every time you say "thank you" it triggers it and send points to the person you are @
Thank you @haris8
CamperBot
@camperbot
Jun 03 2017 00:27
andrewngabriel sends brownie points to @haris8 :sparkles: :thumbsup: :sparkles:
:cookie: 241 | @haris8 |http://www.freecodecamp.com/haris8
Andrew Gabriel
@Andrewngabriel
Jun 03 2017 00:27
you see?
haris8
@haris8
Jun 03 2017 00:27
Ah ok, thank you @Andrewngabriel
CamperBot
@camperbot
Jun 03 2017 00:27
haris8 sends brownie points to @andrewngabriel :sparkles: :thumbsup: :sparkles:
:cookie: 251 | @andrewngabriel |http://www.freecodecamp.com/andrewngabriel
Andrew Gabriel
@Andrewngabriel
Jun 03 2017 00:27
:D
Derek
@Dmdrapp
Jun 03 2017 00:28
Haha! Brownie points around!
Joseph
@Big-jo
Jun 03 2017 00:28
@Dmdrapp thanks
Derek
@Dmdrapp
Jun 03 2017 00:28
Screen Shot 2017-06-02 at 7.27.37 PM.png
This is the code I'm using... It still isn't working for some reason.
Joseph
@Big-jo
Jun 03 2017 00:29
fahrenheit = your stuff @Dmdrapp
fahrenheit = celcius *((9/5)+32);
@Dmdrapp
Derek
@Dmdrapp
Jun 03 2017 00:30
Okay! So I have too many spaces in between?
Stephen James
@sjames1958gm
Jun 03 2017 00:31
@Dmdrapp You mispelled the parameter and you aren't assigning it and you have wrong parenthesis.
fahrenheit = celsius * 9/5 + 32;
Joseph
@Big-jo
Jun 03 2017 00:31
@Dmdrapp no , you didnt set your fahrenheit variable to your celcius stuff
Derek
@Dmdrapp
Jun 03 2017 00:31
Ah.. Thanks @Big-jo and @sjames1958gm
CamperBot
@camperbot
Jun 03 2017 00:31
dmdrapp sends brownie points to @big-jo and @sjames1958gm :sparkles: :thumbsup: :sparkles:
:warning: dmdrapp already gave big-jo points
:star2: 7597 | @sjames1958gm |http://www.freecodecamp.com/sjames1958gm
Stephen James
@sjames1958gm
Jun 03 2017 00:32
celsius *((9/5)+32); this is wrong because it does 9/5 + 32 then multiplies by celsius
Derek
@Dmdrapp
Jun 03 2017 00:32
I figured it out :D I didn't realize the spelling.
Thanks for helping me with the mix up...
I really appreciate this team!
Stephen James
@sjames1958gm
Jun 03 2017 00:33
@Dmdrapp :+1:
haris8
@haris8
Jun 03 2017 00:33
Can someone help me with the check for Palindromes?

function palindrome(str) {
// Good luck!
var str1 = str.replace(/[\W\s_]+/gi, "");
str1.toLowerCase();
var str2 = str1.split('').reverse().join('');

if (str2.localeCompare(str1) === 0)
return true;
else
return false;
}
palindrome("A man, a plan, a canal. Panama");

It's supposed to return true for this string
And this as well "My age is 0, 0 si ega ym."
Stephen James
@sjames1958gm
Jun 03 2017 00:35
@haris8 str1.toLowerCase(); this doesn't have any effect without assigning
SAIDI YASSINE
@Nero00
Jun 03 2017 00:35
can any one help me with logic please
my button didn't work
haris8
@haris8
Jun 03 2017 00:36
ok @sjames1958gm. I'll try correcting that and see if it fixes the issue. Thank you
CamperBot
@camperbot
Jun 03 2017 00:36
haris8 sends brownie points to @sjames1958gm :sparkles: :thumbsup: :sparkles:
:star2: 7598 | @sjames1958gm |http://www.freecodecamp.com/sjames1958gm
Stephen James
@sjames1958gm
Jun 03 2017 00:37
@Nero00 Floor this should be floor
mattr12
@mattr12
Jun 03 2017 00:37
I am stuck on "Stand in Line"
Has anyone here completed that challenge?
Stephen James
@sjames1958gm
Jun 03 2017 00:37
@mattr12 What do you have
SAIDI YASSINE
@Nero00
Jun 03 2017 00:38
@sjames1958gm thank you that makes me crazy ;v
CamperBot
@camperbot
Jun 03 2017 00:38
nero00 sends brownie points to @sjames1958gm :sparkles: :thumbsup: :sparkles:
:star2: 7599 | @sjames1958gm |http://www.freecodecamp.com/sjames1958gm
Stephen James
@sjames1958gm
Jun 03 2017 00:39
@Nero00 :+1:
@Nero00 I opened the developer console and saw and error saying Floor was not a function
mattr12
@mattr12
Jun 03 2017 00:39
we're supposed to create a function that takes two arguments, an array arr and an item, the function is then supposed to add the item to the end of the array and remove the first element of the array--then return the element that was removed
SAIDI YASSINE
@Nero00
Jun 03 2017 00:40
@sjames1958gm idk i dont get that error in main :/
haris8
@haris8
Jun 03 2017 00:40
Thanks @sjames1958gm . I can finally move forward
CamperBot
@camperbot
Jun 03 2017 00:40
haris8 sends brownie points to @sjames1958gm :sparkles: :thumbsup: :sparkles:
:warning: haris8 already gave sjames1958gm points
mattr12
@mattr12
Jun 03 2017 00:40
I used arr.push(item) to add the item to the end of the array, and arr.shift to remove the first element--but I am not sure how to return the element that was removed
Joseph
@Big-jo
Jun 03 2017 00:41
@mattr12 lemme see your code
SAIDI YASSINE
@Nero00
Jun 03 2017 00:42
@sjames1958gm what you mean with the developer console ?
mattr12
@mattr12
Jun 03 2017 00:42

@Big-jo `
function nextInLine(arr, item) {
// Your code here
arr.push(item);
arr.shift();

return item; // Change this line
} `

Joseph
@Big-jo
Jun 03 2017 00:42
assign item to arr.shift()
mattr12
@mattr12
Jun 03 2017 00:43
Doesn't arr.shift() just remove the first element?
Joseph
@Big-jo
Jun 03 2017 00:44
@mattr12 yh but the arr.push(item) adds a number, so the number behind the one being pushed takes it's space
Stephen James
@sjames1958gm
Jun 03 2017 00:44
@mattr12 Yes, but if you don't capture the return then it is just lost
Cuong Nguyen
@cuong-nguyen
Jun 03 2017 00:45
I don't know what the problem is with my "steamrollArray" problem
pass all the sample tests but does not solve it?
Stephen James
@sjames1958gm
Jun 03 2017 00:45
@Nero00 On chrome in windows you can use F12 to get to the console.
There are several videos later in the MAP that talk about the console
@cuong-nguyen Make sure you are not using any globals
Cuong Nguyen
@cuong-nguyen
Jun 03 2017 00:46
oh :(
Stephen James
@sjames1958gm
Jun 03 2017 00:46
@mattr12 arr.shift(); this (without assignment) loses the shifted value
Cuong Nguyen
@cuong-nguyen
Jun 03 2017 00:46
Thanks @sjames1958gm
CamperBot
@camperbot
Jun 03 2017 00:46
cuong-nguyen sends brownie points to @sjames1958gm :sparkles: :thumbsup: :sparkles:
:star2: 7600 | @sjames1958gm |http://www.freecodecamp.com/sjames1958gm
mattr12
@mattr12
Jun 03 2017 00:46
I see, so arr.shift(item) stores the shifted element into item?
Stephen James
@sjames1958gm
Jun 03 2017 00:46
@cuong-nguyen :+1:
@mattr12 No. arr.shift() returns a value. so you need something like item = arr.shift();
mattr12
@mattr12
Jun 03 2017 00:48
ahh, I did not know that... @sjames1958gm and @Big-jo
thanks guys
Stephen James
@sjames1958gm
Jun 03 2017 00:48
@mattr12 :+1:
Joseph
@Big-jo
Jun 03 2017 00:48
@mattr12 :+1:
jude obi
@lighthous
Jun 03 2017 00:50

hello guys, i've been stuck for two weeks on conditional logic with if statement, i need help asap.here is my code snippet.
// 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.
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);

Stephen James
@sjames1958gm
Jun 03 2017 00:50
@lighthous Make sure the case of the strings is correct, possibly "Yes, that was true"?
AJ Brommy
@AJ-Brommy
Jun 03 2017 00:53
@AhmedChaibi Did you resolve the issue in the end??
@lighthous Capital letter start a sentence ;) is another clue to aid @sjames1958gm 's point
Joshua
@jfc246
Jun 03 2017 00:56

can anyone give me their thoughts on this?

https://codepen.io/jfc246/pen/rrRNgp

if anyone would like help email at the address
AJ Brommy
@AJ-Brommy
Jun 03 2017 01:01
So far so good, keep going, that's my thoughts :) :P :)
Joshua
@jfc246
Jun 03 2017 01:01
@AJ-Brommy is there any suggestions?
Derek
@Dmdrapp
Jun 03 2017 01:04
Does this look right?
var myStr = "First Line\n\Second Line\\rThird Lin
e"
Nevermind! I see it.
Joshua
@jfc246
Jun 03 2017 01:04
ok i was just about to tell you!!
Joseph
@Big-jo
Jun 03 2017 01:04
@Dmdrapp please can you explain i skipped it
survenant
@survenant
Jun 03 2017 01:05
@Dmdrapp I just finished that one! we're in the same place. code on :)
Derek
@Dmdrapp
Jun 03 2017 01:05
I need to double check my typing...
Wait... It is showing the double backslash
survenant
@survenant
Jun 03 2017 01:06
I stared at the following challenge for awhile and realized it wasn't working because I was missing a word. hah.
AJ Brommy
@AJ-Brommy
Jun 03 2017 01:06
Get a finished page, then ask? It seems odd to me that you would be asking at this stage. It's your page, you are supposed to be the artist. Lay it how you want? Sure if you want to achieve something you are unsure how to achieve, then ask for help. So, my thoughts are, it looks ok with what you have done so far. Complete the mission. It's not for us to tell you how to build "your" page!
@jfc246
Joshua
@jfc246
Jun 03 2017 01:07
@AJ-Brommy ok
Derek
@Dmdrapp
Jun 03 2017 01:08
There had to be no spacing whatsoever? Haha
Joseph
@Big-jo
Jun 03 2017 01:08

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

  // Only change code below this line
 lookup ={
   "alpha":"Adams",
   "bravo":"boston",
   "charlie":"Chicago",
   "delta":"denver",
   "echo":"Essay",
   "foxtrot":"Frank"
 };


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

// Change this value to test
phoneticLookup("charlie");
what else after this i dont understand the "use it to look-up val"
oh i figured it out
sinsukh
@sinsukh
Jun 03 2017 01:20
Screen Shot 2017-06-02 at 9.17.11 PM.png
Hi, any help with this?
AJ Brommy
@AJ-Brommy
Jun 03 2017 01:22
I did it slightly differently but i think we have the same problem lol
You can't determine that a contact doesn't exist until it has looped through the whole array ;)
Manish Giri
@Manish-Giri
Jun 03 2017 01:23
@sinsukh you also need to "return" stuff
logging to console won't do anything
Jonathan Tuer
@N3M3SIS20
Jun 03 2017 01:23
hello everyone
AJ Brommy
@AJ-Brommy
Jun 03 2017 01:29
@sinsukh I also don't think contacts[i].prop will work, there was a challenge showing how to test if a property exists using .hasOwnProperty() which returns true or false ;)
frederickalcantara
@frederickalcantara
Jun 03 2017 01:30
who knows apis, ajax, and json stuff?
i needs help
Jonathan Tuer
@N3M3SIS20
Jun 03 2017 01:31
i MIGHT be able to assist
AJ Brommy
@AJ-Brommy
Jun 03 2017 01:31
sorry @frederickalcantara you have passed me :(
frederickalcantara
@frederickalcantara
Jun 03 2017 01:32
I want to know how come certain details on specific characters arent showing up?
To be specific, characters bran stark, jon snow, and arya stark are not showing their seasons and played by indexes
aRtoo
@artoodeeto
Jun 03 2017 01:35
hey guys need help. this is from the challenge seek and destroy.
function destroyer(arr) {

        var arrArg = [];

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

   return arr.filter(function eliminate(val){

            for(var c=0; c<arrArg.length; c++){   

                return arr.indexOf(arrArg[c]) !== -1;

            } 

   });
}

//destroyer([1, 2, 3, 1, 2, 3], 2, 3); //should return [1, 1].
//destroyer([1, 2, 3, 5, 1, 2, 3], 2, 3); //should return [1, 5, 1].
destroyer([3, 5, 1, 2, 2], 2, 3, 5); //should return [1].
Manish Giri
@Manish-Giri
Jun 03 2017 01:36
@artoodeeto why do you have a for loop in function eliminate
aRtoo
@artoodeeto
Jun 03 2017 01:37
@Manish-Giri thats for loop the array arrArg.
Manish Giri
@Manish-Giri
Jun 03 2017 01:38
why?
when you do this
arr.filter(function (val){
you can directly check if arrArg has the element val or not
return arrArg.indexOf()....
aRtoo
@artoodeeto
Jun 03 2017 01:40
@Manish-Giri what do you mean sir??
Jonathan Tuer
@N3M3SIS20
Jun 03 2017 01:43
in the twitch.tv api challenge, I seem to be able to get the data from the json object found by the url, howver the logo does not show, only this little pseudo picture. How can I make the actual logo show?
Manish Giri
@Manish-Giri
Jun 03 2017 01:43
check out the link
frederickalcantara
@frederickalcantara
Jun 03 2017 01:45
Hey @Manish-Giri can you help me explain why I am having an issue displaying specifics properties on certains objects? I am using a song of ice and fire api
Manish Giri
@Manish-Giri
Jun 03 2017 01:45
um okay
if you post the code
Ryan Nelson
@iamryandnelson
Jun 03 2017 01:46
xfGupRf.png
Does anyone have any experience with Isotope (jQuery plugin)?
frederickalcantara
@frederickalcantara
Jun 03 2017 01:47
I can send a link of the website if you need it
Manish Giri
@Manish-Giri
Jun 03 2017 01:48
you've got a lot of errors in the console
maybe fix those first
could be the reason
frederickalcantara
@frederickalcantara
Jun 03 2017 01:49
How?
hold on
try this one
sinsukh
@sinsukh
Jun 03 2017 01:50
@Manish-Giri @AJ-Brommy Thanks for your help guys!
CamperBot
@camperbot
Jun 03 2017 01:50
sinsukh sends brownie points to @manish-giri and @aj-brommy :sparkles: :thumbsup: :sparkles:
:cookie: 260 | @aj-brommy |http://www.freecodecamp.com/aj-brommy
:star2: 5804 | @manish-giri |http://www.freecodecamp.com/manish-giri
frederickalcantara
@frederickalcantara
Jun 03 2017 01:50
@Manish-Giri the link I just sent you should work
AJ Brommy
@AJ-Brommy
Jun 03 2017 01:50
@sinsukh have you fixed it and got it working then???
Manish Giri
@Manish-Giri
Jun 03 2017 01:53
Screenshot 2017-06-02 21.53.30.png
@frederickalcantara
frederickalcantara
@frederickalcantara
Jun 03 2017 01:55
try this site
that is really strange
mattr12
@mattr12
Jun 03 2017 01:56
Is there anyway to ensure a strict comparison === when translating an if-then statement to a switch statement?
frederickalcantara
@frederickalcantara
Jun 03 2017 01:57
You would have to set it on the intial condition
AJ Brommy
@AJ-Brommy
Jun 03 2017 02:01
Anyone explain to me why this seems to be an infinite loop. when num == 5....
for(var i = 1; i <= num; i++){
    num *= i;
  }
haha
got it
incase anyone does the same and is confused ...
for(var i = 1; i <= num; i++){
    result *= i;
  }
Mithun reddy
@mithunreddyt
Jun 03 2017 02:11
I have a question if the property we are trying to access has a space in it we will need to use bracket notation to find the property of the object.
What it mean by space can any one give example to it
AJ Brommy
@AJ-Brommy
Jun 03 2017 02:14
" "
"property with space"
"first name"
"first name": "AJ"
you couldn't access it via object.first name
so you would access it with the brackets
object["first name"]
because of the space
Mithun reddy
@mithunreddyt
Jun 03 2017 02:16
Do it mean the space between first and name
AJ Brommy
@AJ-Brommy
Jun 03 2017 02:16
yes
Jeremy
@JeremyAntonoff
Jun 03 2017 02:16
can someone help me understand a piece of code
AJ Brommy
@AJ-Brommy
Jun 03 2017 02:16
because it would break away from the not version, so you have to use brackets
*not = dot
Mithun reddy
@mithunreddyt
Jun 03 2017 02:17
@Aj Brommy Oh thankyou
CamperBot
@camperbot
Jun 03 2017 02:17
mithunreddyt sends brownie points to @aj :sparkles: :thumbsup: :sparkles:
:warning: @aj's account is not linked with freeCodeCamp. Please visit the settings and link your GitHub account.
AJ Brommy
@AJ-Brommy
Jun 03 2017 02:17
:)
Adilzhan Izat
@JaxAdam
Jun 03 2017 02:18
can anyone help me?
function isLess(a, b) {
  // Fix this code
   switch(a,b){
     case a,b:
       return true;

     case b,a:
       return false;
   }
}

// Change these values to test
isLess(15, 10);
Jeremy
@JeremyAntonoff
Jun 03 2017 02:19
you have commas instaed of <>?
Adilzhan Izat
@JaxAdam
Jun 03 2017 02:19
function isLess(a, b) {
  // Fix this code
  if (a < b) {
    return true;
  } else {
    return false;
  }
}

// Change these values to test
isLess(10, 15);
AJ Brommy
@AJ-Brommy
Jun 03 2017 02:20
that's true why are you doing switch?
Adilzhan Izat
@JaxAdam
Jun 03 2017 02:20
@JToddFL Was it to me?
AJ Brommy
@AJ-Brommy
Jun 03 2017 02:21
i've forgotten the switch format lol, but was meant to be use if multiple if else satements no?
Adilzhan Izat
@JaxAdam
Jun 03 2017 02:21
@AJ-Brommy Instuction: do this without if/else
AJ Brommy
@AJ-Brommy
Jun 03 2017 02:21
oh
yeah just return it
lol
Adilzhan Izat
@JaxAdam
Jun 03 2017 02:22
function isLess(a, b) {
  // Fix this code
   switch(a,b){
     case a,b:
       return true;

     case b,a:
       return false;
   }
}

// Change these values to test
isLess(15, 10);
AJ Brommy
@AJ-Brommy
Jun 03 2017 02:22
if a is less than b it will return true or false accordinglyy
Adilzhan Izat
@JaxAdam
Jun 03 2017 02:22
this code is not correct
AJ Brommy
@AJ-Brommy
Jun 03 2017 02:22
no its not
  return a < b;
it will return the result
Jeremy
@JeremyAntonoff
Jun 03 2017 02:23
@AJ-Brommy cany you help me understand a piece of code
Adilzhan Izat
@JaxAdam
Jun 03 2017 02:24
oh, than if I'll write this statement in function I'll get my result..
@AJ-Brommy thank u, I'm first time working with returns))
CamperBot
@camperbot
Jun 03 2017 02:24
jaxadam sends brownie points to @aj-brommy :sparkles: :thumbsup: :sparkles:
:cookie: 262 | @aj-brommy |http://www.freecodecamp.com/aj-brommy
AJ Brommy
@AJ-Brommy
Jun 03 2017 02:25
that is all is needed in the function because "return" returns the "result", everything to the right is worked out first, and the result goes into whatever is on the left, so if a is less than b true will be returned, and a is not less than b, false will be returned.
I haven't reached this challenge yet... and you've been working with returns for a long time! :P
@JToddFL I don't know without more info :)
Adilzhan Izat
@JaxAdam
Jun 03 2017 02:26
function isLess(a, b) {
  // Fix this code
 return a<b;
}
Jeremy
@JeremyAntonoff
Jun 03 2017 02:26
function findShortestWordAmongMixedElements(arr) {
  var shortest = '';
  if (arr.length > 0) {
    arr.forEach(function (each){
      if (typeof each === 'string') {
        if (shortest) {
          if (each.length < shortest.length) shortest = each;
        } else {
          shortest = each;
        }
      }
    });
  }
  return shortest;
}

var output = findShortestWordAmongMixedElements([[4, 'two', 2, 'three']]);
AJ Brommy
@AJ-Brommy
Jun 03 2017 02:27
@JaxAdam did it work?
Jeremy
@JeremyAntonoff
Jun 03 2017 02:27
particuilarly the if (shortest line)
AJ Brommy
@AJ-Brommy
Jun 03 2017 02:27
@JToddFL to be honest with you, I have only just begun basic algorithms
Jeremy
@JeremyAntonoff
Jun 03 2017 02:28
aww gotcha
AJ Brommy
@AJ-Brommy
Jun 03 2017 02:28
how far in is this one?
Adilzhan Izat
@JaxAdam
Jun 03 2017 02:29
@AJ-Brommy yes,
I did not know that return returns true if the condition written in it is true) And about false accordingly. I ask forgiveness for my English. In my country, few people study it.
AJ Brommy
@AJ-Brommy
Jun 03 2017 02:29
firstly im unsure, are the number 4 and 2 supposed to be converted to their string equivalent? :O
@JaxAdam it's ok, but it did come up in a previous challenge
Adilzhan Izat
@JaxAdam
Jun 03 2017 02:30
@AJ-Brommy
I apologize, that long answered. I just need to use an interpreter sometimes to bring thoughts
AJ Brommy
@AJ-Brommy
Jun 03 2017 02:31
No problems, that's why these challenges are set for us. You've learned it now :)
@JToddFL do we first need to filter out the numbers? and then from what is left count the characters in each word, perhaps by splitting them into an array and then using array.length? and so forth?

@JToddFL I haven't learned these...

arr.forEach(function (each){
      if (typeof each === 'string') {

where are you upto in the map???

Carmine Orientale
@Merinac
Jun 03 2017 02:36
hey guys, I'm currently stuck on the "Reverse a string" challenge under basic algorithms andddddd I haven't the slightest idea where to start.
AJ Brommy
@AJ-Brommy
Jun 03 2017 02:37
Damn man, not the slightest?!
the previous few challenges are a big help
.join .reverse .split etc
you need to take the string, pull it apart, re arrange into reverse order, and then join it back together
Adilzhan Izat
@JaxAdam
Jun 03 2017 02:48
What should I do to make the console display the value: "undefined"?
AJ Brommy
@AJ-Brommy
Jun 03 2017 02:48
??
it will automatically if something is undefined
if you are using console.log
and you try to use something that is undefined
I think?
Adilzhan Izat
@JaxAdam
Jun 03 2017 02:49

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

Hint
Remember that undefined is a keyword, not a string.

AJ Brommy
@AJ-Brommy
Jun 03 2017 02:49
i've actually only just started using console.log
Adilzhan Izat
@JaxAdam
Jun 03 2017 02:49
function abTest(a, b) {
  if(a<0){
    console.log("undefined");
  }
  if(b<0){
    console.log("undefined");
  }
  return Math.round(Math.pow(Math.sqrt(a) + Math.sqrt(b), 2));
}

// Change values below to test your code
abTest(2,2);
AJ Brommy
@AJ-Brommy
Jun 03 2017 02:50
return undefined;
take out ""
you are making it a string and not a keyword
using " and " makes strings
Adilzhan Izat
@JaxAdam
Jun 03 2017 02:50
keywords needn't "
sure?
AJ Brommy
@AJ-Brommy
Jun 03 2017 02:51
100%
var is a keyword
you don't do "var"
return is a keyword
Adilzhan Izat
@JaxAdam
Jun 03 2017 02:51
Oh, thank u again)
AJ Brommy
@AJ-Brommy
Jun 03 2017 02:51
you are welcome
Adilzhan Izat
@JaxAdam
Jun 03 2017 02:52
hmmm
not working
function abTest(a, b) {
  if(a<0){
    console.log(undefined);
  }
  if(b<0){
    console.log(undefined);
  }
  return Math.round(Math.pow(Math.sqrt(a) + Math.sqrt(b), 2));
}

// Change values below to test your code
abTest(2,2);
AJ Brommy
@AJ-Brommy
Jun 03 2017 02:53
if(a<0 || b < 0){
return undefined;
}
Mithun reddy
@mithunreddyt
Jun 03 2017 02:54
Can we write a||b<0
AJ Brommy
@AJ-Brommy
Jun 03 2017 02:54
it tells you "if a is less than 0 'OR' b is less than 0"
i believe that is how we do OR
Adilzhan Izat
@JaxAdam
Jun 03 2017 02:55
@AJ-Brommy Точно! Я забыл про "||"! Это означает "и"!
AJ Brommy
@AJ-Brommy
Jun 03 2017 02:55
? in English? lol
Adilzhan Izat
@JaxAdam
Jun 03 2017 02:55
@AJ-Brommy
Exactly! I forgot about "||"! It means "and"!
AJ Brommy
@AJ-Brommy
Jun 03 2017 02:55
no
Adilzhan Izat
@JaxAdam
Jun 03 2017 02:55
@JaxAdam sorry))
AJ Brommy
@AJ-Brommy
Jun 03 2017 02:55
&& is and
Adilzhan Izat
@JaxAdam
Jun 03 2017 02:56
@AJ-Brommy what is ||?
Mithun reddy
@mithunreddyt
Jun 03 2017 02:56
It works right but when I write in this way a||b < 0 it's not working
AJ Brommy
@AJ-Brommy
Jun 03 2017 02:56
OR!!!!!
Adilzhan Izat
@JaxAdam
Jun 03 2017 02:56
that was html?
AJ Brommy
@AJ-Brommy
Jun 03 2017 02:56
because you have to test each variable seperately
a < 0 OR b <0
Mithun reddy
@mithunreddyt
Jun 03 2017 02:56
Why can't we do it same time
AJ Brommy
@AJ-Brommy
Jun 03 2017 02:56
a < 0 || b < 0
ask the inventor :P
Adilzhan Izat
@JaxAdam
Jun 03 2017 02:57
Got it, thanks again!
Mithun reddy
@mithunreddyt
Jun 03 2017 02:58
My question is both gives the same right not for this but for general purpose
AJ Brommy
@AJ-Brommy
Jun 03 2017 02:58
in an english description of how you want it to function maybe
Mithun reddy
@mithunreddyt
Jun 03 2017 02:58
To make sure It makes me thing those statement is wrong
Joseph
@revisualize
Jun 03 2017 02:58
Hello!
Mithun reddy
@mithunreddyt
Jun 03 2017 02:59
@AJ-Brommy thanks
CamperBot
@camperbot
Jun 03 2017 02:59
mithunreddyt sends brownie points to @aj-brommy :sparkles: :thumbsup: :sparkles:
:cookie: 263 | @aj-brommy |http://www.freecodecamp.com/aj-brommy
AJ Brommy
@AJ-Brommy
Jun 03 2017 02:59
they gave it to you how they want it done "if a is less than 0 OR b is less than 0" they did not say "if a or b is less than zero".
Manish Giri
@Manish-Giri
Jun 03 2017 03:00
@mithunreddyt if a will just check if a is truthy
Mithun reddy
@mithunreddyt
Jun 03 2017 03:01
Got you
JuanDavid31
@JuanDavid31
Jun 03 2017 03:11
Hello, could someone help me with the Seek and Destroy challenge?
Ken Haduch
@khaduch
Jun 03 2017 03:18
@JuanDavid31 - I'm sure that someone will - please post your code and questions
Tsukuyomi19
@Tsukuyomi19
Jun 03 2017 03:27
Hey I need some help understanding my code

var count = 0;

function cc(card) {
// Only change code below this line
if(card>=2||card<=6){
count++;
}
else if(card==10||card=='J'||card=='Q'||card=='K'||card=='A'){
count--;
}
else if(card>=7||card<=0){
count+=0;
}
else if (count>0){
return count+" Bet";
}
else
return count+" Hold";
}

This is for the "Counting Cards" exercise. Why does it not out put anything after the cc(2); function is called?
Aata-allah
@Atalaa
Jun 03 2017 03:29
...
dd
...
Tsukuyomi19
@Tsukuyomi19
Jun 03 2017 03:29

...
var count = 0;

function cc(card) {
// Only change code below this line
if(card>=2||card<=6){
count++;
}
else if(card==10||card=='J'||card=='Q'||card=='K'||card=='A'){
count--;
}
else if(card>=7||card<=0){
count+=0;
}
else if (count>0){
return count+" Bet";
}
else
return count+" Hold";
...

Sorry this is the first time I used the chat trying to make my code more visible I'm a noob
Aata-allah
@Atalaa
Jun 03 2017 03:30
Hello somebody help ?
I need to retrieve the value of "joke" but i dont know how to do it
$(document).ready(function(){

  $(".btn").on("click", function(){
   var url = "https://api.icndb.com/jokes/random";
    $.getJSON(url, function(json){
      $(".quotes").html(JSON.stringify(json));

      json.forEach(function(val){


        }

      });


    });
  });
});
what to put in the loop ?
Manish Giri
@Manish-Giri
Jun 03 2017 03:33
study your api's return
{
  "type": "success",
  "value": {
    "id": 61,
    "joke": "Chuck Norris once ate a whole cake before his friends could tell him there was a stripper in it.",
    "categories": [

    ]
  }
}
this is what it returns
Aata-allah
@Atalaa
Jun 03 2017 03:34
Screen Shot 2017-06-02 at 10.26.44 PM.png
Manish Giri
@Manish-Giri
Jun 03 2017 03:34
it doesn't return an array, so why do you need a loop?
Aata-allah
@Atalaa
Jun 03 2017 03:34
@Manish-Giri i saw that but i want to display the joke value, i dont know how
Manish Giri
@Manish-Giri
Jun 03 2017 03:34
json.forEach(function(val){


        }
Aata-allah
@Atalaa
Jun 03 2017 03:34
cuz in the picture its an array objet
Manish Giri
@Manish-Giri
Jun 03 2017 03:34
this line
function(json){ - the variable json
represents
this object
{
  "type": "success",
  "value": {
    "id": 61,
    "joke": "Chuck Norris once ate a whole cake before his friends could tell him there was a stripper in it.",
    "categories": [

    ]
  }
}
so, json.value.joke
will give you "Chuck Norris once ate a whole cake before his friends could tell him there was a stripper in it."
Aata-allah
@Atalaa
Jun 03 2017 03:35
wait i dont see the function (json) line
Tsukuyomi19
@Tsukuyomi19
Jun 03 2017 03:35

```
var count = 0;

function cc(card) {
// Only change code below this line
if(card>=2||card<=6){
count++;
}
else if(card==10||card=='J'||card=='Q'||card=='K'||card=='A'){
count--;
}
else if(card>=7||card<=0){
count+=0;
}
else if (count>0){
return count+" Bet";
}
else
return count+" Hold";



>

{
"type": "success",
"value": {
"id": 61,
"joke": "Chuck Norris once ate a whole cake before his friends could tell him there was a stripper in it.",
"categories": [

]

}
}
```

Manish Giri
@Manish-Giri
Jun 03 2017 03:35
it's in your code man
Aata-allah
@Atalaa
Jun 03 2017 03:36
@Manish-Giri i wrote already json.value.joke but nothing happen
Manish Giri
@Manish-Giri
Jun 03 2017 03:36
it's not in the code you showed here
Aata-allah
@Atalaa
Jun 03 2017 03:37
yeah i tried it before and didnt work so i change for this one
wait i try again
i dont know how to do
$(document).ready(function(){

  $(".btn").on("click", function(){
   var url = "https://api.icndb.com/jokes/random";
    $.getJSON(url, function(json){
      $(".quotes").html(JSON.stringify(json));

        json.value.joke;

    });
  });
});
Manish Giri
@Manish-Giri
Jun 03 2017 03:40
json.value.joke;
you wrote this but what are you doing with it?
Aata-allah
@Atalaa
Jun 03 2017 03:41
thats i try to figure it out, i dont know, i still beginner
Manish Giri
@Manish-Giri
Jun 03 2017 03:41
it's not being saved in a variable, or printed
Aata-allah
@Atalaa
Jun 03 2017 03:41
ok
Manish Giri
@Manish-Giri
Jun 03 2017 03:41
$(".quotes").html(JSON.stringify(json));
what does this line do?
I assume you know since you wrote this code?
Aata-allah
@Atalaa
Jun 03 2017 03:42
i tried this
$(document).ready(function(){

  $(".btn").on("click", function(){
   var url = "https://api.icndb.com/jokes/random";
    $.getJSON(url, function(json){
      $(".quotes").html(JSON.stringify(json));

        var res = json.value.joke;
        $("h5").html(res);

    });
  });
});
Joseph
@revisualize
Jun 03 2017 03:42
@Tsukuyomi19 Did you solve your challenge?
Aata-allah
@Atalaa
Jun 03 2017 03:42
@Manish-Giri this line convert my javascript into json
Manish Giri
@Manish-Giri
Jun 03 2017 03:43
okay if you have an h5 in your code
that will work
@Atalaa
Aata-allah
@Atalaa
Jun 03 2017 03:43
@Manish-Giri im sorry to disturb you again but it didnt work the way i showed you
Manish Giri
@Manish-Giri
Jun 03 2017 03:44
any errors in the console?
Aata-allah
@Atalaa
Jun 03 2017 03:44
still have a raw Json
@Manish-Giri nope
Jason Luboff
@JLuboff
Jun 03 2017 03:44
@Manish-Giri Yo
Manish Giri
@Manish-Giri
Jun 03 2017 03:45
@JLuboff :wave:
howdy
@Atalaa post codepen link
Aata-allah
@Atalaa
Jun 03 2017 03:45
ok
chaitanya ashtekar
@chaitanyaashtekar
Jun 03 2017 03:45
@Manish-Giri _/\_
Jason Luboff
@JLuboff
Jun 03 2017 03:45
@Manish-Giri how's it going?
Manish Giri
@Manish-Giri
Jun 03 2017 03:46
@JLuboff very zombie-ish :sob:
thesis is killing me
how're things your end
@chaitanyaashtekar hey buddy long time
chaitanya ashtekar
@chaitanyaashtekar
Jun 03 2017 03:46
yup
Tsukuyomi19
@Tsukuyomi19
Jun 03 2017 03:46
@revisualize
I'm trying to understand it
chaitanya ashtekar
@chaitanyaashtekar
Jun 03 2017 03:47
@Manish-Giri MS completed ?
Manish Giri
@Manish-Giri
Jun 03 2017 03:47
@Atalaa $(".quotes").html(JSON.stringify(json));
comment out this line
your h5 is being overwritten
@chaitanyaashtekar almost there, another few weeks
Aata-allah
@Atalaa
Jun 03 2017 03:48
@Manish-Giri will try
chaitanya ashtekar
@chaitanyaashtekar
Jun 03 2017 03:48
good
Jason Luboff
@JLuboff
Jun 03 2017 03:48
@Manish-Giri doing alright. Just relaxing right now. Started the MongoDB 101 course this week. Looks promising. Has you build an e-commerce page by the end
Manish Giri
@Manish-Giri
Jun 03 2017 03:49
from the mongo website?
@JLuboff
Jason Luboff
@JLuboff
Jun 03 2017 03:49
Ya mongo university
Aata-allah
@Atalaa
Jun 03 2017 03:50
@Manish-Giri My savior, it works bro ! But why i must comment out this line ? Because another guy told me to do it, and in the course FCC they do it too
Manish Giri
@Manish-Giri
Jun 03 2017 03:50
@Atalaa you gotta understand your own code dude
don't bother about what other guys or fcc tells you
look at your html
<div class="quotes">
      <h5>Here the quote</h5>

    </div>
Aata-allah
@Atalaa
Jun 03 2017 03:51
ok
Manish Giri
@Manish-Giri
Jun 03 2017 03:51
@JLuboff Im kicking myself for not picking mongo for my thesis
Tsukuyomi19
@Tsukuyomi19
Jun 03 2017 03:51
var count = 0;
function cc(card) {
  // Only change code below this line
  if(card>=2||card<=6){
    count++;
  }
  else if(card==10||card=='J'||card=='Q'||card=='K'||card=='A'){
     count--;
  }
  else if(card>=7||card<=9){
    count+=0;
  }
  else if (count>0){
    return count+" Bet";
  }
  else 
    return count+" Hold";

  // Only change code above this line
}
Manish Giri
@Manish-Giri
Jun 03 2017 03:51
would've worked out so well
:sob:
@JLuboff
Aata-allah
@Atalaa
Jun 03 2017 03:51
so the line i comment out is useless ?@Manish-Giri
Tsukuyomi19
@Tsukuyomi19
Jun 03 2017 03:52
Why when I run the cc(2); it outputs nothing. I'm thinking I'm getting screwed up with the else if and if statements somewhere
Manish Giri
@Manish-Giri
Jun 03 2017 03:53
@Atalaa it's not useless, it's just overwriting your h5
try this
Jason Luboff
@JLuboff
Jun 03 2017 03:53
@Manish-Giri 😂😂
Manish Giri
@Manish-Giri
Jun 03 2017 03:53
 <div class="quotes">
    </div>
   <h5>Here the quote</h5>
and
$(".quotes").html(JSON.stringify(json));

        var res = json.value.joke;
        $("h5").html(res);
and see what happens
Aata-allah
@Atalaa
Jun 03 2017 03:53
ok
Manish Giri
@Manish-Giri
Jun 03 2017 03:53
@Atalaa
@Tsukuyomi19 this
else if (count>0){
    return count+" Bet";
  }
needs to be if
@JLuboff when's your trip?
Tsukuyomi19
@Tsukuyomi19
Jun 03 2017 03:54
Why is that
Aata-allah
@Atalaa
Jun 03 2017 03:55
@Manish-Giri oh ok i get it, i have a raw line and a quote line
@Manish-Giri so i will delete the wrong line (stringify one)
Jason Luboff
@JLuboff
Jun 03 2017 03:56
@Manish-Giri just got back late Wednesday night
Manish Giri
@Manish-Giri
Jun 03 2017 03:56
oh wow
how was it
Jason Luboff
@JLuboff
Jun 03 2017 03:56
It was alright. Had it's highlights
Aata-allah
@Atalaa
Jun 03 2017 03:57
@Manish-Giri Thank you
CamperBot
@camperbot
Jun 03 2017 03:57
atalaa sends brownie points to @manish-giri :sparkles: :thumbsup: :sparkles:
:star2: 5805 | @manish-giri |http://www.freecodecamp.com/manish-giri
Manish Giri
@Manish-Giri
Jun 03 2017 03:58
:+1:
Joseph
@revisualize
Jun 03 2017 04:00
@Tsukuyomi19 Question.
@Tsukuyomi19 Regarding: if(card>=2||card<=6){
Is 10 greaterthan or equal to 2?
Tsukuyomi19
@Tsukuyomi19
Jun 03 2017 04:02
Yes it is
Joseph
@revisualize
Jun 03 2017 04:02
@Tsukuyomi19 Okay so count++
@Tsukuyomi19 Aren't you supposed to -1 from count if the card is 10?
Tsukuyomi19
@Tsukuyomi19
Jun 03 2017 04:03
I see what you mean I was trying to set boundaries 2-6 count++
Joseph
@revisualize
Jun 03 2017 04:03
@Tsukuyomi19 You shouldn't or then. You should be doing and
Tsukuyomi19
@Tsukuyomi19
Jun 03 2017 04:03
yeah thats in the first else if statement there
Joseph
@revisualize
Jun 03 2017 04:04
@Tsukuyomi19 Then it would become if card is greaterthan or equal to 2 and card is lessthan or equal to 6.
Tsukuyomi19
@Tsukuyomi19
Jun 03 2017 04:04
Yeah I screwed up
&& is the right expression
@revisualize Thanks a bunch
CamperBot
@camperbot
Jun 03 2017 04:05
tsukuyomi19 sends brownie points to @revisualize :sparkles: :thumbsup: :sparkles:
:star2: 4089 | @revisualize |http://www.freecodecamp.com/revisualize
Joseph
@revisualize
Jun 03 2017 04:05
@Tsukuyomi19 Does it work now?
Tsukuyomi19
@Tsukuyomi19
Jun 03 2017 04:05
Yep works now
It was easier when I used case statements instead but I was trying to understand why my if/else solution was failing
AT Will
@Atsoamazed
Jun 03 2017 04:08

I am stuck on the camalcase assignment. I changed the name to so the name is useing cameCase. It is still failing. What is this asking for

2
// Declarations
var studlyCapvar;
var properCamelcase;
var titleCaseover;

// Assignments

studlyCapvar = 10;
properCamelase = "A String";
titleCaseover = 9000;

Joseph
@revisualize
Jun 03 2017 04:09
@Atsoamazed You're missing some uppercase characters
@Atsoamazed You need to use proper camel case.
varValueLikeThis
thisIsALongValue
Markus Ivancsics
@ivancsicsmarkus
Jun 03 2017 04:11
@Atsoamazed You are also missing a "c"
properCamelase = "A String";
AT Will
@Atsoamazed
Jun 03 2017 04:11
oooooh okay, thanks!
I thought it wanted just camalCase
AT Will
@Atsoamazed
Jun 03 2017 04:16
thanks @revisualize @ivancsicsmarkus
CamperBot
@camperbot
Jun 03 2017 04:16
atsoamazed sends brownie points to @revisualize and @ivancsicsmarkus :sparkles: :thumbsup: :sparkles:
:cookie: 566 | @ivancsicsmarkus |http://www.freecodecamp.com/ivancsicsmarkus
:star2: 4090 | @revisualize |http://www.freecodecamp.com/revisualize
Carmine Orientale
@Merinac
Jun 03 2017 04:24
@AJ-Brommy you still up here aj?
Aata-allah
@Atalaa
Jun 03 2017 04:25

can somebody explain to me why i dont have the shadow hover effect for my "new quote" button please ?

<div class = "container-fluid">

    <h1>Random Quote Machine</h1>
    <p id = "description">
    Here are some of the best known     cinematographic quotes. Will you succeed in guessing them ?
    </p>
    <div class="text-center w3-container">
      <button type="button" class="btn w3-btn w3-black">New Quote</button>
    </div>    
    <div class="quotes">
      <h5 id="chuck"></h5>
    </div>

https://codepen.io/Atalaa/pen/ZyEEEY

Markus Ivancsics
@ivancsicsmarkus
Jun 03 2017 04:27
@Atalaa Because you are not adding any shadow hover effect.
Aata-allah
@Atalaa
Jun 03 2017 04:28
@ivancsicsmarkus u mean in css ?
Markus Ivancsics
@ivancsicsmarkus
Jun 03 2017 04:28
@Atalaa Yes.
Good starting point:
.btn:hover{
  box-shadow: 1px 1px 3px 1px black;
}
Aata-allah
@Atalaa
Jun 03 2017 04:29
@ivancsicsmarkus oh sorry thank you i forgot lol
CamperBot
@camperbot
Jun 03 2017 04:29
atalaa sends brownie points to @ivancsicsmarkus :sparkles: :thumbsup: :sparkles:
:cookie: 567 | @ivancsicsmarkus |http://www.freecodecamp.com/ivancsicsmarkus
Juan
@jfiguer0
Jun 03 2017 04:50
can't pass .lenght challenge. This is my code:
image.png
Markus Ivancsics
@ivancsicsmarkus
Jun 03 2017 04:50
@jfiguer0 Hello!
@jfiguer0 Reload the page!
Juan
@jfiguer0
Jun 03 2017 04:52
hey @ivancsicsmarkus i checked my code with other forums and it looks correct. I reloaded and cleared it but it still won't take it.
Markus Ivancsics
@ivancsicsmarkus
Jun 03 2017 04:53
@jfiguer0 Paste this:
// Example
var firstNameLength = 0;
var firstName = "Ada";

firstNameLength = firstName.length;

// Setup
var lastNameLength = 0;
var lastName = "Lovelace";

// Only change code below this line.

lastNameLength = lastName.length;
@jfiguer0 Maybe there is an unnecessary char in your code or I don’t know.
@jfiguer0 There are really weird bugs.
Juan
@jfiguer0
Jun 03 2017 04:54
@ivancsicsmarkus that worked, but it looks the same as the one I had. So was my code right?
Markus Ivancsics
@ivancsicsmarkus
Jun 03 2017 04:55
@jfiguer0 Yes, exactly.
Juan
@jfiguer0
Jun 03 2017 04:55
@ivancsicsmarkus Thank you for your help.
CamperBot
@camperbot
Jun 03 2017 04:55
jfiguer0 sends brownie points to @ivancsicsmarkus :sparkles: :thumbsup: :sparkles:
:cookie: 568 | @ivancsicsmarkus |http://www.freecodecamp.com/ivancsicsmarkus
Markus Ivancsics
@ivancsicsmarkus
Jun 03 2017 04:56
@jfiguer0 You will use length property a lot. :)
@jfiguer0 Have a nice day!
ThisUserDominates
@ThisUserDominates
Jun 03 2017 04:56
help plz
Ankit Padia
@InsaneSkull
Jun 03 2017 04:59
@ThisUserDominates
var firstNameLength = 0;
var firstName = "Ada";

firstNameLength = firstName.length;

// Setup
var lastNameLength = 0;
var lastName = "Lovelace";

// Only change code below this line.


lastNameLength = lastName.length;
Ogundele Olumide
@Lumexralph
Jun 03 2017 04:59
@ThisUserDominates assign the length of lastName variable to lastNameLength
An-mode
@an-mode
Jun 03 2017 05:05
hello world ! I was creatinga code for reversing a string but am unable to understand why my array variable "temp" was coming out of scope when it is a part of the same funcation and is defined in it:

function reverseString(str) {
var string=[];

string=str.split('');
var strLength=string.length;
for(var i=string.length;i>0;i--)
{
var temp=[];
var change=strLength-i;
temp[change]=string[i-1];
}

temp=((string.reverse()));
str=temp.join("");
return str;

//return string;
}

reverseString("Dhruv");

holland11
@holland11
Jun 03 2017 05:06
i'm having trouble coming up with an algorithm efficient enough to compute the smallest common multiple of a group of numbers
Ogundele Olumide
@Lumexralph
Jun 03 2017 05:07
@an-mode every time the loop iterates it resets the value of temp to an empty array
An-mode
@an-mode
Jun 03 2017 05:08
@Lumexralph thank you mate... that solves it. :). Do i assume this is not a matter of scope?
CamperBot
@camperbot
Jun 03 2017 05:08
an-mode sends brownie points to @lumexralph :sparkles: :thumbsup: :sparkles:
:star2: 1863 | @lumexralph |http://www.freecodecamp.com/lumexralph
Rick Riggs
@wikiwiggs
Jun 03 2017 05:09
Anyone familiar with React?
Ogundele Olumide
@Lumexralph
Jun 03 2017 05:09
@an-mode it's..... temp is local scope to the loop
AJ
@ShinobiDatCodes
Jun 03 2017 05:10
Hello guys, got a question regarding the hasOwnProperty() method.
Manish Giri
@Manish-Giri
Jun 03 2017 05:10
@wikiwiggs kinda
@Lumexralph :wave:
good morning
Ogundele Olumide
@Lumexralph
Jun 03 2017 05:10
@ShinobiDatCodes shoot
An-mode
@an-mode
Jun 03 2017 05:10
@Lumexralph ohh.. did not know.. Thanks much !
CamperBot
@camperbot
Jun 03 2017 05:10
an-mode sends brownie points to @lumexralph :sparkles: :thumbsup: :sparkles:
:warning: an-mode already gave lumexralph points
Ogundele Olumide
@Lumexralph
Jun 03 2017 05:10
@Manish-Giri Bro! gggm :smiling_imp:
Manish Giri
@Manish-Giri
Jun 03 2017 05:11
:smiling_imp:
Rick Riggs
@wikiwiggs
Jun 03 2017 05:11
@Manish-Giri I'm just picking it up trying to learn it, and I'm not sure what I am doing wrong, you care to look at my code pen? It's super basic but won't do what I expect it to.
https://codepen.io/wikiwiggs/pen/vZBWLj
AJ
@ShinobiDatCodes
Jun 03 2017 05:12
@Lumexralph so, from the explanation, I have to use the syntax of quoting the property name. For example if my property name is Car, I use variable.hasOwnProperty("Car")
Ogundele Olumide
@Lumexralph
Jun 03 2017 05:12
@ShinobiDatCodes if variable is an object yes
Manish Giri
@Manish-Giri
Jun 03 2017 05:12
@wikiwiggs getDefaultState: function () this is the problem
it's called getInitialState
for props it's getDefaultProps
you prolly mixed the two
Rick Riggs
@wikiwiggs
Jun 03 2017 05:13
Yeah I did, thanks @Manish-Giri
CamperBot
@camperbot
Jun 03 2017 05:13
wikiwiggs sends brownie points to @manish-giri :sparkles: :thumbsup: :sparkles:
:star2: 5807 | @manish-giri |http://www.freecodecamp.com/manish-giri
Ogundele Olumide
@Lumexralph
Jun 03 2017 05:13
@Manish-Giri i need to resume my react, still in python world
Manish Giri
@Manish-Giri
Jun 03 2017 05:13
np
@Lumexralph teach me python
AJ
@ShinobiDatCodes
Jun 03 2017 05:13
@Lumexralph Correct. the problem I have is that I want to use hasOwnProperty() inside of a function, and I cannot for the life of me get the property name inside of quotations without turning it into a string. This is what I mean:
// Setup
var myObj = {
  gift: "pony",
  pet: "kitten",
  bed: "sleigh"
};

function checkObj(checkProp) {
  // Your Code Here
  var CP=checkProp;

  var answer=myObj.hasOwnProperty(CP);

  if (answer===true){
    answer=myObj.checkProp;
  }
  else if (answer===false){
    answer="Not Found";
  }
  return CP;
}

// Test your code by modifying these values
checkObj("gift");
Ogundele Olumide
@Lumexralph
Jun 03 2017 05:14
@Manish-Giri :smirk:
Manish Giri
@Manish-Giri
Jun 03 2017 05:14
:smiling_imp:
Ogundele Olumide
@Lumexralph
Jun 03 2017 05:15
@ShinobiDatCodes checkProp is a parameter, dot notation to access the object myObj won't work
Manish Giri
@Manish-Giri
Jun 03 2017 05:15
also, you're complicating the code
unnecessarily
Ogundele Olumide
@Lumexralph
Jun 03 2017 05:15
@Manish-Giri OOP is very direct in python , JS gives you different ways
Manish Giri
@Manish-Giri
Jun 03 2017 05:16
@Lumexralph like def Child(Parent):
?
Ogundele Olumide
@Lumexralph
Jun 03 2017 05:16
@Manish-Giri and JS still fools people with class :joy:
AJ
@ShinobiDatCodes
Jun 03 2017 05:16
@Lumexralph I have tried putting checkProp using "/"checkProp/"", then I replaced checkProp for a second variable name CP, I tried putting it as "/"CP/"" but it keeps turning it into a string. If I put checkProp inside hasOwnProperty directly as is, I get hasOwnProperty(checkProp) no quotations, and the code won't run. I know the answer must be simple but it won't run.
Manish Giri
@Manish-Giri
Jun 03 2017 05:16
hehe
@Lumexralph how's Osun
Ogundele Olumide
@Lumexralph
Jun 03 2017 05:18
@Manish-Giri class Child(parent):
AJ
@ShinobiDatCodes
Jun 03 2017 05:18
@Lumexralph ok. so I cannot use the parameter inside myObj?
Manish Giri
@Manish-Giri
Jun 03 2017 05:18
ooh yes now I remember
Rick Riggs
@wikiwiggs
Jun 03 2017 05:18
couldn't you check to see: if (typeof myObj[checkProp] == "undefined") { ... } else { ... }
Ogundele Olumide
@Lumexralph
Jun 03 2017 05:19
@ShinobiDatCodes what parameter? i'm talking about the way you're accessing the object myObj
@Manish-Giri Osun is cool, should be travellling down to Lagos today but not decided
@Manish-Giri Osun is cool, should be travellling down to Lagos today but not decided
Joseph
@revisualize
Jun 03 2017 05:20
Hi.
Manish Giri
@Manish-Giri
Jun 03 2017 05:20
@Lumexralph how you wake up so early is beyond me
you must teach me
Joseph
@revisualize
Jun 03 2017 05:20
@wikiwiggs undefined
AJ
@ShinobiDatCodes
Jun 03 2017 05:20
@Lumexralph you mean the line inside the If statement? or the myObj right before?
Manish Giri
@Manish-Giri
Jun 03 2017 05:21
I usually get to bed by 5-6 am
Rick Riggs
@wikiwiggs
Jun 03 2017 05:21
@revisualize ???
AJ
@ShinobiDatCodes
Jun 03 2017 05:21
@wikiwiggs let me see.
Joseph
@revisualize
Jun 03 2017 05:21
@wikiwiggs Nevermind.
@wikiwiggs It is actually a string 'undefined' I thought it was just the valueundefined
Ogundele Olumide
@Lumexralph
Jun 03 2017 05:22
@ShinobiDatCodes how many ways can you access an object ?
Joseph
@revisualize
Jun 03 2017 05:22
@wikiwiggs You could. But, the lesson wants you to learn .hasOwnProperty()
AJ
@ShinobiDatCodes
Jun 03 2017 05:26
@Lumexralph I know you can use brackets as well. I am using a variable right now I think. The problem I think I have is that both dot and bracket require quotation marks, and what I am putting inside is the parameter for the function checkObj.
@Manish-Giri I am gonna keep reading your article. I am so slow at catching on.
Ogundele Olumide
@Lumexralph
Jun 03 2017 05:28
@ShinobiDatCodes you can use variable with bracket notation
Manish Giri
@Manish-Giri
Jun 03 2017 05:28
@ShinobiDatCodes okay, well the article has the answer as to why your code won't work.
at least one of the reasons why.
Rick Riggs
@wikiwiggs
Jun 03 2017 05:28
@ShinobiDatCodes The parameter being passed is a string value in quotation marks, so when used as a variable it is a symbolic substitute for "gift"
Manish Giri
@Manish-Giri
Jun 03 2017 05:28
the other reason being your return statement.
AJ
@ShinobiDatCodes
Jun 03 2017 05:29
@wikiwiggs so it is still read as "gift" even though when I test the output of just checkProp it shows gift without quotations?
Manish Giri
@Manish-Giri
Jun 03 2017 05:29
the other reason being your return statement.
that's because of this
@ShinobiDatCodes
AJ
@ShinobiDatCodes
Jun 03 2017 05:30
@Manish-Giri yeah don't pay attention to that, I had changed it when I copied the code, I was testing what checkProp was outputting, I changed it back to what it was originally, which was answer.
Manish Giri
@Manish-Giri
Jun 03 2017 05:31
great
Rick Riggs
@wikiwiggs
Jun 03 2017 05:31
@ShinobiDatCodes how are you testing the type?
Manish Giri
@Manish-Giri
Jun 03 2017 05:31
next time maybe don't post code which you know is wrong
AJ
@ShinobiDatCodes
Jun 03 2017 05:31
@Manish-Giri I was just testing your powers of observation...
@wikiwiggs this is what I got:
// Setup
var myObj = {
  gift: "pony",
  pet: "kitten",
  bed: "sleigh"
};

function checkObj(checkProp) {
  // Your Code Here
  var CP=checkProp;

  var answer=myObj.hasOwnProperty(CP);

  if (answer===true){
    answer=myObj .checkProp;
  }
  else if (answer===false){
    answer="Not Found";
  }
  return answer;
}

// Test your code by modifying these values
checkObj("gift");
as it is right now, just looking at var answer=myObj.hasOwnProperty(CP); would the program read CP as gift or "gift" ? I know the syntax is not correct but just humor me.
AJ
@ShinobiDatCodes
Jun 03 2017 05:37
@Manish-Giri alright, got it from the article. Told you I was slow. @Lumexralph Thanks, it was bracket notation. @wikiwiggs Thank you as well.
CamperBot
@camperbot
Jun 03 2017 05:37
shinobidatcodes sends brownie points to @manish-giri and @lumexralph and @wikiwiggs :sparkles: :thumbsup: :sparkles:
:cookie: 324 | @wikiwiggs |http://www.freecodecamp.com/wikiwiggs
:star2: 1864 | @lumexralph |http://www.freecodecamp.com/lumexralph
:star2: 5808 | @manish-giri |http://www.freecodecamp.com/manish-giri
Sandip Shrestha
@saninmersion
Jun 03 2017 05:38
@ShinobiDatCodes "gift" is a string. your checkProp is a variable with a string value gift. so again CP will be a variable with a string value gift not a string value "gift"
AJ
@ShinobiDatCodes
Jun 03 2017 05:40
@saninmersion I see now. Thanks you!
CamperBot
@camperbot
Jun 03 2017 05:40
shinobidatcodes sends brownie points to @saninmersion :sparkles: :thumbsup: :sparkles:
:cookie: 496 | @saninmersion |http://www.freecodecamp.com/saninmersion
Mohit Nandwani
@mohitnandwani
Jun 03 2017 05:59
Hey! I'm stuck at stand in line exercise
Write a function nextInLine which takes an array (arr) and a number (item) as arguments. Add the number to the end of the array, then remove the first element of array. The nextInLine function should then return the element that was removed.
Mohit Nandwani
@mohitnandwani
Jun 03 2017 06:04

function nextInLine(arr, item) {
// Your code here
function nextInLine(arr, item){
arr = [2];
item = 1;
}
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));

Saif Ur Rahman
@saifsmailbox98
Jun 03 2017 06:05
@mohitnandwani use push() to add the item to the array arr
@mohitnandwani and shift() to remove and return the first element.
Joshua Frias
@Juke-Magic
Jun 03 2017 06:14
hey guys
can anyone answer my question
on javascript?
is anyone on??
abraham anak agung
@padunk
Jun 03 2017 06:17
@21-Orange maybe, i am new too :)
Joshua Frias
@Juke-Magic
Jun 03 2017 06:17
@padunk hey haha
you on javascript??
abraham anak agung
@padunk
Jun 03 2017 06:18
yes, i am
Joshua Frias
@Juke-Magic
Jun 03 2017 06:18
you on the last parts??
abraham anak agung
@padunk
Jun 03 2017 06:19
working on my calculator now
Joshua Frias
@Juke-Magic
Jun 03 2017 06:19
im on basic javascript :)
did you finish this problem already
Find Numbers with Regular Expressions
CamperBot
@camperbot
Jun 03 2017 06:19
find numbers with regular expressions
nothing found
abraham anak agung
@padunk
Jun 03 2017 06:20
where is your code? @21-Orange maybe i can help
Joshua Frias
@Juke-Magic
Jun 03 2017 06:20
nah its just a clarification
var expression = /\d+/g;
what is + for??
Saif Ur Rahman
@saifsmailbox98
Jun 03 2017 06:21
@21-Orange for one or more
abraham anak agung
@padunk
Jun 03 2017 06:21
1 or more number
Joshua Frias
@Juke-Magic
Jun 03 2017 06:21
can you give an example??
what if i didnt put +?
Saif Ur Rahman
@saifsmailbox98
Jun 03 2017 06:21
@21-Orange then it will only pass for one digit
@21-Orange you can put * for zero or more
abraham anak agung
@padunk
Jun 03 2017 06:22
try it here https://regex101.com
Saif Ur Rahman
@saifsmailbox98
Jun 03 2017 06:22
or use {n} where n is the exact number of digits
Joshua Frias
@Juke-Magic
Jun 03 2017 06:22
ok here
"There are 3 cats but 4 dogs."
if i didnt put +, will it stop at 3?
abraham anak agung
@padunk
Jun 03 2017 06:23
yes @21-Orange , yup you need to use global for match 3 and 4 like Mr. Saif said
Saif Ur Rahman
@saifsmailbox98
Jun 03 2017 06:23
@21-Orange use global
Joshua Frias
@Juke-Magic
Jun 03 2017 06:23
wait wait
var expression = /\d/g;
still outputs 2
Saif Ur Rahman
@saifsmailbox98
Jun 03 2017 06:24
yes @21-Orange if he puts + he will find nothing
@21-Orange because 2 matches are found
Joshua Frias
@Juke-Magic
Jun 03 2017 06:24
@saifsmailbox98 i thought it stops at 3?
Manish Giri
@Manish-Giri
Jun 03 2017 06:25
if i didnt put +, will it stop at 3?
no
Joshua Frias
@Juke-Magic
Jun 03 2017 06:25
so i should only be 1?
Manish Giri
@Manish-Giri
Jun 03 2017 06:25
it doesn't work like that
3 and 4 are separate
Joshua Frias
@Juke-Magic
Jun 03 2017 06:25
sorry im so slow hahaha
Manish Giri
@Manish-Giri
Jun 03 2017 06:25
so irrespective of + or no +
you'll get 2 matches
Joshua Frias
@Juke-Magic
Jun 03 2017 06:25
@Manish-Giri what is + for?
Manish Giri
@Manish-Giri
Jun 03 2017 06:25
+ works if you have multiple numbers grouped together
like 333444
try it out and see the difference yourself
Joshua Frias
@Juke-Magic
Jun 03 2017 06:26
awwwwww
Manish Giri
@Manish-Giri
Jun 03 2017 06:26
http://regexr.com/ - this is a good site to test
Joshua Frias
@Juke-Magic
Jun 03 2017 06:26
@Manish-Giri thank you hahahah
CamperBot
@camperbot
Jun 03 2017 06:26
21-orange sends brownie points to @manish-giri :sparkles: :thumbsup: :sparkles:
:star2: 5810 | @manish-giri |http://www.freecodecamp.com/manish-giri
Manish Giri
@Manish-Giri
Jun 03 2017 06:26
np
Joshua Frias
@Juke-Magic
Jun 03 2017 06:26
@saifsmailbox98 @padunk thank you aswell!!
CamperBot
@camperbot
Jun 03 2017 06:26
21-orange sends brownie points to @saifsmailbox98 and @padunk :sparkles: :thumbsup: :sparkles:
:cookie: 335 | @saifsmailbox98 |http://www.freecodecamp.com/saifsmailbox98
:cookie: 333 | @padunk |http://www.freecodecamp.com/padunk
Mohit Nandwani
@mohitnandwani
Jun 03 2017 06:26
@saifsmailbox98 what needs to be changed here?
return item; // Change this line
Saif Ur Rahman
@saifsmailbox98
Jun 03 2017 06:27
@mohitnandwani use shift() read the docs
abraham anak agung
@padunk
Jun 03 2017 06:27
@21-Orange you are welcome. Regex is hard for me :smile:
Saif Ur Rahman
@saifsmailbox98
Jun 03 2017 06:27
@mohitnandwani arr.shift(); removes the first element and returns it
barry01000010
@barry01000010
Jun 03 2017 06:28
reverse a string has got me in reverse SOS help please
Manish Giri
@Manish-Giri
Jun 03 2017 06:29
@barry01000010 what's the problem?
Sandip Shrestha
@saninmersion
Jun 03 2017 06:29
@barry01000010 did you use Array.reverse()
Mohit Nandwani
@mohitnandwani
Jun 03 2017 06:30
@saifsmailbox98 okay so i have to return arr.shift(); ?
Saif Ur Rahman
@saifsmailbox98
Jun 03 2017 06:30
@mohitnandwani yes
barry01000010
@barry01000010
Jun 03 2017 06:31
do i leave the original function there and add others or include it in the function that is already there? I am fully lost here
Manish Giri
@Manish-Giri
Jun 03 2017 06:32
your code goes in the existing function body
Saif Ur Rahman
@saifsmailbox98
Jun 03 2017 06:32
@barry01000010 there must be comments in your code that says //Change code below thisline or //Your code here
barry01000010
@barry01000010
Jun 03 2017 06:32
nope @saifsmailbox98
Mohit Nandwani
@mohitnandwani
Jun 03 2017 06:33
@saifsmailbox98 Got it! Thanks :+1:
CamperBot
@camperbot
Jun 03 2017 06:33
mohitnandwani sends brownie points to @saifsmailbox98 :sparkles: :thumbsup: :sparkles:
:cookie: 336 | @saifsmailbox98 |http://www.freecodecamp.com/saifsmailbox98
Saif Ur Rahman
@saifsmailbox98
Jun 03 2017 06:33
@barry01000010 try reset, you need to only change the code within the function provided
so that the predefined function calls will be valid.
Ogundele Olumide
@Lumexralph
Jun 03 2017 06:34
@Manish-Giri how do you know I wake early? we're not in same timezone
Manish Giri
@Manish-Giri
Jun 03 2017 06:34
I assume you wake up about 30-40 mins before you log in here
and I know what time it is in your area at that time
so :smiling_imp:
Varun
@varunzxzx
Jun 03 2017 06:36
function lookUpProfile(firstName, prop){
// Only change code below this line
var i=0;
while (i<contacts.length)
{
if (contacts[i].firstName === firstName) {
if(contacts[i][prop] === prop) {
return contacts[i][prop];
}
else
return "No such property";
}
}
return "No such contact";
// Only change code above this line
}
what is wrong in this code? It is from Profile Lookup
Ogundele Olumide
@Lumexralph
Jun 03 2017 06:36
@Manish-Giri :joy:
ggggggggggm :smiling_imp:
Saif Ur Rahman
@saifsmailbox98
Jun 03 2017 06:36
@varunzxzx put i++;
@varunzxzx in the while loop
Manish Giri
@Manish-Giri
Jun 03 2017 06:37
:smiling_imp: :smiling_imp:
Varun
@varunzxzx
Jun 03 2017 06:37
@saifsmailbox98 it is not working
Ogundele Olumide
@Lumexralph
Jun 03 2017 06:37
@varunzxzx if(contacts[i][prop] === prop) { you need to check if it has a property stored in prop
Joshua Frias
@Juke-Magic
Jun 03 2017 06:37
hey guys
why use this.wheels
not "wheels"
barry01000010
@barry01000010
Jun 03 2017 06:38
Thank you
Saif Ur Rahman
@saifsmailbox98
Jun 03 2017 06:38
@varunzxzx use hasOwnProperty(prop)
Joshua Frias
@Juke-Magic
Jun 03 2017 06:39
@Manish-Giri can you help me
Ogundele Olumide
@Lumexralph
Jun 03 2017 06:39
@Manish-Giri just converted a code from JS to PY
Manish Giri
@Manish-Giri
Jun 03 2017 06:39
@21-Orange this refers to the object
Joshua Frias
@Juke-Magic
Jun 03 2017 06:39
@Manish-Giri how it diffrent from "wheel"
Manish Giri
@Manish-Giri
Jun 03 2017 06:39
this.wheels therefore refers to the wheels property ON that object
@Lumexralph OOP code?
Joshua Frias
@Juke-Magic
Jun 03 2017 06:40
"wheels":4,
"engines":1,
"seats":5
this.wheels = 4;
this.engines = 1;
this.seats = 5;
Varun
@varunzxzx
Jun 03 2017 06:40
@saifsmailbox98 How I will return the value of that poperty?
Saif Ur Rahman
@saifsmailbox98
Jun 03 2017 06:40
obj[prop]
@varunzxzx
contacts[i][prop]
Varun
@varunzxzx
Jun 03 2017 06:41
if(hasOwnProperty(prop)) {
return contacts[i][prop];
}
is it correct?
Joshua Frias
@Juke-Magic
Jun 03 2017 06:41
@Manish-Giri whats so different from the two?
@21-Orange
"wheels":4,
"engines":1,
"seats":5
this.wheels = 4;
this.engines = 1;
this.seats = 5;
Saif Ur Rahman
@saifsmailbox98
Jun 03 2017 06:41
@varunzxzx if(hasOwnProperty(prop)
this line is still incorrect
Varun
@varunzxzx
Jun 03 2017 06:41
why?
Ogundele Olumide
@Lumexralph
Jun 03 2017 06:41
@Manish-Giri just functions
Saif Ur Rahman
@saifsmailbox98
Jun 03 2017 06:41
if(contacts[i].hasOwnProperty(prop))
@varunzxzx
Ogundele Olumide
@Lumexralph
Jun 03 2017 06:42
@varunzxzx where's the object you're checking the property from ?
Joshua Frias
@Juke-Magic
Jun 03 2017 06:42
@Lumexralph its at the top
the contacts :)
Varun
@varunzxzx
Jun 03 2017 06:42
@saifsmailbox98 thanks it worked
CamperBot
@camperbot
Jun 03 2017 06:42
varunzxzx sends brownie points to @saifsmailbox98 :sparkles: :thumbsup: :sparkles:
:cookie: 337 | @saifsmailbox98 |http://www.freecodecamp.com/saifsmailbox98
Manish Giri
@Manish-Giri
Jun 03 2017 06:42
@21-Orange did you try writing some code to figure out the difference between the two?
Joshua Frias
@Juke-Magic
Jun 03 2017 06:42
@Manish-Giri nope
Manish Giri
@Manish-Giri
Jun 03 2017 06:42
I told you this the last time as well, for the regex challenge
try to run this
var obj = {
  wheels: 4,
  printInfo: function() {
    console.log("Number of wheels = " + this.wheels);
  }
}

console.log(obj.printInfo());


var obj1 = {
  wheels: 4,
  printInfo: function() {
    console.log("Number of wheels = " + wheels);
  }
}

console.log(obj1.printInfo());
see what output you get
@Lumexralph till today I didn't understand why I don't like Python that much
maybe because of the indentation rules, or maybe it feels too lax?
who knows
Ogundele Olumide
@Lumexralph
Jun 03 2017 06:45
@Manish-Giri the awesomeness of JS and Java ? I had to study python for a company but kind of like the potentials eventually
Manish Giri
@Manish-Giri
Jun 03 2017 06:45
yeah I guess so
Vikas Saraf
@saraf007
Jun 03 2017 06:45

// Setup
function abTest(a, b) {
// Only change code below this line

// Only change code above this line

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

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

plz explain
Modify the function abTest so that if a or b are less than 0 the function will immediately exit with a value of undefined.
Ogundele Olumide
@Lumexralph
Jun 03 2017 06:46
@saraf007 if a is less than 0 or b is less than 0 return undefined
Joshua Frias
@Juke-Magic
Jun 03 2017 06:47
@Manish-Giri it just output {}
outputs*
Saif Ur Rahman
@saifsmailbox98
Jun 03 2017 06:47
@saraf007 why are you using return Math.round(Math.pow(Math.sqrt(a) + Math.sqrt(b), 2));
Ogundele Olumide
@Lumexralph
Jun 03 2017 06:47
@Manish-Giri i have a feeling it'll be 70% JS and 30% PY for me going forward
Vikas Saraf
@saraf007
Jun 03 2017 06:47
i know but there cant be 2 return statements in one function
Manish Giri
@Manish-Giri
Jun 03 2017 06:47
@21-Orange ?
you don't get anything else in the console?
Sandip Shrestha
@saninmersion
Jun 03 2017 06:47
@saraf007
// Only change code below this line // Only change code above this line this and you still change the line below those
Manish Giri
@Manish-Giri
Jun 03 2017 06:48
@saifsmailbox98 why are you posting answers?
Saif Ur Rahman
@saifsmailbox98
Jun 03 2017 06:48
@Manish-Giri sorry
Ogundele Olumide
@Lumexralph
Jun 03 2017 06:48
@saifsmailbox98 it's good if a code is readable :wink: i understand though
Joshua Frias
@Juke-Magic
Jun 03 2017 06:48
@Manish-Giri yep
Manish Giri
@Manish-Giri
Jun 03 2017 06:49
@21-Orange okay I don't know how you're running that code
but you're supposed to get values in the console
that's what the console.logs are for
Joshua Frias
@Juke-Magic
Jun 03 2017 06:49
where do i run it??
Manish Giri
@Manish-Giri
Jun 03 2017 06:49
Teague Barry
@TeagueRB
Jun 03 2017 06:49
hello I am in need of help with
"Storing Values with the Assignment Operator"
Joshua Frias
@Juke-Magic
Jun 03 2017 06:49
im running it in free code camp
Saif Ur Rahman
@saifsmailbox98
Jun 03 2017 06:50
@21-Orange on which browser?
Ogundele Olumide
@Lumexralph
Jun 03 2017 06:50
@TeagueRB what do you have?
@21-Orange you need a console environment, FCC is not that just for testing
Teague Barry
@TeagueRB
Jun 03 2017 06:50
@Lumexralph var a = 7 ;
var b = a ;
Joshua Frias
@Juke-Magic
Jun 03 2017 06:50
@saifsmailbox98 where should i test it?
@Lumexralph where should i test it?
Saif Ur Rahman
@saifsmailbox98
Jun 03 2017 06:50
@21-Orange you want to see the console?
Ogundele Olumide
@Lumexralph
Jun 03 2017 06:50
@TeagueRB show the initial code from FCC and the instructions
Manish Giri
@Manish-Giri
Jun 03 2017 06:51
@21-Orange you can test stuff on jsbin, repl.it, jsfiddle, codepen, and even your browser console(dev tools)
Ogundele Olumide
@Lumexralph
Jun 03 2017 06:51
@21-Orange i also use node in my CMD
Manish Giri
@Manish-Giri
Jun 03 2017 06:51
for now go through the code on the link
James Kubik
@slik1011
Jun 03 2017 06:51
Hello, does anyone know why this instance returns true when it should be false?
function mutation(arr) {
arr = arr.toString();
arr = arr.toLowerCase();
arr = arr.split(',');

    for(var y = 0; y < arr[1].length; y++){
      var a = arr[0].indexOf(arr[1][y]);
      var b = 0;
      while(a !== - 1){
        b++;
        a = arr[0].indexOf(arr[1][y], a + 1);
      }
      if(b > 0){

        return true;
}  

      else{

        return false;
      }}

}
mutation(["hello", "hey"]);
Teague Barry
@TeagueRB
Jun 03 2017 06:51

@Lumexralph initial code

// Setup
var a;
var b = 2;

// Only change code below this line

@Lumexralph
Assign the value 7 to variable a.

Assign the contents of a to variable b.

Joshua Frias
@Juke-Magic
Jun 03 2017 06:52
@Lumexralph aye thanks i tested it
CamperBot
@camperbot
Jun 03 2017 06:52
21-orange sends brownie points to @lumexralph :sparkles: :thumbsup: :sparkles:
:star2: 1865 | @lumexralph |http://www.freecodecamp.com/lumexralph
Teague Barry
@TeagueRB
Jun 03 2017 06:52
@Lumexralph
Do not change code above the line
a should have a value of 7
b should have a value of 7
a should be assigned to b with =
Ogundele Olumide
@Lumexralph
Jun 03 2017 06:52
@TeagueRB a and b is already declared, right?
Joshua Frias
@Juke-Magic
Jun 03 2017 06:52
@Manish-Giri this came out

Native Browser JavaScript

Number of wheels = 4
undefined
Number of wheels = 4
undefined
=> undefined

Teague Barry
@TeagueRB
Jun 03 2017 06:52
@Lumexralph i think so yes
Ogundele Olumide
@Lumexralph
Jun 03 2017 06:52
@TeagueRB you don't need to redeclare with var when you want to assign a value
Joshua Frias
@Juke-Magic
Jun 03 2017 06:52
@Manish-Giri should it be the same?
Ogundele Olumide
@Lumexralph
Jun 03 2017 06:53
@TeagueRB just assign 7 to a and then assign a to b
@21-Orange do you know why now?
Joshua Frias
@Juke-Magic
Jun 03 2017 06:53
Anyways thanks @Manish-Giri @Lumexralph i have to go :)
CamperBot
@camperbot
Jun 03 2017 06:53
21-orange sends brownie points to @manish-giri and @lumexralph :sparkles: :thumbsup: :sparkles:
:warning: 21-orange already gave lumexralph points
:warning: 21-orange already gave manish-giri points
Teague Barry
@TeagueRB
Jun 03 2017 06:54
@Lumexralph this is what I have now
var a = 7;
var b = a;
the only task im not passing is "Do not change code above this line"
or is there a way to assign it inline
Ogundele Olumide
@Lumexralph
Jun 03 2017 06:54
@TeagueRB don't use var a and b are already declared
Saif Ur Rahman
@saifsmailbox98
Jun 03 2017 06:54
@TeagueRB reset code, and don;t use var if its already defined
@TeagueRB you already know how to do it
Do not change code above the line
a should have a value of 7
b should have a value of 7
a should be assigned to b with =
Manish Giri
@Manish-Giri
Jun 03 2017 06:55
@21-Orange I've no idea how you're getting the same output
Aakriti
@Aakriti94
Jun 03 2017 06:55
@Manish-Giri hey!
Manish Giri
@Manish-Giri
Jun 03 2017 06:56
ab.png
@21-Orange this is the output on my end, which tells clearly what the difference is
Teague Barry
@TeagueRB
Jun 03 2017 06:56
@Lumexralph still confused sorry
Manish Giri
@Manish-Giri
Jun 03 2017 06:56
@Aakriti94 hello ji!
Teague Barry
@TeagueRB
Jun 03 2017 06:56
@saifsmailbox98 I appreciate it still confused
Manish Giri
@Manish-Giri
Jun 03 2017 06:56
good morning :sunny:
Teague Barry
@TeagueRB
Jun 03 2017 06:56
visual learner
Aakriti
@Aakriti94
Jun 03 2017 06:57

In the challenge Make Object Properties Private
My solution is:


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

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

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

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

var Bike = function() {

  var gear;

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

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

};

var myCar = new Car();

var myBike = new Bike();

where exactly am i going wrong?

Saif Ur Rahman
@saifsmailbox98
Jun 03 2017 06:57
@TeagueRB post your corrected code
Manish Giri
@Manish-Giri
Jun 03 2017 06:58
@Aakriti94 your functions are reversed
 this.getGear = function(g){
    gear = g;
  };

  this.setGear = function(){
    return gear;
  };
getGear is supposed to return the value
setGear is supposed to set it
Aleksander Gębicki
@Takumar
Jun 03 2017 07:00
Hi @Manish-Giri :wave: you are still building this car ;-)
Manish Giri
@Manish-Giri
Jun 03 2017 07:00
@Takumar lol, yeah
ever the mechanic
:wave:
Ogundele Olumide
@Lumexralph
Jun 03 2017 07:00
@Aakriti94 your setGear method need a parameter to assign to the private variable gear
Aakriti
@Aakriti94
Jun 03 2017 07:01
@Manish-Giri thank you! i need to concentrate more on the reading part
CamperBot
@camperbot
Jun 03 2017 07:01
aakriti94 sends brownie points to @manish-giri :sparkles: :thumbsup: :sparkles:
:star2: 5811 | @manish-giri |http://www.freecodecamp.com/manish-giri
Aleksander Gębicki
@Takumar
Jun 03 2017 07:01
@Manish-Giri it will be worked out it every detail
Aakriti
@Aakriti94
Jun 03 2017 07:01
@Lumexralph yeah! ty i figured it out
CamperBot
@camperbot
Jun 03 2017 07:01
aakriti94 sends brownie points to @lumexralph :sparkles: :thumbsup: :sparkles:
:star2: 1866 | @lumexralph |http://www.freecodecamp.com/lumexralph
Ogundele Olumide
@Lumexralph
Jun 03 2017 07:01
@TeagueRB
var a;
var b = 2;
//a and b are already declared above
a = 7;
b = a;
Aakriti
@Aakriti94
Jun 03 2017 07:02
completed Object Oriented and Functional Programming
Ogundele Olumide
@Lumexralph
Jun 03 2017 07:02
@Aakriti94 :+1:
Saif Ur Rahman
@saifsmailbox98
Jun 03 2017 07:02
@Lumexralph it should work
Ogundele Olumide
@Lumexralph
Jun 03 2017 07:03
@saifsmailbox98 sorry meant @TeagueRB
Manish Giri
@Manish-Giri
Jun 03 2017 07:03
@Aakriti94 good job
Martialis39
@Martialis39
Jun 03 2017 07:03
Hi! Wanted to ask about this. I am trying to set height and width with JS, but its not working
Line 30 in JS
Serhii Borovskyi
@serhiicss
Jun 03 2017 07:15
Hello! In "Increment a Number with JavaScript" challenge my answer is myVar = myVar++;, but it wont accept.
Saif Ur Rahman
@saifsmailbox98
Jun 03 2017 07:16
@serhiicss to don't need to assign the value to myVar using = operator
Ogundele Olumide
@Lumexralph
Jun 03 2017 07:16
@serhiicss myVar++;
Saif Ur Rahman
@saifsmailbox98
Jun 03 2017 07:16
myVar++; this is all you need
Ogundele Olumide
@Lumexralph
Jun 03 2017 07:18
@jahidbinkibria Hi
Jahid Bin Kibria
@jahidbinkibria
Jun 03 2017 07:18
how can i start 100days of codeing?
can you help me @Lumexralph
Ogundele Olumide
@Lumexralph
Jun 03 2017 07:18
@jahidbinkibria code for 100 days
Jahid Bin Kibria
@jahidbinkibria
Jun 03 2017 07:18
yes
amitavakundu
@amitavakundu
Jun 03 2017 07:19

Hi , I'm trying to the exercise "Testing Objects for Properties". Here is my code "/ Setup
var myObj = {
gift: "pony",
pet: "kitten",
bed: "sleigh"
};

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

// Test your code by modifying these values
checkObj("bed");" - not able to figure out where is the bug

Serhii Borovskyi
@serhiicss
Jun 03 2017 07:19
@saifsmailbox98 @Lumexralph @saifsmailbox98 , thanks!
CamperBot
@camperbot
Jun 03 2017 07:19
:cookie: 338 | @saifsmailbox98 |http://www.freecodecamp.com/saifsmailbox98
serhiicss sends brownie points to @saifsmailbox98 and @lumexralph :sparkles: :thumbsup: :sparkles:
:star2: 1867 | @lumexralph |http://www.freecodecamp.com/lumexralph
Ogundele Olumide
@Lumexralph
Jun 03 2017 07:19
@jahidbinkibria i really don't understand your question
@amitavakundu check for checkProp parameter not string
Jahid Bin Kibria
@jahidbinkibria
Jun 03 2017 07:20
what is the process of 100DaysOfCode
amitavakundu
@amitavakundu
Jun 03 2017 07:21
@Lumexralph I tried " if (myObj.hasOwnProperty(checkProp))" - same result
Saif Ur Rahman
@saifsmailbox98
Jun 03 2017 07:21
this is all I got
@jahidbinkibria
Ogundele Olumide
@Lumexralph
Jun 03 2017 07:21
@amitavakunducheckProp is a parameter, using dot notation to access the object myObj will not work
@amitavakundu show your whole code
Abhinav Mishra
@abhinav-m
Jun 03 2017 07:22
@amitavakundu try myObj[checkProp]
Saif Ur Rahman
@saifsmailbox98
Jun 03 2017 07:22
@amitavakundu use the bracket notation instead
amitavakundu
@amitavakundu
Jun 03 2017 07:24
@abhinav-thinktank Thanks - it worked
CamperBot
@camperbot
Jun 03 2017 07:24
amitavakundu sends brownie points to @abhinav-thinktank :sparkles: :thumbsup: :sparkles:
:cookie: 349 | @abhinav-thinktank |http://www.freecodecamp.com/abhinav-thinktank
Saif Ur Rahman
@saifsmailbox98
Jun 03 2017 07:33
How to remove multiple occurrence of elements from an array
Like from [1, 1, 2, 3, 3, 5] to [1, 2, 3, 5] ?
Ogundele Olumide
@Lumexralph
Jun 03 2017 07:33
@saifsmailbox98 i'll use Set
Saif Ur Rahman
@saifsmailbox98
Jun 03 2017 07:34
@Lumexralph okay, let me try
mitron6
@mitron6
Jun 03 2017 07:34
@saifsmailbox98 Set is good with ES6. You might need a hint to make it work.
Ogundele Olumide
@Lumexralph
Jun 03 2017 07:35
@saifsmailbox98 read the link, it should put you through https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set
mitron6
@mitron6
Jun 03 2017 07:36

@saifsmailbox98

FCC does not use a transpiler like Babel, so whether ES6 is supported depends on your browser. You're fine if you have Chrome, Firefox, or Edge. Safari and all versions of IE before Edge will not work.

To suppress the warnings, add this line to the top of your code:

// jshint esversion:6

Saif Ur Rahman
@saifsmailbox98
Jun 03 2017 07:37
@mitron6 okay, thank you
CamperBot
@camperbot
Jun 03 2017 07:37
saifsmailbox98 sends brownie points to @mitron6 :sparkles: :thumbsup: :sparkles:
:cookie: 707 | @mitron6 |http://www.freecodecamp.com/mitron6
Raghu Raj Rai
@Raidestro
Jun 03 2017 07:46

// Setup
var a=7;
var b = 2;

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

It's saying "Do not change code above the line"
I'm confused.
Saif Ur Rahman
@saifsmailbox98
Jun 03 2017 07:46
@Raidestro it's a comment
@Raidestro to make sure you don't mess with the setup part
Raghu Raj Rai
@Raidestro
Jun 03 2017 07:47
But what am I supposed to do here ? It's not getting completed
Saif Ur Rahman
@saifsmailbox98
Jun 03 2017 07:48
@Raidestro if you have changed the code above that comment try Reset Code button
and again read the objectives
Ogundele Olumide
@Lumexralph
Jun 03 2017 07:48
@Raidestro assign 7 to a before assigning it to b and don't change the code above as leave it as it was
Raghu Raj Rai
@Raidestro
Jun 03 2017 07:49
@saifsmailbox98 @Lumexralph Oh thanx ! It worked. I did a stupid mistake
CamperBot
@camperbot
Jun 03 2017 07:49
raidestro sends brownie points to @saifsmailbox98 and @lumexralph :sparkles: :thumbsup: :sparkles:
:cookie: 340 | @saifsmailbox98 |http://www.freecodecamp.com/saifsmailbox98
:star2: 1868 | @lumexralph |http://www.freecodecamp.com/lumexralph
Raghu Raj Rai
@Raidestro
Jun 03 2017 07:50
By the way, what book would you guys suggest for javascript ?
What sources did you all use to learn ?
Saif Ur Rahman
@saifsmailbox98
Jun 03 2017 07:50
@Raidestro internet is a good book
Abhinav Mishra
@abhinav-m
Jun 03 2017 07:50
@Raidestro Well i would suggest you code, google read up wherever you can MDN is a good resource
Varun
@varunzxzx
Jun 03 2017 07:51
I get stuck at Palindromes exercise. I want to replace all the non-alphanumeric characters. Th code I am using is str = str.replace(/\W+/g, ''); but it is not working
Abhinav Mishra
@abhinav-m
Jun 03 2017 07:51
@Raidestro once youre pretty confident with the basics of the language you can go for books and stuff
Raghu Raj Rai
@Raidestro
Jun 03 2017 07:51
@saifsmailbox98 @abhinav-thinktank I get that but like is there a reference book ? Which is self sufficient. ?
Abhinav Mishra
@abhinav-m
Jun 03 2017 07:51
@Raidestro there are many books, but seriously they will get you nowhere if you don't do practical stuff everyday
Saif Ur Rahman
@saifsmailbox98
Jun 03 2017 07:51
@Raidestro no, I haven't read any, I use google search and mdn
Raghu Raj Rai
@Raidestro
Jun 03 2017 07:51
@abhinav-thinktank Hmm. Nice idea. Can I learn intermediate javascript through codecamp ?
Abhinav Mishra
@abhinav-m
Jun 03 2017 07:52
@Raidestro fcc will give you the basics. then you are on your own
Raghu Raj Rai
@Raidestro
Jun 03 2017 07:52
Hmmm. That's nice.
Abhinav Mishra
@abhinav-m
Jun 03 2017 07:52
@Raidestro i recommend once youre strong on the fundamental concepts go for books and blogs
Varun
@varunzxzx
Jun 03 2017 07:52
I get stuck at Palindromes exercise. I want to replace all the non-alphanumeric characters. Th code I am using is str = str.replace(/\W+/g, ''); but it is not working. Please help
Raghu Raj Rai
@Raidestro
Jun 03 2017 07:52
@saifsmailbox98 @abhinav-thinktank Thanx again !
CamperBot
@camperbot
Jun 03 2017 07:52
raidestro sends brownie points to @saifsmailbox98 and @abhinav-thinktank :sparkles: :thumbsup: :sparkles:
:warning: raidestro already gave saifsmailbox98 points
:cookie: 350 | @abhinav-thinktank |http://www.freecodecamp.com/abhinav-thinktank
Varun
@varunzxzx
Jun 03 2017 07:54
I get stuck at Palindromes exercise. I want to replace all the non-alphanumeric characters. Th code I am using is str = str.replace(/\W+/g, ''); but it is not working. Please help
Saif Ur Rahman
@saifsmailbox98
Jun 03 2017 07:54
@varunzxzx please post your link
Ogundele Olumide
@Lumexralph
Jun 03 2017 07:55
@varunzxzx can you show the code?
Abhinav Mishra
@abhinav-m
Jun 03 2017 07:55
@varunzxzx copy paste the code
arjav2002
@arjav2002
Jun 03 2017 07:56
function orbitalPeriod(arr) {
  var GM = 398600.4418;
  var earthRadius = 6367.4447;
  // T = 2 pi underoot((earthRadius+avgAlt)^3/GM)
  for(var i = 0; i < arr.length; i++) {
    var ur = Math.pow(earthRadius + arr[i].avgAlt, 3) / GM;
    var T = 2 * 22 / 7 * Math.pow(ur, 0.5);     // rounding off to nearest whole number
    arr[i] = {name: arr[i].name, orbitalPeriod: Math.ceil(T-0.5)};
  }
  return arr;
}

orbitalPeriod([{name : "sputnik", avgAlt : 35873.5553}]);
Saif Ur Rahman
@saifsmailbox98
Jun 03 2017 07:56
@varunzxzx it will not replace underscore _
Varun
@varunzxzx
Jun 03 2017 07:56
function palindrome(str) {
// Good luck!
str = str.replace(/\W+/g, '');
return str;
}
palindrome("ey65*bj6e");
Abhinav Mishra
@abhinav-m
Jun 03 2017 07:57
@saifsmailbox98 that doesn't replace '_'?
Saif Ur Rahman
@saifsmailbox98
Jun 03 2017 07:57
isn't this what you want ey65bj6e
?
@varunzxzx
@abhinav-thinktank yes, that's what I said
arjav2002
@arjav2002
Jun 03 2017 07:58
Can someone help? This code is returing [{"name":"sputnik","orbitalPeriod":86434}] whereas the orbital period should be 86400

function orbitalPeriod(arr) {
  var GM = 398600.4418;
  var earthRadius = 6367.4447;
  // T = 2 pi underoot((earthRadius+avgAlt)^3/GM)
  for(var i = 0; i < arr.length; i++) {
    var ur = Math.pow(earthRadius + arr[i].avgAlt, 3) / GM;
    var T = 2 * 22 / 7 * Math.pow(ur, 0.5);     // rounding off to nearest whole number
    arr[i] = {name: arr[i].name, orbitalPeriod: Math.ceil(T-0.5)};
  }
  return arr;
}

orbitalPeriod([{name : "sputnik", avgAlt : 35873.5553}]);
Abhinav Mishra
@abhinav-m
Jun 03 2017 07:58
@saifsmailbox98 are you sure.. im asking
Saif Ur Rahman
@saifsmailbox98
Jun 03 2017 07:58
@abhinav-thinktank try this then
function palindrome(str) {
// Good luck!
str = str.replace(/\W+/g, '');
return str;
}
palindrome("ey65*b_j6e");
Abhinav Mishra
@abhinav-m
Jun 03 2017 07:58
@saifsmailbox98 neat, i didn't know that
Saif Ur Rahman
@saifsmailbox98
Jun 03 2017 07:58
@abhinav-thinktank you will get this ey65b_j6e
Varun
@varunzxzx
Jun 03 2017 07:59
@saifsmailbox98 I want to result to be "eye"
Abhinav Mishra
@abhinav-m
Jun 03 2017 07:59
@varunzxzx ???
Saif Ur Rahman
@saifsmailbox98
Jun 03 2017 07:59
@varunzxzx you are using it incorrently then
Abhinav Mishra
@abhinav-m
Jun 03 2017 07:59
@varunzxzx yea.. b and j are alphabets.. 6 is a number
Saif Ur Rahman
@saifsmailbox98
Jun 03 2017 07:59
@varunzxzx alphanumeric stands for alphabets and numbers
Varun
@varunzxzx
Jun 03 2017 07:59
ohh ok
Saif Ur Rahman
@saifsmailbox98
Jun 03 2017 08:00
@varunzxzx str = str.replace(/[^a-zA-Z]+/g, '');
@varunzxzx use this
Varun
@varunzxzx
Jun 03 2017 08:02
thanks i t worked but may I know how it works?
if it's not ^ in [ ] a-z or A-Z ( + one or more) replace it with ''
Varun
@varunzxzx
Jun 03 2017 08:06
ok thanks @saifsmailbox98
CamperBot
@camperbot
Jun 03 2017 08:06
varunzxzx sends brownie points to @saifsmailbox98 :sparkles: :thumbsup: :sparkles:
:cookie: 341 | @saifsmailbox98 |http://www.freecodecamp.com/saifsmailbox98
Saif Ur Rahman
@saifsmailbox98
Jun 03 2017 08:06
@varunzxzx you are welcome