These are chat archives for FreeCodeCamp/Help

17th
Nov 2015
Craig Morrison
@frogmorton
Nov 17 2015 00:00
@ShortyB the i element needs to be nested inside the button element, not the other way around, right? Be careful where you put it, with regards to the button text
Shorty
@ShortyB
Nov 17 2015 00:02
@frogmorton ```

      <button class="fa fa-thumbs-up btn btn-block btn-primary">Like<i class="fa fa-thumbs-up"> </i>
        </button>
Brandon C
@bcelesna
Nov 17 2015 00:02
Give your form element the id cat-photo-form??
Mason Shin
@minsooshin
Nov 17 2015 00:03
@ShortyB I gave feedback on your code above :)
mariocatch
@mariocatch
Nov 17 2015 00:03
@bcelesna are you asking how to give an id attribute to an element in html?
Brandon C
@bcelesna
Nov 17 2015 00:03
yes
Craig Morrison
@frogmorton
Nov 17 2015 00:03
You have some font awesome classes still in you button element... Th fa fa stuff only needs to be in the i tag
mariocatch
@mariocatch
Nov 17 2015 00:03
read the instructions on the lesson you're on
Lorkan
@Lorkan
Nov 17 2015 00:04
<script>
function runSlots() {
var slotOne = 1;
var slotTwo = 2;
var slotThree = 3;
Math.floor(Math.random() * (3 - 1 + 1)) + 1;
Shorty
@ShortyB
Nov 17 2015 00:04
thanks guys i did it :smile:
Lorkan
@Lorkan
Nov 17 2015 00:04
im at the slot machine
<script>
function runSlots() {
var slotOne = 1;
var slotTwo = 2;
var slotThree = 3;
Math.floor(Math.random() * (3 - 1 + 1)) + 1; am i missing a syntax or something?
Mason Shin
@minsooshin
Nov 17 2015 00:06
@Lorkan you need to assign that Math value to each slot value
Lorkan
@Lorkan
Nov 17 2015 00:09
@minsooshin so i need write another var?
Craig Morrison
@frogmorton
Nov 17 2015 00:10
Good job @ShortyB
mariocatch
@mariocatch
Nov 17 2015 00:10
@Lorkan what does Math.floor return?
hint look it up if you don't know :)
CamperBot
@camperbot
Nov 17 2015 00:11
:construction: Spoilers are only in the Bonfire's Custom Room :point_right:
Mason Shin
@minsooshin
Nov 17 2015 00:11
@Lorkan you need to assign the slotOne, slotTwo, and slotThree with that Math.floor(….
Abdul Awali
@awalthefirst
Nov 17 2015 00:11
@minsooshin
  var slotOne = Math.floor(Math.random() * (3 - 1 + 1)) + 1,
        slotTwo = Math.floor(Math.random() * (3 - 1 + 1)) + 1,
       slotThree= Math.floor(Math.random() * (3 - 1 + 1)) + 1;
@minsooshin wrong tag
Mason Shin
@minsooshin
Nov 17 2015 00:12
:)
I was curious how did you copy my mind :)
Ashraf Patel
@AshrafPatel
Nov 17 2015 00:12

Hello im meant to Use the map function to add 3 to every value in the variable array.
var oldArray = [1,2,3,4,5];

Ive used this code
var timesThree = oldArray.map(function(index){return index+3;});

But getting no results what am i doing wrong?

Abdul Awali
@awalthefirst
Nov 17 2015 00:13
@Lorkan
  var slotOne = Math.floor(Math.random() * (3 - 1 + 1)) + 1,
        slotTwo = Math.floor(Math.random() * (3 - 1 + 1)) + 1,
       slotThree= Math.floor(Math.random() * (3 - 1 + 1)) + 1;
Lorkan
@Lorkan
Nov 17 2015 00:14
@awalthefirst ok got it thank you so much
CamperBot
@camperbot
Nov 17 2015 00:14
lorkan sends brownie points to @awalthefirst :sparkles: :thumbsup: :sparkles:
:warning: lorkan already gave awalthefirst points
Abdul Awali
@awalthefirst
Nov 17 2015 00:15
@4SHR4F : everything good;
Lorkan
@Lorkan
Nov 17 2015 00:15
i appreciate the help @minsooshin and @mariocatch
Ashraf Patel
@AshrafPatel
Nov 17 2015 00:16
@awalthefirst No I am stuck on this
Abdul Awali
@awalthefirst
Nov 17 2015 00:17
@4SHR4F which waypoint
Ashraf Patel
@AshrafPatel
Nov 17 2015 00:17
Waypoint: Iterate over Arrays with map
Im meant to Use the map function to add 3 to every value in the variable array.
var oldArray = [1,2,3,4,5];
Ive used this code
var timesThree = oldArray.map(function(index){return index+3;});
But getting no results what am i doing wrong?
mariocatch
@mariocatch
Nov 17 2015 00:19
your code is syntactically correct
so you may not be following instructions correctly
Mason Shin
@minsooshin
Nov 17 2015 00:19
var oldArray = [1,2,3,4,5];

var timesThree = oldArray.map(function(index){return index+3;});
Abdul Awali
@awalthefirst
Nov 17 2015 00:19
@4SHR4F use 'var newArray'
Mason Shin
@minsooshin
Nov 17 2015 00:19
yes
@awalthefirst is correct
if you look at the return function at the bottom of the provided code
the return value name is newArray, so the new array name should be newArray @4SHR4F
change timesThree to newArray @4SHR4F
Ashraf Patel
@AshrafPatel
Nov 17 2015 00:22
omg I feel like such an idiot :(
Abdul Awali
@awalthefirst
Nov 17 2015 00:23
@4SHR4F : it happens all the time
Mason Shin
@minsooshin
Nov 17 2015 00:23
yes, it happens to all :)
Ashraf Patel
@AshrafPatel
Nov 17 2015 00:24
@minsooshin @awalthefirst @mariocatch Thanks all
CamperBot
@camperbot
Nov 17 2015 00:24
4shr4f sends brownie points to @minsooshin and @awalthefirst and @mariocatch :sparkles: :thumbsup: :sparkles:
:star: 363 | @awalthefirst | http://www.freecodecamp.com/awalthefirst
:star: 209 | @minsooshin | http://www.freecodecamp.com/minsooshin
:star: 49 | @mariocatch | http://www.freecodecamp.com/mariocatch
Ashraf Patel
@AshrafPatel
Nov 17 2015 00:26
in regards to these codes are you meant to memorise all of them as your going along as I cant remember half of what i typed in previous excercises I can understand the code but creating them I cant yet master it?
mariocatch
@mariocatch
Nov 17 2015 00:27
takes practice
like anything else in life
Abdul Awali
@awalthefirst
Nov 17 2015 00:27
@4SHR4F : you will remember the concepts
mariocatch
@mariocatch
Nov 17 2015 00:29
knowing exactly how map works isn't as important as knowing when_ and _why you would want to use map
you can always find out how it works when you go to use it by simply searching online. but knowing why you would need to use it will stick with you for good
Ashraf Patel
@AshrafPatel
Nov 17 2015 00:30
@awalthefirst @mariocatch OK thanks guess i will continue doing the excercises and hopefully by the time I finish I will be on inteligence level 9000 lol
CamperBot
@camperbot
Nov 17 2015 00:30
4shr4f sends brownie points to @awalthefirst and @mariocatch :sparkles: :thumbsup: :sparkles:
:warning: 4shr4f already gave awalthefirst points
:warning: 4shr4f already gave mariocatch points
Roman
@theberoman
Nov 17 2015 00:32
can anyone tell me css styles for applying border?
mariocatch
@mariocatch
Nov 17 2015 00:32
google search css border :)
Tom Pyszczuk
@Ne0nite
Nov 17 2015 00:33

Heya gang, hope everybody is doing fine :) I have a quick question, could somebody look at this code and tell me why the "option 1" does not replace the words in the string, and the other variant replaces them fine ?
```
function myReplace(str, before, after) {
if (before[0].toUpperCase() == before[0]) {
var replacedSTring = str.replace(before,after);
console.log("Uppercase option: ", replacedSTring);
}

        else {
            var replacedSTring = str.replace(before,after);
            console.log(replacedSTring);
        }

return replacedSTring;
}

myReplace("A quick brown fox jumped over the lazy dog", "Jumped", "leaped");

ups
function myReplace(str, before, after) {
            if (before[0].toUpperCase() == before[0]) {
                var replacedSTring = str.replace(before,after);
                console.log("Uppercase option: ", replacedSTring);
            }

            else {
                var replacedSTring = str.replace(before,after);
                console.log(replacedSTring);
            }

return replacedSTring;
}

myReplace("A quick brown fox jumped over the lazy dog", "Jumped", "leaped");
Roman
@theberoman
Nov 17 2015 00:34
@mariocatch lol thanks
CamperBot
@camperbot
Nov 17 2015 00:34
theberoman sends brownie points to @mariocatch :sparkles: :thumbsup: :sparkles:
:star: 50 | @mariocatch | http://www.freecodecamp.com/mariocatch
Abdul Awali
@awalthefirst
Nov 17 2015 00:35
@Ne0nite: which bonfire
Tom Pyszczuk
@Ne0nite
Nov 17 2015 00:37
its the beginning of bonfire Search and Replace, but I think I know how to do it, I jsut don't get why it wont repalce the words in the first if statement and it does replace the word in the else condition just fine, and they are both the same lines of code .. I know I am missing more from the code but I have a hickup at this point
M Used
@mildused
Nov 17 2015 00:40
Webpack help anyone?
Tom Pyszczuk
@Ne0nite
Nov 17 2015 00:40
the if statement checks out fine when I change the "j" to upper/lower case so this works fine, then is the line that is supposed to replace the string and even thou it is the exact same line as in the else statement it oes not work, as in it does not replace the line when I check it with the console.log.. Any ideas why ?
Jonathan
@jonathantimm
Nov 17 2015 00:41
Why are these basic algorithm scripting bonfires so much harder than what I've done so far? I feel like I've hit a wall :-(
Tom Pyszczuk
@Ne0nite
Nov 17 2015 00:43
hmm doh ok I found the problem, nvm :)
mariocatch
@mariocatch
Nov 17 2015 00:43
@jonathantimm just keep at it :) it 'll click eventually. takes practice. lots of it
Jonathan
@jonathantimm
Nov 17 2015 00:44
Thank you @mariocatch
CamperBot
@camperbot
Nov 17 2015 00:44
jonathantimm sends brownie points to @mariocatch :sparkles: :thumbsup: :sparkles:
:star: 51 | @mariocatch | http://www.freecodecamp.com/mariocatch
Jonathan
@jonathantimm
Nov 17 2015 00:44
I guess I have a real question. If you have code like this
function palindrome(str) {
  // Good luck!
how do I work with str inside the function? does it know that it's going to be a string or do i have to define it as a variable within the function?
mariocatch
@mariocatch
Nov 17 2015 00:45
you can just use str anywhere within the function
it stays whatever you passed into the function
Tom Pyszczuk
@Ne0nite
Nov 17 2015 00:46
it will be a string unless you change it to something else
Jonathan
@jonathantimm
Nov 17 2015 00:46
that's what I thought
maybe one of you guys could give me a hint about what's wrong here:
function palindrome(str) {
  // Good luck!
  var newString = str.toLowerCase().reverse().replace(/\s{2,}/g," "); 
    if (str === newString) {

    return true; 

  } else {

    return false; 

  }

}
Aaron Freidus
@shadowfool
Nov 17 2015 00:48
Baahhh, imgur is driving me nuts. It looks like they don't like hotlinking in codepen
Luis Felipe López G.
@luishendrix92
Nov 17 2015 00:48
@jonathantimm You are comparing a sanitized string against the original string, and looks like the cleaning of the new string is going wrong.
/\s{2,}/g," " doesn't tell me anything, you're saying, replace every 2 or more whitespace characters with a single space. The most understandable solution would be to get rid of whitespaces alltogether.
DJ
@qualitymanifest
Nov 17 2015 00:49
yeah... you need to clean the original string (differently than you have here), and then just compare it to itself reversed
Ashraf Patel
@AshrafPatel
Nov 17 2015 00:50

var array = [4,5,6,7,8];
how do I get the sum of all numbers using array function

I used this code
var singleVal = array.reduce(function(currentVal) {return array});

Luis Felipe López G.
@luishendrix92
Nov 17 2015 00:52
@4SHR4F
array.reduce(function(curr, prev){
  return curr + prev;
});
Tom Pyszczuk
@Ne0nite
Nov 17 2015 00:52
pig latin, dog latin wth is that .....
Ashraf Patel
@AshrafPatel
Nov 17 2015 00:53
so what is prev?
Luis Felipe López G.
@luishendrix92
Nov 17 2015 00:53
The previous iteration's returned value
mariocatch
@mariocatch
Nov 17 2015 00:54
you should read the mdn documentation on reduce
Ashraf Patel
@AshrafPatel
Nov 17 2015 00:54
right so in number what would curr and prev be
Luis Felipe López G.
@luishendrix92
Nov 17 2015 00:54
curr + prev during the 1st iteration I presume is:
4 + undefined
so 4 is returned and the second iteration, prev is equal to 4 and it adds 5 to it (curr)
mariocatch
@mariocatch
Nov 17 2015 00:54
it's complicated, and needs some studying
play around with it outside of the exercises to really understand it
Ashraf Patel
@AshrafPatel
Nov 17 2015 00:55
@mariocatch do i need to know about it atm?
mariocatch
@mariocatch
Nov 17 2015 00:55
you should learn it because it teaches some core concepts in javascript
Jonathan
@jonathantimm
Nov 17 2015 00:55
@luishendrix92 thank you, i will work on it
CamperBot
@camperbot
Nov 17 2015 00:55
jonathantimm sends brownie points to @luishendrix92 :sparkles: :thumbsup: :sparkles:
:star: 418 | @luishendrix92 | http://www.freecodecamp.com/luishendrix92
Ashraf Patel
@AshrafPatel
Nov 17 2015 00:56
@mariocatch @luishendrix92 Thank you
CamperBot
@camperbot
Nov 17 2015 00:56
4shr4f sends brownie points to @mariocatch and @luishendrix92 :sparkles: :thumbsup: :sparkles:
:warning: 4shr4f already gave mariocatch points
:star: 419 | @luishendrix92 | http://www.freecodecamp.com/luishendrix92
Tom Pyszczuk
@Ne0nite
Nov 17 2015 00:57
erm ok a question. How do I explain in code what a consonant is ? In order for the program to look for the first one in string ? Or do I have to make an array of all the consonants in the alphabet and make the code compare the array with the string ?
mariocatch
@mariocatch
Nov 17 2015 00:57
yes, array of constaonants.
and check if char is in your array
Tom Pyszczuk
@Ne0nite
Nov 17 2015 00:57
bleh, I thought there would be an easier way to do it
@mariocatch thank you
CamperBot
@camperbot
Nov 17 2015 00:58
ne0nite sends brownie points to @mariocatch :sparkles: :thumbsup: :sparkles:
:star: 52 | @mariocatch | http://www.freecodecamp.com/mariocatch
mariocatch
@mariocatch
Nov 17 2015 00:58
languages are universal
english is not :)
DJ
@qualitymanifest
Nov 17 2015 00:58
@Ne0nite maybe easier to make an array of vowels, maybe use a regexp for punctuation and numbers, and check if its not one of those?
mariocatch
@mariocatch
Nov 17 2015 00:58
it shouldnt be known to the language
Nick Lennox
@nicklennox
Nov 17 2015 00:58
anyone have the time to tell me whats wrong here?

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

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

DJ
@qualitymanifest
Nov 17 2015 00:58
@Ne0nite might be slower though... idk
Nick Lennox
@nicklennox
Nov 17 2015 00:58
trying to make 2 radio buttons
Luis Felipe López G.
@luishendrix92
Nov 17 2015 00:58
@Ne0nite Using regular expressions or iterating through an array of vowels using .forEach and using the indexof -1 trick.
Mason Shin
@minsooshin
Nov 17 2015 00:59
@nicklennox you missed <label> before the input
Luis Felipe López G.
@luishendrix92
Nov 17 2015 00:59
If you are thinking about .replace() for the pig latin excercise, learning RegExp is a must.
Tom Pyszczuk
@Ne0nite
Nov 17 2015 00:59
hmm so there is an easier way .. hmm thank you @luishendrix92 will look into it , not that great with regex yet
CamperBot
@camperbot
Nov 17 2015 00:59
ne0nite sends brownie points to @luishendrix92 :sparkles: :thumbsup: :sparkles:
:star: 420 | @luishendrix92 | http://www.freecodecamp.com/luishendrix92
sandy559
@sandy559
Nov 17 2015 00:59
(Waypoint: Use CSS Selectors to Style Elements) how do i "Delete your h2 element's style attribute and instead create a CSS style element. Add the necessary CSS to turn all h2 elements blue."
mariocatch
@mariocatch
Nov 17 2015 00:59
@Ne0nite same thing as what i said though :)
theres no built in way, ie: yuou need to build it
Tom Pyszczuk
@Ne0nite
Nov 17 2015 01:00
I guess so, oh well time to get started then :)
Jonathan
@jonathantimm
Nov 17 2015 01:00
@luishendrix92 do you know why in my situation it would say "can't find variable: str" even though str is the input of the function?
sandy559
@sandy559
Nov 17 2015 01:01

<style>
h2 {color: blue;}
</style>

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

Marie
@codengraphix
Nov 17 2015 01:10
Hello I'm stuck in Basic Javascript #35 Random Whole Numbers, please help
Mason Shin
@minsooshin
Nov 17 2015 01:18
@codengraphix please provide details :)
mvenuthy
@mvenuthy
Nov 17 2015 01:22
Hello, I'm stuck in Create a bootstrap button waypoint
This is exercise
Ethan Leyden
@Darksmurf
Nov 17 2015 01:24
Ok
What's the problem?
Victor Osibajo
@victoroshi
Nov 17 2015 01:26
This message was deleted
mvenuthy
@mvenuthy
Nov 17 2015 01:26
Create a new button element with the text "Like".
Your new button should have the class btn.
Adenilson Arcanjo
@arcanjomjr
Nov 17 2015 01:26
@codengraphix Maybe I can help you.
@codengraphix What is happening?
Ethan Leyden
@Darksmurf
Nov 17 2015 01:27
  • create button
  • add class btn
  • add text Like
mvenuthy
@mvenuthy
Nov 17 2015 01:27
<label><input type="radio" class="btn">Like</label>
this is the code that i've written
Ethan Leyden
@Darksmurf
Nov 17 2015 01:27
That is a radio button
Manish Giri
@Manish-Giri
Nov 17 2015 01:27
@mvenuthy something like this:
<button class='btn'>Like</button>
Ethan Leyden
@Darksmurf
Nov 17 2015 01:27
:point_up:
mvenuthy
@mvenuthy
Nov 17 2015 01:28
Ok. Got it.
Ethan Leyden
@Darksmurf
Nov 17 2015 01:28
Do you understand now @mvenuthy
mvenuthy
@mvenuthy
Nov 17 2015 01:28
I was under the impression that it was a radio button
Ethan Leyden
@Darksmurf
Nov 17 2015 01:28
Oh
Mason Shin
@minsooshin
Nov 17 2015 01:28
it can be good reference for using class in dom element.
Manish Giri
@Manish-Giri
Nov 17 2015 01:29
a radio button is actually an input element and they would mention it in the question likewise
mvenuthy
@mvenuthy
Nov 17 2015 01:29
@Manish-Giri : Thanks a lot
CamperBot
@camperbot
Nov 17 2015 01:29
mvenuthy sends brownie points to @manish-giri :sparkles: :thumbsup: :sparkles:
:star: 219 | @manish-giri | http://www.freecodecamp.com/manish-giri
Manish Giri
@Manish-Giri
Nov 17 2015 01:29
@mvenuthy Anytime! Good luck.
mvenuthy
@mvenuthy
Nov 17 2015 01:30
Got it. So, this is synonymous with the Submit button
Adenilson Arcanjo
@arcanjomjr
Nov 17 2015 01:31
Can someone help me with closures?
´´´
function counter() {
var count = 0;
return function() {
alert(count++);
}
}
var count = counter();
´´´
Ops
function counter() {
var count = 0;
return function() {
alert(count++);
}
}
var count = counter();
What is the difference between count and counter?
Can we define a variable equals to a function? What is the result?
Ethan Leyden
@Darksmurf
Nov 17 2015 01:33
counter is a function
and count is a number
Manish Giri
@Manish-Giri
Nov 17 2015 01:33
@arcanjomjr counter is the name of a function in the global namespace. Inside the function counter, there is a variable count that is only inside function counter
Ethan Leyden
@Darksmurf
Nov 17 2015 01:34
functions are like variables
*they might even be variables
Manish Giri
@Manish-Giri
Nov 17 2015 01:34
@arcanjomjr the var count outside is another variable in the global namespace, to which you assign the founction counter. Use count() to execute the function.
the variable count in your example has different scope according to where it is defined and assigned.
Adenilson Arcanjo
@arcanjomjr
Nov 17 2015 01:36
@Manish-Giri There is something important about having the variable 'count' inside the function counter and that later we define var count = counter(); using the same name 'count'?
@Manish-Giri Or is that fact irrelevant?
Manish Giri
@Manish-Giri
Nov 17 2015 01:37
@arcanjomjr you can name the variable count inside counter as you like.
Shorty
@ShortyB
Nov 17 2015 01:39
ok guys i need help again
<script>
  $(document).ready(function() {
  $("button").addClass(animated);
  $(".btn").addClass(shake);
  $("#target1").addClass(btn-primary);
  });
</script>
Your #target1 element should have the classes animated‚ shake and btn-primary.
i did everything they said and when i add all the elements to #target1 and i click run test it does go through
DJ
@qualitymanifest
Nov 17 2015 01:40
@ShortyB your classes need to be in quotation marks
Shorty
@ShortyB
Nov 17 2015 01:41
wow really
@qualitymanifest
Adenilson Arcanjo
@arcanjomjr
Nov 17 2015 01:41
@Manish-Giri So... when define var count = counter(); then count will equals to the return of counter() that happens to be a... function. Right?
Shorty
@ShortyB
Nov 17 2015 01:42
@qualitymanifest thanks i was listen my mind
CamperBot
@camperbot
Nov 17 2015 01:42
shortyb sends brownie points to @qualitymanifest :sparkles: :thumbsup: :sparkles:
:star: 386 | @qualitymanifest | http://www.freecodecamp.com/qualitymanifest
DJ
@qualitymanifest
Nov 17 2015 01:42
no problem, easy mistake to make
David Klein
@dwklein49
Nov 17 2015 01:45
<script>
  $(document).ready(function() {
    $("#getMessage").on("click", function(){
      // Only change code below this line.
      $(".message").html("Here is the message.");
      // Only change code above this line.
    });
  });
</script>


<div class="container-fluid">
  <div class = "row text-center">
    <h2>Cat Photo Finder</h2>
  </div>
  <div class = "row text-center">
    <div class = "col-xs-12 well message">
      The message will go here
    </div>
  </div>
  <div class = "row text-center">
    <div class = "col-xs-12">
      <button id = "getMessage" class = "btn btn-primary">
        Get Message
      </button>
    </div>
  </div>
</div>
For some reason this code isn't working. Looking at the image, the message does change. This is the second lessong in JSON and APIs. Change Text with Click Events
Or, the little cellphone in the corner.
The message does change there when i enter that line
Ethan Leyden
@Darksmurf
Nov 17 2015 01:47
hold on, Im lookin at the waypont
*waypoint
DJ
@qualitymanifest
Nov 17 2015 01:48
@dwklein49 your code is fine, just take out the period after message
David Klein
@dwklein49
Nov 17 2015 01:48
ah ha.
I was sitting here reloading. Wracking my brain. The little things.
Thanks you @qualitymanifest
CamperBot
@camperbot
Nov 17 2015 01:49
dwklein49 sends brownie points to @qualitymanifest :sparkles: :thumbsup: :sparkles:
:star: 387 | @qualitymanifest | http://www.freecodecamp.com/qualitymanifest
Ethan Leyden
@Darksmurf
Nov 17 2015 01:49
#everydayprogrammerproblems
David Klein
@dwklein49
Nov 17 2015 01:49
hahaha
DJ
@qualitymanifest
Nov 17 2015 01:49
This message was deleted
mariocatch
@mariocatch
Nov 17 2015 01:49
#badhabbits
DJ
@qualitymanifest
Nov 17 2015 01:49
This message was deleted
Ethan Leyden
@Darksmurf
Nov 17 2015 01:50
:P
Joel M. Swensen
@JoelMSwensen
Nov 17 2015 01:51
can you do something like this, where the if statment doesn’t seem to need and else?
  for(var i = 0; i < longest.length; i ++){
    if(arr1.indexOf(i) === -1)
      newArr.push(arr1[i]);

        if(arr2.indexOf(i) === -1)
        newArr.push(arr2[i]);
  }
mariocatch
@mariocatch
Nov 17 2015 01:52
yes, you don't need an else or an else if
Joel M. Swensen
@JoelMSwensen
Nov 17 2015 01:52
cool thank you @mariocatch
CamperBot
@camperbot
Nov 17 2015 01:52
joelmswensen sends brownie points to @mariocatch :sparkles: :thumbsup: :sparkles:
:star: 53 | @mariocatch | http://www.freecodecamp.com/mariocatch
Ethan Leyden
@Darksmurf
Nov 17 2015 01:53
but you still need the { and }
mariocatch
@mariocatch
Nov 17 2015 01:57
@Darksmurf no you don't :)
Ethan Leyden
@Darksmurf
Nov 17 2015 01:57
:o
mariocatch
@mariocatch
Nov 17 2015 01:57
only if the body of the statement is more than one line
Ethan Leyden
@Darksmurf
Nov 17 2015 01:57
Oops
Sergio Studdard
@sergistud
Nov 17 2015 02:00

Let's use if and else statements to make a coin-flip game.

Create if and else statements to return the string "heads" if the flip variable is zero, or else return the string "tails" if the flip variable is not zero.

We can use if statements in JavaScript to only execute code if a certain condition is met.

if statements require some sort of boolean condition to evaluate.

For example:

if (1 === 2) {

return true;

} else {

return false;

}

DJ
@qualitymanifest
Nov 17 2015 02:04
@sergistud 1 will never be === 2, read again:
Create if and else statements to return the string "heads" if the flip variable is zero, or else return the string "tails" if the flip variable is not zero.
Sergio Studdard
@sergistud
Nov 17 2015 02:06
that's the example it was giving me. I'm not quite following what it is saying.
DJ
@qualitymanifest
Nov 17 2015 02:10
if (flip...
in the example they give you, it will always return false. they're just showing you the structure of if statements
Shorty
@ShortyB
Nov 17 2015 02:12
var firstNameLength = 0;
var lastNameLength = 8;
var firstName = "Ada";

firstNameLength = firstName.length;

var lastName = "Lovelace";

// Only change code below this line.

lastNameLength = lastName.length;




// Only change code above this line.

if(typeof(lastNameLength) !== "undefined"){(function(){return lastNameLength;})();}
i am completely lost
i add the .length but it doesnt seem to work
what am i doing wrong
DJ
@qualitymanifest
Nov 17 2015 02:14
@ShortyB can you paste a link to the waypoint
Sergio Studdard
@sergistud
Nov 17 2015 02:15

if (flip === 0) {
return true;
} else {
return false;

}

?
Shorty
@ShortyB
Nov 17 2015 02:15
Waypoint: Check the Length Property of a String Variable%20!%3D%3D%20"undefined")%7B(function()%7Breturn%20lastNameLength%3B%7D)()%3B%7D%0A)
DJ
@qualitymanifest
Nov 17 2015 02:16
@sergistud close, but you're supposed to return something else instead of "true" or "false".
Sergio Studdard
@sergistud
Nov 17 2015 02:18
if(flip === 0)
{
return "heads";
}
else
{
return "tails";
}
Shorty
@ShortyB
Nov 17 2015 02:19
do you see what im saying @qualitymanifest
DJ
@qualitymanifest
Nov 17 2015 02:19
@ShortyB up at the top of your code, you changed var lastNameLength to equal 8. set it back to 0, where it began.
Shorty
@ShortyB
Nov 17 2015 02:19
ok @qualitymanifest
DJ
@qualitymanifest
Nov 17 2015 02:19
@sergistud looks right to me
Shorty
@ShortyB
Nov 17 2015 02:20
wow thanks @qualitymanifest
CamperBot
@camperbot
Nov 17 2015 02:20
shortyb sends brownie points to @qualitymanifest :sparkles: :thumbsup: :sparkles:
:warning: shortyb already gave qualitymanifest points
Sergio Studdard
@sergistud
Nov 17 2015 02:21
thanks @qualitymanifest
CamperBot
@camperbot
Nov 17 2015 02:21
sergistud sends brownie points to @qualitymanifest :sparkles: :thumbsup: :sparkles:
:star: 388 | @qualitymanifest | http://www.freecodecamp.com/qualitymanifest
Brandon C
@bcelesna
Nov 17 2015 02:25
I can't seem to figure this out
set the id of an element
deaninous
@deaninous
Nov 17 2015 02:27
@bcelesna which one are you working on?
Brandon C
@bcelesna
Nov 17 2015 02:28
<form action="/submit-cat-photo"> where can I nest the ID
deaninous
@deaninous
Nov 17 2015 02:29
<form id="yourIdHere"action="/submit-cat-photo">
Suren VB
@surenz298
Nov 17 2015 02:30
What is wrong with the below
<p> View more <a href = "http://freecatphotoapp.com">cat photos </a> </p>
deaninous
@deaninous
Nov 17 2015 02:30
you might wanna take out the "/"
Suren VB
@surenz298
Nov 17 2015 02:30
I am getting the error
“Your a element must be nested with p"
“p element should have the test “View more "
waypoint 22
Matt Leonard
@matty22
Nov 17 2015 02:32
@surenz298 Show us all of your code. I'm willing to bet it's cause you've created another <a> instead of wrapping the existing one with the <p>
Also you need a space after the word more
John McDevitt
@0mgjohn
Nov 17 2015 02:34

cat-photo-form {

background-color: green;
}
oops
Suren VB
@surenz298
Nov 17 2015 02:34
@matty22 You are right on dot
thnx
John McDevitt
@0mgjohn
Nov 17 2015 02:34

‘’'

cat-photo-form {

background-color: green;

}
‘''

Matt Leonard
@matty22
Nov 17 2015 02:34
Sure, no prob. Common issue with that waypoint.
@0mgjohn backticks. not apostrophes. They're to the left of your '1' key
explain format
CamperBot
@camperbot
Nov 17 2015 02:35

:point_right: code format [wiki]

Inline code

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

Code Block

``` ⇦ Type 3 backticks and then press [shift + enter ⏎]

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

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

How to Code

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

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

John McDevitt
@0mgjohn
Nov 17 2015 02:35
ty

#cat-photo-form { background-color: green; }

the id is showing in the highlighted pink?

Matt Leonard
@matty22
Nov 17 2015 02:36
Did you have a question about your code @0mgjohn ?
John McDevitt
@0mgjohn
Nov 17 2015 02:36
`<form id="cat-photo-form" action="/submit-cat-photo">
<label><input type="radio" name="indoor-outdoor" checked> Indoor</label>
<label><input type="radio" name="indoor-outdoor"> Outdoor</label>
<label><input type="checkbox" name="personality" checked> Loving</label>
<label><input type="checkbox" name="personality"> Lazy</label>
<label><input type="checkbox" name="personality"> Energetic</label>
<input type="text" placeholder="cat photo URL" required>
<button type="submit">Submit</button>
</form>
sent before the `, my bad
the background won’t go green??
Matt Leonard
@matty22
Nov 17 2015 02:37
Show me all of it including the stuff between the <style> tags. All of it.
John McDevitt
@0mgjohn
Nov 17 2015 02:38
okay

`<link href="http://fonts.googleapis.com/css?family=Lobster" rel="stylesheet" type="text/css">

<style>
.red-text {
color: red;
}

h2 {
font-family: Lobster, Monospace;

#cat-photo-form {
background-color: green;
}

}

p {
font-size: 16px;
font-family: Monospace;
}

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

.smaller-image {
width: 100px;
}

.gray-background {
background-color: gray;
}
</style>

<h2 class="red-text">CatPhotoApp</h2>

<p>Click here for <a href="#">cat photos</a>.</p>

<a href="#"><img class="smaller-image thick-green-border" src="https://bit.ly/fcc-relaxing-cat"></a>

<div class="gray-background">
<p>Things cats love:</p>
<ul>
<li>cat nip</li>
<li>laser pointers</li>
<li>lasagna</li>
</ul>
<p>Top 3 things cats hate:</p>
<ol>
<li>flea treatment</li>
<li>thunder</li>
<li>other cats</li>
</ol>
</div>

<form id="cat-photo-form" action="/submit-cat-photo">
<label><input type="radio" name="indoor-outdoor" checked> Indoor</label>
<label><input type="radio" name="indoor-outdoor"> Outdoor</label>
<label><input type="checkbox" name="personality" checked> Loving</label>
<label><input type="checkbox" name="personality"> Lazy</label>
<label><input type="checkbox" name="personality"> Energetic</label>
<input type="text" placeholder="cat photo URL" required>
<button type="submit">Submit</button>
</form>
`

damn it

`

<link href="http://fonts.googleapis.com/css?family=Lobster" rel="stylesheet" type="text/css">

<style>
.red-text {
color: red;
}

h2 {
font-family: Lobster, Monospace;

#cat-photo-form {
background-color: green;
}

}

p {
font-size: 16px;
font-family: Monospace;
}

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

.smaller-image {
width: 100px;
}

.gray-background {
background-color: gray;
}
</style>

<h2 class="red-text">CatPhotoApp</h2>

<p>Click here for <a href="#">cat photos</a>.</p>

<a href="#"><img class="smaller-image thick-green-border" src="https://bit.ly/fcc-relaxing-cat"></a>

<div class="gray-background">
<p>Things cats love:</p>
<ul>
<li>cat nip</li>
<li>laser pointers</li>
<li>lasagna</li>
</ul>
<p>Top 3 things cats hate:</p>
<ol>
<li>flea treatment</li>
<li>thunder</li>
<li>other cats</li>
</ol>
</div>

<form id="cat-photo-form" action="/submit-cat-photo">
<label><input type="radio" name="indoor-outdoor" checked> Indoor</label>
<label><input type="radio" name="indoor-outdoor"> Outdoor</label>
<label><input type="checkbox" name="personality" checked> Loving</label>
<label><input type="checkbox" name="personality"> Lazy</label>
<label><input type="checkbox" name="personality"> Energetic</label>
<input type="text" placeholder="cat photo URL" required>
<button type="submit">Submit</button>
</form>
`

Mark Malabanan
@vyzier
Nov 17 2015 02:39
test
I think you need to use ``` instead of just one.
Shorty
@ShortyB
Nov 17 2015 02:40
var ourArray = [1,2,3];

ourArray[1] = 3; // ourArray now equals [1,3,3].

var myArray = [3,2,3];
"You should be using correct index to modify the value in myArray."
do i have to change all of my ourArray to myArray or what ?????
Stephen Kinnison
@slkinnison
Nov 17 2015 02:40
@0mgjohn In your style section, you are including your cat-photo-form CSS rule inside of the h2 rule.
Matt Leonard
@matty22
Nov 17 2015 02:40
Nice catch @slkinnison I couldn't find the issue.
John McDevitt
@0mgjohn
Nov 17 2015 02:41
@slkinnison of course. Silly mistake, thanks! thanks @matty22 too :)
CamperBot
@camperbot
Nov 17 2015 02:41
0mgjohn sends brownie points to @slkinnison and @matty22 :sparkles: :thumbsup: :sparkles:
:star: 205 | @slkinnison | http://www.freecodecamp.com/slkinnison
:star: 237 | @matty22 | http://www.freecodecamp.com/matty22
Stephen Kinnison
@slkinnison
Nov 17 2015 02:41
@0mgjohn Check the braces '{}'
@matty22 Thanks
CamperBot
@camperbot
Nov 17 2015 02:42
slkinnison sends brownie points to @matty22 :sparkles: :thumbsup: :sparkles:
:star: 238 | @matty22 | http://www.freecodecamp.com/matty22
Stephen Kinnison
@slkinnison
Nov 17 2015 02:42
@ShortyB which task are you stuck on?
Shorty
@ShortyB
Nov 17 2015 02:43
Waypoint: Modify Array Data With Indexes%20!%3D%3D%20"undefined")%7B(function()%7Breturn%20myArray%3B%7D)()%3B%7D%0A)
@slkinnison
i dont understand whats wrong to be honest @slkinnison
Mark Malabanan
@vyzier
Nov 17 2015 02:44
Hello. I think there's a problem with the palindrome bonfire under Basic Algorithm Scripting. The last test there has only one backslash, instead of two, I think. Also, it can't be a palindrome because there's the underscore and the dash.
Nick Lennox
@nicklennox
Nov 17 2015 02:45
does anyone here read the holy quran?
Stephen Kinnison
@slkinnison
Nov 17 2015 02:46
@ShortyB You can add the necessary statement to change myArray under
var myArray = [3,2,3];
[J-me-lay]
@jamieleegtb
Nov 17 2015 02:50

@ShortyB ```var ourArray = [1,2,3];

ourArray1 = 3; // ourArray now equals [1,3,3].``` Look carefully to the example. In the example 2 change to 3 - 1. First number should be [0].

Shorty
@ShortyB
Nov 17 2015 02:51
@slkinnison i did that and @jamieleegtb so change the 1 to [0]
Preet Patel
@aixranger
Nov 17 2015 02:54
Guy's i'm stuck on this part where u have to replace your a element's href attribute with a #
Shorty
@ShortyB
Nov 17 2015 02:55
var ourArray = [1,2,3];

ourArray[1] = 3; // ourArray now equals [1,3,3].

var myArray = [3,2,3];
see @jamieleegtb
what do i change when i already changed myArray to [3,2,3]
[J-me-lay]
@jamieleegtb
Nov 17 2015 02:56
@aixranger Could you send the link of the waypoint link?
Shorty
@ShortyB
Nov 17 2015 02:56
but its saying that i should b using the correct index to modify the vaule in myArray but what are they talking about
be
Preet Patel
@aixranger
Nov 17 2015 02:57
@jamieleegtb it's "Waypoint: Make Dead Links using the Hash Symbol"
[J-me-lay]
@jamieleegtb
Nov 17 2015 02:58
@ShortyB do not chage myArray. What they want from you to change a specific number. So you need to use ourArray[1] = 3; example to change it.
@aixranger On that they want you to use '"#" as place holder of the link. It will not linked to anywhere but, the linked image/text will look clickable.
Preet Patel
@aixranger
Nov 17 2015 03:03
got it thanks @jamieleegtb
CamperBot
@camperbot
Nov 17 2015 03:03
aixranger sends brownie points to @jamieleegtb :sparkles: :thumbsup: :sparkles:
:star: 180 | @jamieleegtb | http://www.freecodecamp.com/jamieleegtb
Shorty
@ShortyB
Nov 17 2015 03:03
@jamieleegtb i still dont get it
im using the examples and its not working , im changing the numbers and its not working @jamieleegtb this is the link [Waypoint: Modify Array Data With Indexes]
Waypoint: Modify Array Data With Indexes%20!%3D%3D%20"undefined")%7B(function()%7Breturn%20myArray%3B%7D)()%3B%7D%0A)
i meant to send that one
magellan84
@magellan84
Nov 17 2015 03:09
Hello everyone
[J-me-lay]
@jamieleegtb
Nov 17 2015 03:11
@ShortyB first reset your code. The order of the numbers are starts with 0 -zero-[0,1,2,3,4...] so myArray = [ -0- 1, -1- 2, -2- 3];if you want to chage the first number you need to change the first one which is 0 -zero-. You create this by canging the row number in the example. ourArray[1] = 3;
Welcome @magellan84
magellan84
@magellan84
Nov 17 2015 03:14
Hey how do you do this back tick thing again. It's confusing. Am I supposed to enclose code with < > after back tick?
It also wont let me enter the code after introductory and enclosing back tick
h4r1m4u
@h4r1m4u
Nov 17 2015 03:15
wiki format
CamperBot
@camperbot
Nov 17 2015 03:15

:point_right: code format [wiki]

Inline code

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

Code Block

``` ⇦ Type 3 backticks and then press [shift + enter ⏎]

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

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

How to Code

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

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

h4r1m4u
@h4r1m4u
Nov 17 2015 03:15
@magellan84 :point_up:
magellan84
@magellan84
Nov 17 2015 03:25
hello
h4r1m4u
@h4r1m4u
Nov 17 2015 03:26
there you go
magellan84
@magellan84
Nov 17 2015 03:26
got it, finally.
Guys, can you look at my code? This is Waypoint: Nest an Anchor Element within a Paragraph (HTML challenge)
Posting code...
Z.G.Hao
@akidox
Nov 17 2015 03:29
Why with the expression "/./gi",the output come to be 104,while there is only one dot in the testString?
Pranav Doshi
@pranavdoshi
Nov 17 2015 03:29
@magellan84 what prob u facing?
Kristof Zak
@Kristof-Zak
Nov 17 2015 03:29
testing ticks
magellan84
@magellan84
Nov 17 2015 03:31
<link href="http://fonts.googleapis.com/css?family=Lobster" rel="stylesheet" type="text/css">
<style>
  .red-text {
    color: red;
  }

  h2 {
    font-family: Lobster, Monospace;
  }

  p {
    font-size: 16px;
    font-family: Monospace;
  }

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

  .smaller-image {
    width: 100px;
  }
</style>

<h2 class="red-text">CatPhotoApp</h2>


<img class="smaller-image thick-green-border" src="https://bit.ly/fcc-relaxing-cat">

<p class="red-text">Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.</p>
<p class="red-text">Purr jump eat the grass rip the couch scratched sunbathe, shed everywhere rip the couch sleep in the sink fluffy fur catnip scratched.</p>
<p> Ugly cats fats cats stupid cats smart cats "View more" <a href="http://www.freecatphotoapp.com">"cat photos"</a> Sneaky cats Groggy cats Tigers Lions Cheetahs Bengal tigers.</p>
Pranav Doshi
@pranavdoshi
Nov 17 2015 03:31
@magellan84 wats d issue??
DJ
@qualitymanifest
Nov 17 2015 03:32
don't put "view more" and "cat photos" in quotation marks
Z.G.Hao
@akidox
Nov 17 2015 03:32
The waypoint of Sift through Text with Regular Expression
DJ
@qualitymanifest
Nov 17 2015 03:32
@magellan84 ^^
magellan84
@magellan84
Nov 17 2015 03:33
Sry for the long code, but look at the bottom <p> element. It keeps rejecting my "View more link". It keeps saying I didnt code when I did.
Pranav Doshi
@pranavdoshi
Nov 17 2015 03:33
@magellan84 follow what @qualitymanifest says remove the quotes.
can anyone help me on the title case bonfire i m getting error
CamperBot
@camperbot
Nov 17 2015 03:33
type bonfire name to get some info on that bonfire. And check HelpBonfires chatroom
magellan84
@magellan84
Nov 17 2015 03:34
It keeps saying --->Your p element should have the text "View more " (with a space after it).
Pranav Doshi
@pranavdoshi
Nov 17 2015 03:34
function titleCase(str) {
var helpArray = [];
var words = str.split(' ');
for (var i = 0; i < words.length; i++){
helpArray.push(words[i][0].toUpperCase() + words.slice(1).toLowerCase()).join(" ");
}

  return helpArray;

}

alert(titleCase("I a little tea pot"));
DJ
@qualitymanifest
Nov 17 2015 03:34
@magellan84 yeah... just don't use the quotation marks. also i don't think the text before and after should be included, but it's been a long time since i've looked at that waypoint
magellan84
@magellan84
Nov 17 2015 03:35
But i says sorround the anchor text with the <p> element
It's a nesting exercise
I remove the quotation marks on View More and nothing happens
Okay, I fixed it nevermind
I removed the texts before the "View more"
Herman Fassett
@HermanFassett
Nov 17 2015 03:39
@pranavdoshi you should be slicing words[i] and you can't join a push... You should call join when you return
Pranav Doshi
@pranavdoshi
Nov 17 2015 03:40
@HermanFassett how can i add then to helparray
Herman Fassett
@HermanFassett
Nov 17 2015 03:40
pushing is the right way to add each word
Jordan Bourne
@JordanBourne
Nov 17 2015 03:42
why does this header not stretch 100%? http://codepen.io/JBourne/full/zveLzY/
nvm i got it
Aaron Freidus
@shadowfool
Nov 17 2015 03:43

Anyone any good with setInterval and clearInterval? Having some trouble getting my test variable to start up on a third click.

var totalTime = 25;
 //var intervalTime = 5;
 var timer = totalTime;
 var on = false;
 function timeKeeper(){
  if(on === true){
  timer = timer - 1;
  $(".time_keeper").text(timer);
  }
 };
 var test = setInterval(timeKeeper, 1000);

  $(".timer_button").on("click", function timerOn()  {
    if(on === true){
      clearInterval(test);
      on = false;
    }
    if(on === false){
      on = true;
      test;
    }
  });

http://codepen.io/shadowfool/full/OVKLYQ/

Pranav Doshi
@pranavdoshi
Nov 17 2015 03:47
@HermanFassett dude i messed up wid code i m not understanding
Herman Fassett
@HermanFassett
Nov 17 2015 03:47

@pranavdoshi you were pretty close. All it needs I think is moving the join to the return like

return helpArray.join("");

And slicing words[i] isntead of words

Joel M. Swensen
@JoelMSwensen
Nov 17 2015 03:49
anyone up for some js help?
as in anyone wanna help me?
mariocatch
@mariocatch
Nov 17 2015 03:50
Sure
@JoelMSwensen what's up
Pranav Doshi
@pranavdoshi
Nov 17 2015 03:51
@HermanFassett dude can we use string methods on array?
Joel M. Swensen
@JoelMSwensen
Nov 17 2015 03:51
I’m confused as to why this is acting so weird
  var foo = [1,2,3,5];
  var bar = [1,2,3,4,5];
  var newArr = [];
function diff(arr1,arr2){

  var longest;
  if(arr1.length > arr2.length){
    longest = arr1.length;

  }else if(arr1.length < arr2.length){
    longest = arr2;

  }else{longest = arr1;
  }
  for(var i = 0; i < longest.length; i ++){
    if(arr1.indexOf(arr2[i]) === -1){
      newArr.push(arr1[i]);
    }

        if(arr2.indexOf(arr1[i]) === -1){
        newArr.push(arr2[i]);
    }

  }
  return newArr;
}

diff(foo,bar);
it does all sorts of weird things lol
Pranav Doshi
@pranavdoshi
Nov 17 2015 03:51
@JoelMSwensen wat happen will try
Herman Fassett
@HermanFassett
Nov 17 2015 03:51
No @pranavdoshi sting only methods can work on array elements though such as word[i]
Pranav Doshi
@pranavdoshi
Nov 17 2015 03:52
@HermanFassett did not get u
mariocatch
@mariocatch
Nov 17 2015 03:52
Well, your first few if statements compare lenghth, then set longest to either length or the array itself
Herman Fassett
@HermanFassett
Nov 17 2015 03:53
@pranavdoshi what exactly don't you understand?
mariocatch
@mariocatch
Nov 17 2015 03:53
@JoelMSwensen make sure the code in your ifs is correct first. Then try again
Nick Lennox
@nicklennox
Nov 17 2015 03:55
<div class="gray-background" gray-background { background-color: gray; } <p>Things cats love:</p>
<ul>
<li>cat nip</li>
<li>laser pointers</li>
<li>lasagna</li>
</ul>
<p>Top 3 things cats hate:</p>
<ol>
<li>flea treatment</li>
<li>thunder</li>
<li>other cats</li>
</ol>
</div>
can anyone help here
trying to change element background
mariocatch
@mariocatch
Nov 17 2015 03:56
Nickel move your css out of the html
Manish Giri
@Manish-Giri
Nov 17 2015 03:56

@nicklennox the style rule

.gray-background {
background-color:gray;
}

should be in the style section

Pranav Doshi
@pranavdoshi
Nov 17 2015 03:56
@HermanFassett join is string method and i am using it on array
Herman Fassett
@HermanFassett
Nov 17 2015 03:57
join is an array method that joins elements together into a string
mariocatch
@mariocatch
Nov 17 2015 03:57
It's an array method
Pranav Doshi
@pranavdoshi
Nov 17 2015 03:58
ohh sorry guys forgot hehe
Joel M. Swensen
@JoelMSwensen
Nov 17 2015 03:59
@mariocatch I’m not seeing it, could you give me a hint?
mariocatch
@mariocatch
Nov 17 2015 04:00
You have longest = arr1.length; on one line.
Nick Lennox
@nicklennox
Nov 17 2015 04:00

width: 100px;

</style>
.gray-background
gray-background {
background-color:gray;
}

<h2 class="red-text">CatPhotoApp</h2>

still not working
mariocatch
@mariocatch
Nov 17 2015 04:01
And longest = arr2; on another
Pranav Doshi
@pranavdoshi
Nov 17 2015 04:01
@JoelMSwensen hey u der ?
Joel M. Swensen
@JoelMSwensen
Nov 17 2015 04:01
OH! I see it
Manish Giri
@Manish-Giri
Nov 17 2015 04:01
@nicklennox I'm assuming the question asks to make the background gray. In that case, use that class on your html element:
<h2 class="gray-background">...
mariocatch
@mariocatch
Nov 17 2015 04:01
@JoelMSwensen cool :)
Joel M. Swensen
@JoelMSwensen
Nov 17 2015 04:01
@pranavdoshi yep
@mariocatch lol now it just doesn’t work at all haha
mariocatch
@mariocatch
Nov 17 2015 04:04
Well there may be other errors. But take it one error at a time
Did you set longest to length or the array?
Nick Lennox
@nicklennox
Nov 17 2015 04:04
<style>
.red-text {
color: red;
}
.gray-background
gray-background {
background-color:gray;
}
h2 {
font-family: Lobster, Monospace;
}
Dandandan Lim
@caeldom
Nov 17 2015 04:04
anyone need help?
Manish Giri
@Manish-Giri
Nov 17 2015 04:05
@nicklennox remove the gray-background
@nicklennox it should be .gray-background in the <style> element
Nick Lennox
@nicklennox
Nov 17 2015 04:05
trying to give my div element the class gray-background
Pranav Doshi
@pranavdoshi
Nov 17 2015 04:05
@JoelMSwensen did u get ur issue fixed?
Dandandan Lim
@caeldom
Nov 17 2015 04:05
.gray-background {
background-color:gray;
}
Pranav Doshi
@pranavdoshi
Nov 17 2015 04:05
will chat privately @JoelMSwensen okay?
Manish Giri
@Manish-Giri
Nov 17 2015 04:05
.gray-background
gray-background {
background-color:gray;
}
mariocatch
@mariocatch
Nov 17 2015 04:05
You have gray back ground twice. @nicklennox
Manish Giri
@Manish-Giri
Nov 17 2015 04:05
this is wrong
Dandandan Lim
@caeldom
Nov 17 2015 04:06
@nicklennox replace it with what i wrote
Akshat Oswal
@akshat01
Nov 17 2015 04:07
@caeldom: Can you help me with the Palindrome bonfire
CamperBot
@camperbot
Nov 17 2015 04:07
type bonfire name to get some info on that bonfire. And check HelpBonfires chatroom
Joel M. Swensen
@JoelMSwensen
Nov 17 2015 04:07
@pranavdoshi sure
Jacob
@mcneece
Nov 17 2015 04:07
Just learning HTML and trying to nest a form element with a text field, and I can't seen to figure it out
Dandandan Lim
@caeldom
Nov 17 2015 04:07
syntax for generic classes is:
.classname {
property: value;
}
@akshat01 sure
Nick Lennox
@nicklennox
Nov 17 2015 04:08
<style>
.red-text {
color: red;
}
.gray-background
gray-background {
background-color:gray;
}
h2 {
font-family: Lobster, Monospace;
}
<style>
.red-text {
color: red;
}
.gray-background
gray-background {
background-color:gray;
}
h2 {
font-family: Lobster, Monospace;
}
,gray-background {
background-color:gray;
}
so sorry guys
Akshat Oswal
@akshat01
Nov 17 2015 04:09
Bonfire: Check for Palindromes
CamperBot
@camperbot
Nov 17 2015 04:09

:fire:Bonfire: Check for Palindromes :link:

function palindrome(str) {
  // Good luck!
  return true;
}



palindrome("eye");

Return true if the given string is a palindrome. Otherwise, return false.

more info:  bf details | bf links | hint

Dandandan Lim
@caeldom
Nov 17 2015 04:09
bonfire Check for Palindromes
CamperBot
@camperbot
Nov 17 2015 04:09

:fire:Bonfire: Check for Palindromes :link:

function palindrome(str) {
  // Good luck!
  return true;
}



palindrome("eye");

Return true if the given string is a palindrome. Otherwise, return false.

more info:  bf details | bf links | hint

Nick Lennox
@nicklennox
Nov 17 2015 04:09
sorry its still not working
didnt mean to send so much crap
Joel M. Swensen
@JoelMSwensen
Nov 17 2015 04:09
@mariocatch @pranavdoshi ok I’ve got the .length stuff working, but it’s still doubling what is pushed to newer
 var foo = [1,2,3,5];
  var bar = [1,2,3,4,5];
  var newArr = [];
  var testArr = []
  var longest = [];
function diff(arr1,arr2){


  if(arr1.length > arr2.length){
    longest = arr1.length;

  }else if(arr1.length < arr2.length){
    longest = arr2.length;

  }else{longest = arr1.length;
  }
  for(var i = 0; i < longest; i ++){
    if(arr1.indexOf(arr2[i]) === -1){
      newArr.push(arr1[i]);
      testArr.push(i)
    }

        if(arr2.indexOf(arr1[i]) === -1){
        newArr.push(arr2[i]);
        testArr.push(i)
    }

  }
  return newArr;
}

diff(foo,bar);
sinnersdoom
@sinnersdoom
Nov 17 2015 04:13
i am having problem with reverse string exercise
Craig Morrison
@frogmorton
Nov 17 2015 04:13
@nicklennox you need to remove grey-background without the leading dot from you CSS, and put it inside the opening div tag that you are attempting to style
As the class name... Like this ...
Joel M. Swensen
@JoelMSwensen
Nov 17 2015 04:15
oh I think I see the problem
Craig Morrison
@frogmorton
Nov 17 2015 04:15
<div class="grey-background"> ... stuff... </div>
Sorry, I spelled it grey... Supposed to be gray
Z.G.Hao
@akidox
Nov 17 2015 04:21
Why with the expression "/./gi",the output come to be 104,while there is only one dot in the testString?
The waypoint of Sift through Text with Regular Expression.
DJ
@qualitymanifest
Nov 17 2015 04:23
@akidox paste a link to the waypoint
and paste your code
Nguyen Dang Quang
@quangnd
Nov 17 2015 04:23
@mcneece why do you want to nest a <form> inside text field ?
Dandandan Lim
@caeldom
Nov 17 2015 04:23
@akidox a dot in regexp is a special character
it means "match any character"
@akidox to match the actual dot you need to use an escape- which means putting \ behind it
Z.G.Hao
@akidox
Nov 17 2015 04:24
oh,I see
Dandandan Lim
@caeldom
Nov 17 2015 04:25
@akidox /\./
Z.G.Hao
@akidox
Nov 17 2015 04:25
let me check it thanks @caeldom
CamperBot
@camperbot
Nov 17 2015 04:25
akidox sends brownie points to @caeldom :sparkles: :thumbsup: :sparkles:
:star: 272 | @caeldom | http://www.freecodecamp.com/caeldom
Dandandan Lim
@caeldom
Nov 17 2015 04:26
@akidox no worries :) let me know if that doesnt work
Pranav Doshi
@pranavdoshi
Nov 17 2015 04:27
@JordanBourne hey did u make out abt header stretching
Akshat Oswal
@akshat01
Nov 17 2015 05:00
@caeldom Thanks for the help
CamperBot
@camperbot
Nov 17 2015 05:00
akshat01 sends brownie points to @caeldom :sparkles: :thumbsup: :sparkles:
:star: 273 | @caeldom | http://www.freecodecamp.com/caeldom
Z.G.Hao
@akidox
Nov 17 2015 05:06
it works @caeldom
Dandandan Lim
@caeldom
Nov 17 2015 05:13
@akidox sweet :)
Dandandan Lim
@caeldom
Nov 17 2015 05:20
@JoelMSwensen do you still need help?
harrynguyen927
@harrynguyen927
Nov 17 2015 05:20
hey guys you think you can help me with a problem??
Dandandan Lim
@caeldom
Nov 17 2015 05:21
sure
harrynguyen927
@harrynguyen927
Nov 17 2015 05:21
thank you so much!
Joel M. Swensen
@JoelMSwensen
Nov 17 2015 05:21
@caeldom I probably will in a bit :)
Dandandan Lim
@caeldom
Nov 17 2015 05:21
pm me your code if you want
@JoelMSwensen nw :P
harrynguyen927
@harrynguyen927
Nov 17 2015 05:21
so im new at this and im trying to add a border to my picture but when i type it above the image code, the image enlarges again
Pranav Doshi
@pranavdoshi
Nov 17 2015 05:23
@harrynguyen927 can u be more precise?
Dandandan Lim
@caeldom
Nov 17 2015 05:23
send me your code harry
Pranav Doshi
@pranavdoshi
Nov 17 2015 05:26
@harrynguyen927 post the code plzz.
hey guys need help the code is working proper but unwanted value is coming working on bonfire to return largest element within the array.
CamperBot
@camperbot
Nov 17 2015 05:27
type bonfire name to get some info on that bonfire. And check HelpBonfires chatroom
Pranav Doshi
@pranavdoshi
Nov 17 2015 05:28
function largestOfFour(arr) {
  // You can do this!
  var largest = 0;
  var newarr = [];
  for(var i = 0;i<arr.length;i++)
  {
    for(var j = 0; j<arr[i].length;j++)
     {
       if((arr[i][j])>largest)
        {
        largest = arr[i][j];
        newarr.push(largest);      
        } 

     } 

  } 

  return newarr;
}

alert(largestOfFour([[4, 5, 1, 3], [13, 27, 18, 26], [32, 35, 37, 39], [1000, 1001, 857, 1]]));
so i want largest number from each to alert but small number are also in the newarray and those elements will appear as i am comparing so cant figure out
Herman Fassett
@HermanFassett
Nov 17 2015 05:29
@pranavdoshi move your newarr.push(largest) outside of the inner for loop otherwise it will push any value that is larger than the last to the array
Pranav Doshi
@pranavdoshi
Nov 17 2015 05:30
sorted i found out
haaan @HermanFassett did that only
hehe
@HermanFassett thanks anyways
CamperBot
@camperbot
Nov 17 2015 05:31
pranavdoshi sends brownie points to @hermanfassett :sparkles: :thumbsup: :sparkles:
:star: 620 | @hermanfassett | http://www.freecodecamp.com/hermanfassett
Herman Fassett
@HermanFassett
Nov 17 2015 05:31
Yeah :P
Pranav Doshi
@pranavdoshi
Nov 17 2015 05:32
but feeling better got the answer myself
:)
Herman Fassett
@HermanFassett
Nov 17 2015 05:32
Hehe, yeah always feels good
Sometimes just voicing a problem helps you sort it out.
Mani
@maniprataprana
Nov 17 2015 05:33
@GangstaCoder thanks friend
CamperBot
@camperbot
Nov 17 2015 05:33
maniprataprana sends brownie points to @gangstacoder :sparkles: :thumbsup: :sparkles:
:star: 196 | @gangstacoder | http://www.freecodecamp.com/gangstacoder
Pranav Doshi
@pranavdoshi
Nov 17 2015 05:36
@HermanFassett dude one weird error facing
Herman Fassett
@HermanFassett
Nov 17 2015 05:36
Ok
Pranav Doshi
@pranavdoshi
Nov 17 2015 05:37
var largest = 0;
  var newarr = [];
  for(var i = 0;i<arr.length;i++)
  {
    for(var j = 0; j<arr[i].length;j++)
     {
       if((arr[i][j])>largest)
        {
        alert(largest = arr[i][j]);

        } 

     } 

    newarr.push(largest); 
  } 

  return newarr;
}

alert(largestOfFour([[13, 27, 18, 26], [4, 5, 1, 3], [32, 35, 37, 39], [1000, 1001, 857, 1]]));
@HermanFassett check did out i used alert to make out so my loop skips to third array
dunno why
Herman Fassett
@HermanFassett
Nov 17 2015 05:39
Ah yes, because you need to reset largest for each array otherwise, 27 is being tested against 4, 5, 1, and 3 which it is obviously greater than
Does that make sense?
Pranav Doshi
@pranavdoshi
Nov 17 2015 05:41
so then it worked for previous textcase @HermanFassett
testcase
@HermanFassett fixed gotcha
again feeling happy
thanks for making some sense i den understood that previous testcase it was smaller arrays and den bigger arrays so it worked
Herman Fassett
@HermanFassett
Nov 17 2015 05:44
Yeah
Pranav Doshi
@pranavdoshi
Nov 17 2015 05:47
@HermanFassett wat are u on to
means project,waypoint bonfire??
Herman Fassett
@HermanFassett
Nov 17 2015 05:49
Finished all bonfires, need to finish up tic tac toe zipline for Front End dev certification, already done some angular mongo, etc waypoints
shamsher10
@shamsher10
Nov 17 2015 05:57
Your p element should have the text "View more " (with a space after it).
<p><a href="http://www.freecatphotoapp.com">cat photos</a>
View more</p>
Dandandan Lim
@caeldom
Nov 17 2015 05:57
@shamsher10 you didnt put a space in front of it
shamsher10
@shamsher10
Nov 17 2015 05:58
i did bro
Herman Fassett
@HermanFassett
Nov 17 2015 05:59
It should be <p>View more <a href... etc
Otherwise it would read catphotos View more
Dandandan Lim
@caeldom
Nov 17 2015 05:59
oh yeah
lol
shamsher10
@shamsher10
Nov 17 2015 06:00
oh ya....thanks a lot bro @HermanFassett
CamperBot
@camperbot
Nov 17 2015 06:00
shamsher10 sends brownie points to @hermanfassett :sparkles: :thumbsup: :sparkles:
:star: 621 | @hermanfassett | http://www.freecodecamp.com/hermanfassett
Herman Fassett
@HermanFassett
Nov 17 2015 06:00
Yep
shamsher10
@shamsher10
Nov 17 2015 06:00
after long time...... i got right answer
sagar
@sagarbhaila
Nov 17 2015 06:16
hjello
how to join the elements of the array with spaces?
DJ
@qualitymanifest
Nov 17 2015 06:17
This message was deleted
Dandandan Lim
@caeldom
Nov 17 2015 06:17
@sagarbhaila array.join(" ");
Herman Fassett
@HermanFassett
Nov 17 2015 06:17
This message was deleted
Mahadevan
@karthic2914
Nov 17 2015 06:19
hi guys
Dandandan Lim
@caeldom
Nov 17 2015 06:19
@sagarbhaila remember you can also google simple array methods- "js how to join array spaces" will get you what you need
Mahadevan
@karthic2914
Nov 17 2015 06:19
what i am doing wrong here
            var otherObj = JSON.parse(sessionStorage.getItem('storeDate')); 
            console.log(otherObj.storedValue1); 
            if (otherObj.storedValue1 && otherObj.storedValue2 && otherObj.storedValue3 !="pg") {    
                    $(".pay_check,.pay_click").show();    
                    $(".pay_trans").hide();
            }else if{
                var otherObj1 = JSON.parse(sessionStorage.getItem('storeDate1')); 
                $('.create_btn,.no_applica').show();
                    $('.pay_btn').hide();
            }else{ 
                $('.pay_btn').show();
                $(".pay_check,.pay_trans,.pay_click,.no_applica,.create_btn").hide();

            }
my else condition is not working
Dandandan Lim
@caeldom
Nov 17 2015 06:20
@sagarbhaila scroll down to see all the methods you can use with arrays
mini-man
@mini-man
Nov 17 2015 06:21

<script>
$(document).ready(function() {
$("#target1").css("color", "red");
$("#target1").prop("disabled", true);
$("#target4").remove();
$("#target2").appendTo("#right-well");
$("#target5").clone().appendTo("#left-well");
$("#target1").parent().css("background-color", "red");
$("#right-well").children().css("color", "green");
$("#right-well:nth-child(2)").addClass("animated, bounce");
});
</script>

My line targeting the nth-child won't work

Sree Harsha Subraveti
@gasperno
Nov 17 2015 06:22
comma after 'animated' is not necessary
Dandandan Lim
@caeldom
Nov 17 2015 06:22
@karthic2914 which else condition is not working?
Sree Harsha Subraveti
@gasperno
Nov 17 2015 06:22
@mini-man
mini-man
@mini-man
Nov 17 2015 06:22
@gasperno still doesn't work
Dandandan Lim
@caeldom
Nov 17 2015 06:22
@gasperno you can edit your msg to tag it if need
mini-man
@mini-man
Nov 17 2015 06:23
It's for this task
Waypoint: Target a Specific Child of an Element Using jQuery
srinivas
@srinivasdasu
Nov 17 2015 06:23
I Nested all button elements with in a div element and individual button elements in div .When i try to click on run tests the page is unresponsive .Is it a bug ?
<div class="row">
<div class="col-xs-6">
<button class="btn btn-block btn-primary"><i class="fa fa-thumbs-up"></i> Like</button>
</div>
<div class="col-xs-6">
<button class="btn btn-block btn-info"><i class="fa fa-info-circle"></i> Info</button>
</div>
<div class="col-xs-6">
<button class="btn btn-block btn-danger"><i class="fa fa-trash"></i> Delete</button>
</div>
</div>
I reloaded the page still i'm facing this issue]
Manish Giri
@Manish-Giri
Nov 17 2015 06:24
@srinivasdasu
you should use
<div class ="col-xs-4"
...
</div>
DJ
@qualitymanifest
Nov 17 2015 06:24
@srinivasdasu which waypoint is this
Manish Giri
@Manish-Giri
Nov 17 2015 06:24
@srinivasdasu because a BS row is made up of 12 columns
srinivas
@srinivasdasu
Nov 17 2015 06:25
Waypoint: Responsively Style Radio Buttons
DJ
@qualitymanifest
Nov 17 2015 06:25
@srinivasdasu those aren't radio buttons
srinivas
@srinivasdasu
Nov 17 2015 06:25
Sorry i got it
Dandandan Lim
@caeldom
Nov 17 2015 06:26
@srinivasdasu the reason why you should use col-xs-4 as @Manish-Giri said is because you have 3 divs and bootstrap columns should always add up to 12.
@srinivasdasu so if you were using col-xs-6, you should only have two divs.
Sree Harsha Subraveti
@gasperno
Nov 17 2015 06:27
@mini-man you are supposed to make the second child of each well bounce. Notice the example $(".target:nth-child(3)").addClass("animated bounce");
srinivas
@srinivasdasu
Nov 17 2015 06:27
I got it thanks @caeldom
CamperBot
@camperbot
Nov 17 2015 06:27
srinivasdasu sends brownie points to @caeldom :sparkles: :thumbsup: :sparkles:
:star: 275 | @caeldom | http://www.freecodecamp.com/caeldom
sindikate
@sindikate
Nov 17 2015 06:27
You should have removed all the values from the array that are greater than 5.
var oldArray = [1,2,3,4,5,6,7,8,9,10];
var newArray = oldArray.filter(function(val) {
return val < 5;
});
(function() { return newArray; })();
Sree Harsha Subraveti
@gasperno
Nov 17 2015 06:28
@mini-man observe that target is just a dummy class which has no purpose.
sindikate
@sindikate
Nov 17 2015 06:28
why does not it work?
mini-man
@mini-man
Nov 17 2015 06:28
I worked it out, I needed to target the children of that class
Sree Harsha Subraveti
@gasperno
Nov 17 2015 06:28
cool
mini-man
@mini-man
Nov 17 2015 06:28
Thanks
Sree Harsha Subraveti
@gasperno
Nov 17 2015 06:28
:+1:
sindikate
@sindikate
Nov 17 2015 06:29
help me
CamperBot
@camperbot
Nov 17 2015 06:29

:point_right: adding environment variables [wiki]

In Windows

Via GUI

  1. Download Varpanel.
  2. Open Varpanel.
  3. In PATH variable, add the relevant path (for example).

:pencil: read more about adding environment variables on the FCC Wiki

Sree Harsha Subraveti
@gasperno
Nov 17 2015 06:29
@sindikate what is the waypoint?
srinivas
@srinivasdasu
Nov 17 2015 06:29
I want to practice on my personal laptop through some IDE, by installing bootstrap . can i found all the bootstrap classes used here in bootstrap which we download?
Dandandan Lim
@caeldom
Nov 17 2015 06:29
@srinivasdasu youre welcome
sindikate
@sindikate
Nov 17 2015 06:30
@sindikate
You should have removed all the values from the array that are greater than 5.
var oldArray = [1,2,3,4,5,6,7,8,9,10];
var newArray = oldArray.filter(function(val) {
return val < 5;
});
(function() { return newArray; })();
why does not it work?
Sree Harsha Subraveti
@gasperno
Nov 17 2015 06:30
@sindikate please use code format while pasting it here.
help code
CamperBot
@camperbot
Nov 17 2015 06:30

:point_right: -----

undefined
:pencil: -----
Sree Harsha Subraveti
@gasperno
Nov 17 2015 06:30
help codeformat
CamperBot
@camperbot
Nov 17 2015 06:30
no wiki entry for: codeformat
:pencil: click here to create one now!after creating your page type update to reload it here
Dandandan Lim
@caeldom
Nov 17 2015 06:30
@sindikate use console.log(newArray); to view the output
Shankar Dhanaraj
@shankarkd
Nov 17 2015 06:31
does anyone else have the issue of smaller info and delete buttons (compared to like button) in the "Waypoint: Add Font Awesome Icons to all of our Buttons" exercise?
Dandandan Lim
@caeldom
Nov 17 2015 06:31
@sindikate also make sure all your code is inside the main function
srinivas
@srinivasdasu
Nov 17 2015 06:31
I didn't face any issue @freeradik
Dandandan Lim
@caeldom
Nov 17 2015 06:33
@sindikate not sure why you are trying to use a self calling function for that exercise
sindikate
@sindikate
Nov 17 2015 06:33
an array of displays as it should, but the job is not performed
Dandandan Lim
@caeldom
Nov 17 2015 06:33
This message was deleted
Sree Harsha Subraveti
@gasperno
Nov 17 2015 06:34
the output of your solution is displayed below the reset button.
It helps you in identifying what's wrong with your code. Can you paste what's being displayed below your 'Reset' button
Dandandan Lim
@caeldom
Nov 17 2015 06:35
@sindikate
function lessThanFive(oldArray) {
  var newArray = oldArray.filter(function(val) {
    return val < 5;
  });
  return newArray;
}

lessThanFive([1,2,3,4,5,6,7,8,9,10]);
sindikate
@sindikate
Nov 17 2015 06:36
did not help
Dandandan Lim
@caeldom
Nov 17 2015 06:36
@sindikate whats your exercise
sindikate
@sindikate
Nov 17 2015 06:37
You should have removed all the values from the array that are greater than 5.
You should be using the filter method to remove the values from the array.
You should only be using filter to modify the contents of the array.
Dandandan Lim
@caeldom
Nov 17 2015 06:37
@sindikate tell me the name of the exercise
Dandandan Lim
@caeldom
Nov 17 2015 06:37
@sindikate ok its asking for anything greater than 5
@sindikate your code will only accept things less than 5 which means 5 is also removed
srinivas
@srinivasdasu
Nov 17 2015 06:38
In Waypoint: Style Text Inputs as Form Controls
Give the text input in your form the class form-control.
sindikate
@sindikate
Nov 17 2015 06:38
return val <=5; ))
Dandandan Lim
@caeldom
Nov 17 2015 06:38
@sindikate oh its one of those self running waypoints. anyway yes did it work?
srinivas
@srinivasdasu
Nov 17 2015 06:39
i didn't get this can anyone help me on that?
In Waypoint: Style Text Inputs as Form Controls
Give the text input in your form the class form-control.
i didn't get this can anyone help me on that?
sindikate
@sindikate
Nov 17 2015 06:39
working
thanks
Dandandan Lim
@caeldom
Nov 17 2015 06:39
no worries :)
Sree Harsha Subraveti
@gasperno
Nov 17 2015 06:40
add class="form-control" to your input @srinivasdasu
Dandandan Lim
@caeldom
Nov 17 2015 06:40
you can say thanks @caeldom to give me brownie points :P
CamperBot
@camperbot
Nov 17 2015 06:40
sorry caeldom, you can't send brownie points to yourself! :sparkles: :sparkles:
srinivas
@srinivasdasu
Nov 17 2015 06:40
thank you @gasperno
CamperBot
@camperbot
Nov 17 2015 06:40
srinivasdasu sends brownie points to @gasperno :sparkles: :thumbsup: :sparkles:
:star: 205 | @gasperno | http://www.freecodecamp.com/gasperno
Shankar Dhanaraj
@shankarkd
Nov 17 2015 06:42

anyone getting "414 Request-URI Too Large

nginx” when trying to create a guthib issue?

Sophanarith Sok
@sok213
Nov 17 2015 06:49
Hello, I am on waypoint MongoDB exercise 5/9. I am not sure why my script is not passing the solution. if anyone has completed this exercise, i could really use some help. thanks.
Untitled.png
screenshot
Rex Schrader
@SaintPeter
Nov 17 2015 06:55
@freeradik That can happen on the Slot Machine exercises - the combined code it just too big.
Shankar Dhanaraj
@shankarkd
Nov 17 2015 06:55
@SaintPeter Thanks for the tip
CamperBot
@camperbot
Nov 17 2015 06:55
freeradik sends brownie points to @saintpeter :sparkles: :thumbsup: :sparkles:
:star: 1563 | @saintpeter | http://www.freecodecamp.com/saintpeter
Herman Fassett
@HermanFassett
Nov 17 2015 07:01
@sok213 I can't tell off the top of my head, but I know I had problems with that one too. I think you need to double check exactly what data is.
Maybe store the object you're passing to docs as a var and log that instead
Sophanarith Sok
@sok213
Nov 17 2015 07:02
@HermanFassett Ok, I'll try that. thanks
CamperBot
@camperbot
Nov 17 2015 07:02
sok213 sends brownie points to @hermanfassett :sparkles: :thumbsup: :sparkles:
:star: 622 | @hermanfassett | http://www.freecodecamp.com/hermanfassett
David Krapka
@Phunkhouse
Nov 17 2015 07:18
Hello, I am at the waypoint: Use Conditional Logic with If and Else Statements. Please, how can I insert "heads" and "tails" to this statement? Here is my image http://imgur.com/oGXNXLG
AlmightyLaxz
@AlmightyLaxz
Nov 17 2015 07:22
This message was deleted
This message was deleted
CamperBot
@camperbot
Nov 17 2015 07:23
:bulb: to format code use backticks! ``` more info
AlmightyLaxz
@AlmightyLaxz
Nov 17 2015 07:24
This message was deleted
CamperBot
@camperbot
Nov 17 2015 07:24
:bulb: to format code use backticks! ``` more info
AlmightyLaxz
@AlmightyLaxz
Nov 17 2015 07:24
This message was deleted
@Phunkhouse if(flip == 0) should be your if statement
@Phunkhouse and then
if(flip == 0) {
  return "heads";
} else {
  return "tails";
}
David Krapka
@Phunkhouse
Nov 17 2015 07:27
@AlmightyLaxz thanks
CamperBot
@camperbot
Nov 17 2015 07:27
phunkhouse sends brownie points to @almightylaxz :sparkles: :thumbsup: :sparkles:
:star: 188 | @almightylaxz | http://www.freecodecamp.com/almightylaxz
Akshat Oswal
@akshat01
Nov 17 2015 07:28
@caeldom Thank you
CamperBot
@camperbot
Nov 17 2015 07:28
akshat01 sends brownie points to @caeldom :sparkles: :thumbsup: :sparkles:
:star: 276 | @caeldom | http://www.freecodecamp.com/caeldom
ElCap
@ElCap
Nov 17 2015 07:48
if anyone could help me understand the map method. I am having a hard time with a waypoint.
Dandandan Lim
@caeldom
Nov 17 2015 07:49
which waypoint is that?
ElCap
@ElCap
Nov 17 2015 07:49
Waypoint: Iterate over Arrays with map
Dandandan Lim
@caeldom
Nov 17 2015 07:49
waypoint Iterate over Arrays with map
The map method will iterate through every element of the array, creating a new array with values that have been modified by the callback function, and return it.
AlmightyLaxz
@AlmightyLaxz
Nov 17 2015 07:50
@ElCap it calls a function on every element in the array
Dandandan Lim
@caeldom
Nov 17 2015 07:50
what do you think it means?
ElCap
@ElCap
Nov 17 2015 07:51
I think I get that part
i just don't know whitch function to call
Dandandan Lim
@caeldom
Nov 17 2015 07:51
the function should already be there
ElCap
@ElCap
Nov 17 2015 07:52
i the example they use val and return that
but i don
't know what val is or does
Dandandan Lim
@caeldom
Nov 17 2015 07:52
ok so the way a callback function works
is the map function accepts as its argument a function, rather than a variable
AlmightyLaxz
@AlmightyLaxz
Nov 17 2015 07:54
for example
array.map(function(x) {
    return x * 2;
});
ElCap
@ElCap
Nov 17 2015 07:54
oh
AlmightyLaxz
@AlmightyLaxz
Nov 17 2015 07:54
@ElCap the above function would return the array with each element doubled
Dandandan Lim
@caeldom
Nov 17 2015 07:54
imagine the map function as
function map(func) {
  var val;
  return func(val);
}
there is the reference for map- it tells you what arguments it will send to the callback function
ElCap
@ElCap
Nov 17 2015 07:56
@caeldom thanks
CamperBot
@camperbot
Nov 17 2015 07:56
elcap sends brownie points to @caeldom :sparkles: :thumbsup: :sparkles:
:star: 277 | @caeldom | http://www.freecodecamp.com/caeldom
ElCap
@ElCap
Nov 17 2015 07:57
that helps a lot
Dandandan Lim
@caeldom
Nov 17 2015 07:57
@ElCap that reference is easy to find btw- just google "js map"
@ElCap and you can find any other js function out there- "js join" "js reduce" "js filter"
@ElCap no worries :)
so the val argument that you provide is just the way for the map function to send the value of the current element to your function, so that you can do something with it
Luis Felipe López G.
@luishendrix92
Nov 17 2015 08:01
wiki js map
CamperBot
@camperbot
Nov 17 2015 08:01
no wiki entry for: js map
:pencil: click here to create one now!after creating your page type update to reload it here
Luis Felipe López G.
@luishendrix92
Nov 17 2015 08:01
js map
wtf
wiki map
CamperBot
@camperbot
Nov 17 2015 08:02

:point_right: bonfire map the debris [wiki]

Problem Explanation:

The first thing to do is to get familiar with what the program is for, for this I would suggest you check the Wikipedia link as that is very important and from where you can also get the formula for the conversion. The hardest part are finding the formula, implementing it and for some modifying objects by the key. However, something that is not very clear is the fact that your program has to be able to check for any number of objects in the array which is what is tested on the second part.

:pencil: read more about bonfire map the debris on the FCC Wiki

Dandandan Lim
@caeldom
Nov 17 2015 08:02
lol
@ElCap fyi in that reference link- at the bottom it shows you how the map function is implemented inside the Array object- specifically this part:
        // ii. Let mappedValue be the result of calling the Call internal 
        //     method of callback with T as the this value and argument 
        //     list containing kValue, k, and O.
        mappedValue = callback.call(T, kValue, k, O);
@ElCap that is basically that part that applies the callback function you provided to the value- and it passes into it the relevant arguments-
kValue - currentValue
The current element being processed in the array.
k- index
The index of the current element being processed in the array.
O- array
The array map was called upon.
Dandandan Lim
@caeldom
Nov 17 2015 08:09
@ElCap which is why when you define the callback function- the first three arguments you define will correspond to those three.
arr.map( function(kValue, k, O) {
  // where kValue is equal to O[k]
  return kValue + 3;
});
you can of course call them anything else- in the example given kValue is just val
刘芮希
@Liuruixi
Nov 17 2015 08:10
can anyone help me? how can I search the Level 3 nodes of the Jstree (vs 3.0.2)? I read the documention but no help....
ElCap
@ElCap
Nov 17 2015 08:11
thanks @caeldom for all the info. I had an easy time with all of the other stuff but I've been hung up on this one for a bit
CamperBot
@camperbot
Nov 17 2015 08:11
elcap sends brownie points to @caeldom :sparkles: :thumbsup: :sparkles:
:warning: elcap already gave caeldom points
Dandandan Lim
@caeldom
Nov 17 2015 08:12
@ElCap yeah totally understand, callback functions are confusing the first time you encounter them
@ElCap best thing is once you get it, it will continue to make sense. easiest way to think about it is imagine the callback function as just another variable argument you're passing to the function
@ElCap and also you'll keep seeing it a lot now- namely in arr.reduce() and arr.filter()
ElCap
@ElCap
Nov 17 2015 08:31
@caeldom once I read through the MDN link it was pretty easy to spot my problem
Mahadevan
@karthic2914
Nov 17 2015 08:35
hi guys any idea what i am doing wrong here
         var otherObj = JSON.parse(sessionStorage.getItem('storeDate'));         
                var otherObj1 = JSON.parse(sessionStorage.getItem('storeDate1')); 
            if (otherObj.storedValue1 && otherObj.storedValue2 && otherObj.storedValue3 !="pg") {    
                    $(".pay_check,.pay_click").show();    
                    $(".pay_trans").hide();
            }else if(otherObj1.storedValue4 === "select[value='Bachelor of Arts in Persian'] option:selected"){    
                $('.create_btn,.no_applica').show();
                $('.pay_btn').hide();                
            }else{
                alert("check");
            }
second if else not working
the selector
if i select any value from the drop down this condition was working
:(
 <select class="mslt_Field slt_major slt_mjr ipt_required" id="slt_mjr" name="slt_mjr">
                             <option value="0">Please Select</option>
                             <option value="BA in Arts,Culture&Heritage Ma">BAACHM</option>
                             <option id="bap_Mjr" class="bap_Mjr"  value="Bachelor of Arts in Persian">BAP</option>
                             <option value="Bachelor of Bus Adminstration">BBA</option>
                             <option value="BBA in Accounting">BBAA 2013</option>
                             <option value="BSc Environm. Health & Safety">BENVHS</option>
                             <option value="BSc in Mechanical Engineering">BMECH</option>
                             <option value="Bachelor of Architecture">BSARC</option>
                             <option value="Bachelor of Architecture">BSARC2009</option>
                             <option value="BSc in Business Administration">BSBA</option>
                             <option value="BSc in Civil Engineering">BSCE</option>
                             <option value="BSc in Civil Engineering">BSCE2007</option>
                             <option value="BSc in Civil Engineering">BSCE2014</option>
                             <option value="BSc in Construction Management">BSCM</option>
                             <option value="BSc in Construction Management">BSCM2010</option>
                             <option value="BSc in Electrical Engineering">BSEE</option>
                             <option value="BSc in Electrical Engineering">BSEE2009</option>
                          </select>
Mahadevan
@karthic2914
Nov 17 2015 08:42
any suggestion guys
jeanDesu123
@jeanDesu123
Nov 17 2015 08:44
Hi guys need help, I can't pass the next stage. I'm sure I am following the right directions
Manish Giri
@Manish-Giri
Nov 17 2015 08:45
@jeanDesu123 what seems to be the problem
jeanDesu123
@jeanDesu123
Nov 17 2015 08:45
<style>
h2 {color: blue;}
</style>
I am still getting an error message even after I set the color to blue. :(
AlmightyLaxz
@AlmightyLaxz
Nov 17 2015 08:45
@jeanDesu123 what does the objective say
jeanDesu123
@jeanDesu123
Nov 17 2015 08:46
Your h2 element should be blue.
Manish Giri
@Manish-Giri
Nov 17 2015 08:47
does your h2 element have an inline style rule that's overriding the <style> rule
jeanDesu123
@jeanDesu123
Nov 17 2015 08:52

'''

<style>
h2 {color: blue;}
</style>

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

CamperBot
@camperbot
Nov 17 2015 08:52
:bulb: to format code use backticks! ``` more info
h4r1m4u
@h4r1m4u
Nov 17 2015 08:52
@jeanDesu123 you don't have any <h2> element in your code
only a <p>
there should have been an <h2> in the code when you first opened the waypoint. did you delete it?
jeanDesu123
@jeanDesu123
Nov 17 2015 08:54
Oh yeah, I accidentally deleted the <h2> element. Thank you so much!! :+1:
h4r1m4u
@h4r1m4u
Nov 17 2015 08:54
no prob
mpsslh
@mpsslh
Nov 17 2015 09:01

Hi, i'm stuck on the
Waypoint: Specify How Fonts Should Degrade
It says here "comment out your call to Google Fonts"
and i did
<!-- <link href="http://fonts.googleapis.com/css?family=Lobster" rel="stylesheet" type="text/css">-->

But i'm unable to proceed

h4r1m4u
@h4r1m4u
Nov 17 2015 09:02
@mpsslh could you post the rest of the code?
mpsslh
@mpsslh
Nov 17 2015 09:02

<!-- <link href="http://fonts.googleapis.com/css?family=Lobster" rel="stylesheet" type="text/css">-->

<style>
.red-text {
color: red;
}

h2 {
font-family: Lobster;
}

p {
font-size: 16px;
font-family: Monospace;
}
</style>

<h2 class="red-text">CatPhotoApp</h2>

<p class="red-text">Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.</p>
<p class="red-text">Purr jump eat the grass rip the couch scratched sunbathe, shed everywhere rip the couch sleep in the sink fluffy fur catnip scratched.</p>

h4r1m4u
@h4r1m4u
Nov 17 2015 09:03
i'm assuming you're not passing this point?
"Your h2 element should degrade to the font Monospace when Lobster is not available."
AlmightyLaxz
@AlmightyLaxz
Nov 17 2015 09:03
@mpsslh the h2 css part should be
font-family: Lobster, Monospace;
mpsslh
@mpsslh
Nov 17 2015 09:04
Oh, i passed it! Thank you very much
chinna10
@chinna10
Nov 17 2015 09:11

npm ERR! Linux 4.2.0-c9
npm ERR! argv "/home/ubuntu/.nvm/versions/node/v4.1.1/bin/node" "/home/ubuntu/.nvm/versions/node/v4.1.1/bin/npm" "login"
npm ERR! node v4.1.1
npm ERR! npm v3.4.0
npm ERR! code ECONNREFUSED
npm ERR! errno ECONNREFUSED
npm ERR! syscall connect

npm ERR! Error: connect ECONNREFUSED 127.0.0.1:15443
npm ERR! at Object.exports._errnoException (util.js:837:11)
npm ERR! at exports._exceptionWithHostPort (util.js:860:20)
npm ERR! at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1060:14)
npm ERR! { [Error: connect ECONNREFUSED 127.0.0.1:15443]
npm ERR! code: 'ECONNREFUSED',
npm ERR! errno: 'ECONNREFUSED',
npm ERR! syscall: 'connect',
npm ERR! address: '127.0.0.1',
npm ERR! port: 15443 }
npm ERR!
npm ERR! If you are behind a proxy, please make sure that the
npm ERR! 'proxy' config is set properly. See: 'npm help config'

npm ERR! Please include the following file with any support request:
npm ERR! /home/ubuntu/workspace/new/npm-debug.log

Paula C.
@pacoro
Nov 17 2015 09:12
Waypoint: Make Unique Objects by Passing Parameters to our Constructor --- I don't get it. It must be something silly that I don't undersxtand...
var Car = function(wheels, seats, engines) {
  //Change this constructor
  this.wheels = 4;
  this.seats = 1;
  this.engines = 1;
};

//Try it out here
var myCar = new Car(3, 1, 2);

// Only change code above this line

(function() {return JSON.stringify(myCar);})();
AlmightyLaxz
@AlmightyLaxz
Nov 17 2015 09:14
@pacoro you to set this.wheels, this.seat, etc to it's corresponding argument
@pacoro like this.wheels = wheels;
@pacoro so that the arguments being passed from the 'new car' are put to use
Paula C.
@pacoro
Nov 17 2015 09:15
@AlmightyLaxz thanks! So I just type those down like var myCar = new Car (x, y, z) { this.wheels...... } ?
CamperBot
@camperbot
Nov 17 2015 09:15
pacoro sends brownie points to @almightylaxz :sparkles: :thumbsup: :sparkles:
:star: 191 | @almightylaxz | http://www.freecodecamp.com/almightylaxz
AlmightyLaxz
@AlmightyLaxz
Nov 17 2015 09:16
@pacoro nope, up where is says "change this constructor"
Paula C.
@pacoro
Nov 17 2015 09:16
I'm still at the beginning and have very little xp with objects :(
AlmightyLaxz
@AlmightyLaxz
Nov 17 2015 09:16
@pacoro set the this.wheels = wheels; etc
@pacoro all good
Paula C.
@pacoro
Nov 17 2015 09:16
OHHH! lol yeah i get it now :D
h4r1m4u
@h4r1m4u
Nov 17 2015 09:16

@pacoro in your current code, the arguments from the object constructor functions are not used anywhere in the constructor:

var Car = function(wheels, seats, engines) {

instead you have hardcoded values for wheels (4), seats (1), and engines (1), hence every Car object will have 4 wheels, 1 seat and 1 engine. you need initialize these Car properties with the constructor arguments

Paula C.
@pacoro
Nov 17 2015 09:17
thanks again @AlmightyLaxz , @h4r1m4u !
CamperBot
@camperbot
Nov 17 2015 09:17
pacoro sends brownie points to @almightylaxz and @h4r1m4u :sparkles: :thumbsup: :sparkles:
:warning: pacoro already gave almightylaxz points
:star: 685 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
AlmightyLaxz
@AlmightyLaxz
Nov 17 2015 09:17
@pacoro welcome :)
technogolo
@technogolo
Nov 17 2015 09:19
<link href="http://fonts.googleapis.com/css?family=Lobster" rel="stylesheet" type="text/css">
<style>
  <!--.red-text {
    color: red;
  }
  -->
  h2 {
    font-family: Lobster, Monospace;
  }
  <!--
  p {
    font-size: 16px;
    font-family: Monospace;
  }
  -->
  .thick-green-border {
    border-color: green;
    border-width: 10px;
    border-style: solid;
    border-radius: 50%;
  }
  <!--
  .smaller-image {
    width: 100px;
  }
  -->
</style>

<div class="container-fluid">
  <h2 class="text-primary text-center">CatPhotoApp</h2>

 <!-- <p>Click here for <a href="#">cat photos</a>.</p>-->

  <a href="#"><img class="img-responsive thick-green-border" src="https://bit.ly/fcc-relaxing-cat"></a>

  <img src="http://bit.ly/fcc-running-cats" class="img-responsive">
  <div class="row">
    <div class="col-xs-4">
      <button class="btn btn-block btn-primary">Like</button>
    </div>
    <div class="col-xs-4">
      <button class="btn btn-block btn-info">Info</button>
    </div>
    <div class="col-xs-4">
      <button class="btn btn-block btn-danger">Delete</button>
    </div>
  </div>
  <p>Things cats love:</p>
  <ul>
    <li>cat nip</li>
    <li>laser pointers</li>
    <li>lasagna</li>
  </ul>
  <p>Top 3 things cats hate:</p>
  <ol>
    <li>flea treatment</li>
    <li>thunder</li>
    <li>other cats</li>
  </ol>
  <form action="/submit-cat-photo">
    <label><input type="radio" name="indoor-outdoor"> Indoor</label>
    <label><input type="radio" name="indoor-outdoor"> Outdoor</label>
    <label><input type="checkbox" name="personality"> Loving</label>
    <label><input type="checkbox" name="personality"> Lazy</label>
    <label><input type="checkbox" name="personality"> Crazy</label>
    <input type="text" placeholder="cat photo URL" required>
    <button type="submit">Submit</button>
  </form>
</div>
-->
I get error Your paragraph elements should no longer use the font Monospace. I don't know what I should change in the code for that. Please help!
Andrei Sheina
@andrei-sheina
Nov 17 2015 09:39
@technogolo it's probably a problem with commenting code inside <style>
you use html syntax for comments in css section
css comments looks like:
p {
    color: red;
    /* This is a single-line comment */
    text-align: center;
}

/* This is
a multi-line
comment */
technogolo
@technogolo
Nov 17 2015 09:43
@andrei-sheina Thank you! That was the problem. I did as u said and its fine now.
CamperBot
@camperbot
Nov 17 2015 09:43
technogolo sends brownie points to @andrei-sheina :sparkles: :thumbsup: :sparkles:
:star: 131 | @andrei-sheina | http://www.freecodecamp.com/andrei-sheina
Andrei Sheina
@andrei-sheina
Nov 17 2015 09:44
@technogolo you are welcome
Robert Uivarosi
@URobert
Nov 17 2015 09:53
hi guys
anyone else listening to rock while coding? ^^ seems to work just fine :D
ups, wrong channel, sorry
Alexander Køpke
@alexanderkopke
Nov 17 2015 09:54
I listen to trance
shaik ali
@shaikali1802
Nov 17 2015 10:01
how do i add a image element
how do i add a image element using a scr attribute
David
@c-restha
Nov 17 2015 10:03
@shaikali1802 by using<img src="Url">
shaik ali
@shaikali1802
Nov 17 2015 10:07
got it thank u :)
David
@c-restha
Nov 17 2015 10:14
ok
@shaikali1802
Synthia Beauvais
@sbeauvais34
Nov 17 2015 10:18
Hi everyone. May I get some helo onWaypoint: Modify Array Data With Indexes?

```var ourArray = [1,2,3];

ourArray1 = 3; // ourArray now equals [1,3,3].

var myArray = [1,2,3];

// Only change code below this line.

var myArray =[3,2,3];
ourArray[0]=3;

// Only change code above this line.

if(typeof(myArray) !== "undefined"){(function(){return myArray;})();}```

ARRAY.tiff
h4r1m4u
@h4r1m4u
Nov 17 2015 10:22
@sbeauvais34 'Now modify the data stored at index 0 of myArray to the value of 3.' you're supposed to modify the first element of myArray, not ourArray
Synthia Beauvais
@sbeauvais34
Nov 17 2015 10:23
Thankyou @h4r1m4u :-)
Thank you @h4r1m4u :-)
CamperBot
@camperbot
Nov 17 2015 10:23
sbeauvais34 sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:star: 686 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
h4r1m4u
@h4r1m4u
Nov 17 2015 10:23
no problem
David
@c-restha
Nov 17 2015 10:28
help!!
CamperBot
@camperbot
Nov 17 2015 10:28

Hi, I'm CamperBot! I can help you in this chatroom :smile:

Basic Commands:

  • find TOPIC find all entries about topic. ex: find js
  • wiki TOPIC show contents of topic page
  • thanks @username send brownie points to another user
  • about @username shows info on that user
  • bonfire BONFIRENAME info on a bonfire

:speech_balloon: meet CamperBot in this room!

:pencil: read more about camperbot on the FCC Wiki

David
@c-restha
Nov 17 2015 10:28
Waypoint: Create Decimal Numbers with JavaScript
Elizabeth Hatleli
@TheHighPriestess
Nov 17 2015 10:30
is there a room for basejumps?
Alexander Køpke
@alexanderkopke
Nov 17 2015 10:31
@c-restha you have problem with that waypoint?
Abhisek Pattnaik
@abhisekp
Nov 17 2015 10:32
@c-restha ask here
Elizabeth Hatleli
@TheHighPriestess
Nov 17 2015 10:32
nevermind...I found it
David
@c-restha
Nov 17 2015 10:33
yup @alexanderkopke
Elizabeth Hatleli
@TheHighPriestess
Nov 17 2015 10:33
is there a way to browse different rooms on Gitter?
David
@c-restha
Nov 17 2015 10:34
yup can u help me? @alexanderkopke
Abhisek Pattnaik
@abhisekp
Nov 17 2015 10:35
@TheHighPriestess click the globe icon at top right
srinivas
@srinivasdasu
Nov 17 2015 10:35
post your problem here @c-restha
Elizabeth Hatleli
@TheHighPriestess
Nov 17 2015 10:36
@abhisekp thanks
CamperBot
@camperbot
Nov 17 2015 10:36
thehighpriestess sends brownie points to @abhisekp :sparkles: :thumbsup: :sparkles:
:star: 946 | @abhisekp | http://www.freecodecamp.com/abhisekp
Alexander Køpke
@alexanderkopke
Nov 17 2015 10:36
@c-restha you have to create a new variable called myDecimal
and then set it equal to a decimal number
you create variables with the key var in front
so var myDecimal would create a variable called myDecimal
then set it equal, using the =, to a decimal number..
David
@c-restha
Nov 17 2015 10:39
oh i got it @alexanderkopke
Alexander Køpke
@alexanderkopke
Nov 17 2015 10:39
by doing this you assign a value to the variable
David
@c-restha
Nov 17 2015 10:39
thank u @alexanderkopke
CamperBot
@camperbot
Nov 17 2015 10:39
c-restha sends brownie points to @alexanderkopke :sparkles: :thumbsup: :sparkles:
:star: 239 | @alexanderkopke | http://www.freecodecamp.com/alexanderkopke
Alexander Køpke
@alexanderkopke
Nov 17 2015 10:39
great!
David
@c-restha
Nov 17 2015 11:00

var ourArray = [1,2,3];

ourArray1 = 3; // ourArray now equals [1,3,3].

var myArray = [1,2,3];

// Only change code below this line.
var myArray = [1,2,3];

myArray1 = 3;

var myArray= [1,2,3];
// Only change code above this line.

if(typeof(myArray) !== "undefined"){(function(){return myArray;})();}

This message was deleted
h4r1m4u
@h4r1m4u
Nov 17 2015 11:06
@c-restha the index of the first element in an array is 0, not 1
Stefanie
@Phajava
Nov 17 2015 11:06
This message was deleted
David
@c-restha
Nov 17 2015 11:06
help
CamperBot
@camperbot
Nov 17 2015 11:06

Hi, I'm CamperBot! I can help you in this chatroom :smile:

Basic Commands:

  • find TOPIC find all entries about topic. ex: find js
  • wiki TOPIC show contents of topic page
  • thanks @username send brownie points to another user
  • about @username shows info on that user
  • bonfire BONFIRENAME info on a bonfire

:speech_balloon: meet CamperBot in this room!

:pencil: read more about camperbot on the FCC Wiki

Fawzi
@fouadah94
Nov 17 2015 11:29
hey guys, i have problem with "Waypoint: Set the ID of an Element"
i dont get it, where do i have to put the id in the form element
?
Tomáš Kalný
@Sleepy-guy
Nov 17 2015 11:30
i got problem with Waypoint: Bring your JavaScript Slot Machine to Life i have no idea what to do and yes i finished jQuery
hushhoney
@hushhoney
Nov 17 2015 11:35
can someone help me on this please.. Inside your script element, add this code: $(document).ready(function() { to your script. Then close it on the following line (still inside your script element) with: });
Tomáš Kalný
@Sleepy-guy
Nov 17 2015 11:36
okay i somehow did it but have no idea what it does and why it works ... could someone explain me that ? this wasnt in jQuery tutorial :D
Fawzi
@fouadah94
Nov 17 2015 11:36
sleepy guy can you help me with my problem
i have problem with "Waypoint: Set the ID of an Element"
i dont get it, where do i have to put the id in the form element
Tomáš Kalný
@Sleepy-guy
Nov 17 2015 11:37
@hushhoney <script>
$(document).ready(function() {
});
</script>
h4r1m4u
@h4r1m4u
Nov 17 2015 11:37

@fouadah94 this is how you give an id to a <div> element:

<div id="someId"></div>

now do the same for your <form> element

hushhoney
@hushhoney
Nov 17 2015 11:38
sleepy-guy, nothing happens when I press test and continue when I type that is weird!
any help
what to put in my container class
Tomáš Kalný
@Sleepy-guy
Nov 17 2015 11:40
<div class = "container-fluid>
Vinamra
@iambali
Nov 17 2015 11:40
i dont have to make a class first ??
just use it ??
hushhoney
@hushhoney
Nov 17 2015 11:40
@Sleepy-guy does not work, the bit at the bottom left with the ticks and crosses seem to disappear when I click test :/
Fawzi
@fouadah94
Nov 17 2015 11:41
@h4r1m4u thanks. is it like this? <form id="cat-photo-app" action="/submit-cat-photo">
CamperBot
@camperbot
Nov 17 2015 11:41
fouadah94 sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:star: 688 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
Tomáš Kalný
@Sleepy-guy
Nov 17 2015 11:42
@iambali which waypoint it is <
?
h4r1m4u
@h4r1m4u
Nov 17 2015 11:42
@fouadah94 yeah. you just need to close the form with </form>
Tomáš Kalný
@Sleepy-guy
Nov 17 2015 11:42
@hushhoney did you try to just press ctrl + enter to test ?
Vinamra
@iambali
Nov 17 2015 11:43
@Sleepy-guy got it
thanks @Sleepy-guy
CamperBot
@camperbot
Nov 17 2015 11:43
iambali sends brownie points to @sleepy-guy :sparkles: :thumbsup: :sparkles:
Ethan Leyden
@Darksmurf
Nov 17 2015 11:43

I think this may be the result of an infinite loop

@Sleepy-guy does not work, the bit at the bottom left with the ticks and crosses seem to disappear when I click test :/

CamperBot
@camperbot
Nov 17 2015 11:43
:star: 140 | @sleepy-guy | http://www.freecodecamp.com/sleepy-guy
hushhoney
@hushhoney
Nov 17 2015 11:43
@Sleepy-guy no I clicked the actual button, ive just refreshed browser :) hopefully will work this time
Vinamra
@iambali
Nov 17 2015 11:44
but i am confused i did not make a class container fluid
but used it with div
Ethan Leyden
@Darksmurf
Nov 17 2015 11:44
class='container-fluid'?
Fawzi
@fouadah94
Nov 17 2015 11:45
@h4r1m4u http://postimg.org/image/d3x0fdx51/. It doesn't work. Can you see what i am doing wrong?
Tomáš Kalný
@Sleepy-guy
Nov 17 2015 11:46
@iambali you did make a class it says your " div element should have class container fluid " and you add clas to your div element by <div class = "container-fluid" >
h4r1m4u
@h4r1m4u
Nov 17 2015 11:47
@fouadah94 is the waypoint asking you to give the form an id 'cat-photo-app'? or some other id? ;)
hushhoney
@hushhoney
Nov 17 2015 11:47
how do I put a photo up?
h4r1m4u
@h4r1m4u
Nov 17 2015 11:47
@hushhoney you drag the file into the box where you usually type
Fawzi
@fouadah94
Nov 17 2015 11:48
@h4r1m4u hahah, my bad!!! I looked at the example instead what they were asking
thankx!
h4r1m4u
@h4r1m4u
Nov 17 2015 11:48
@fouadah94 you're welcome
Mahadevan
@karthic2914
Nov 17 2015 11:49
  var otherObj = JSON.parse(sessionStorage.getItem('storeDate'));         
                var otherObj1 = JSON.parse(sessionStorage.getItem('storeDate1')); 
            if (otherObj.storedValue1 && otherObj.storedValue2 && otherObj.storedValue3 !="pg") {    
                    $(".pay_check,.pay_click").show();    
                    $(".pay_trans").hide();
            }else if(otherObj1.storedValue4 === $('select[name^="slt_mjr"] option[value="Bachelor of Arts in Persian"]').val()){    
                $('.create_btn,.no_applica').show();
                $('.pay_btn').hide();                
            }else{
                $('.create_btn,.no_applica').hide();
                $('.pay_btn').show();        
            }
the second else if not orking
what is the problem with the selector
hushhoney
@hushhoney
Nov 17 2015 12:01
still have a problem with this is what ive entered at the top of the page <script>
$(document).ready(function(){
});
</script>
but when I click continue, I get blank screens and cant go forward
Arun Sunderraj
@legolas9
Nov 17 2015 12:02

<link class="smalLer-image" href="http://fonts.googleapis.com/css?family=Lobster" rel="stylesheet" type="text/css">

<style>
.red-text {
color: red;
}

h2 {
font-family: Lobster, Monospace;
}

p {
font-size: 16px;
font-family: Monospace;
}
.smaller-image{
width:100px;
}
</style>

<h2 class="red-text">CatPhotoApp</h2>

<img src="https://bit.ly/fcc-relaxing-cat">

<p class="red-text">Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.</p>
<p class="red-text">Purr jump eat the grass rip the couch scratched sunbathe, shed everywhere rip the couch sleep in the sink fluffy fur catnip scratched.</p>

Why its not accepting ?
"Your img element should have the class smaller-image.
Your image should be 100 pixels wide."
srinivas
@srinivasdasu
Nov 17 2015 12:04
<img class="smaller-image" src="https://bit.ly/fcc-relaxing-cat">
did you got it @legolas9
h4r1m4u
@h4r1m4u
Nov 17 2015 12:05
@hushhoney what does your entire code look like?
hushhoney
@hushhoney
Nov 17 2015 12:09

@h4r1m4u I would send a picture but it wont let me :-1

<script>
$(document).ready(function() {
});
</script>

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

h4r1m4u
@h4r1m4u
Nov 17 2015 12:12
@hushhoney that's strange. that looks fine to me. try to reset the exercise, reload the page and put in the same code. if that doesn't work, try clearing your browser's cache or a different browser. sometimes the waypoints get buggy that way. but i can't see anything wrong with the code
hushhoney
@hushhoney
Nov 17 2015 12:12
reset it, reset my browser... even putting <script> </script> blanks out everything :/
Ankit Panwar
@coderNoob
Nov 17 2015 12:15
In both my functions I need the same line of code and it seems repetitive. Is there a better way cause I need to call two different APIs for it.
http://codepen.io/coderNoob/pen/RWKbMN
h4r1m4u
@h4r1m4u
Nov 17 2015 12:17
@hushhoney could you copy the URL from your browser and post it here, so that i can have a look it?
@coderNoob yes, you don't need to call the API twice if you're using the data from the same response returned to you by the API. you can merge the two functions:
function getUsers() {
  users.forEach(function(user) {
    $.getJSON(streamURL + user + "?callback=?", function(data) {
      if (data.stream != null) {
        $.getJSON(usersURL + user + "?callback=?", function(data) {
          $("#logos").append("<li><a href= target='_blank'><img class='logos' src=" + data.logo + "></a></li>");
          $("#message").append("<li><a href= target='_blank'><img class='logos' src=" + data.logo + "></a></li>");
          // and whatever else you might want to do with the returned data can go here
        });
      }
    });
  });
};
Ankit Panwar
@coderNoob
Nov 17 2015 12:25

@h4r1m4u If I do it that way, I would still need to call

$.getJSON(usersURL + user + "?callback=?", function(data) {
          $("#logos").append("<li><a href= target='_blank'><img class='logos' src=" + data.logo + "></a></li>");
        });

again in the else statement for all the offline users. This is what I wanted to ask, can I make a separate function for displaying the logos of the users and call it wherever I need it?

h4r1m4u
@h4r1m4u
Nov 17 2015 12:30
@coderNoob i might be missing something here. why do you think you need to call it again for offline users? when you receive the data from the API, you can append the logos and/or the user/channel information to the .tab-content div depending on the user's online status. so the online users would be appended to the online tab, while offline users would be appended to the offline tab
Ankit Panwar
@coderNoob
Nov 17 2015 12:34
@h4r1m4u But the if statement would execute only for the online users. So I would need to add an else statement for the offline users and I need their logos too, so I would need to call the users/ API one more time.
h4r1m4u
@h4r1m4u
Nov 17 2015 12:35
@coderNoob oh. in that case, why don't you do it the other way round? get the logos for everybody first and then inside that first callback function call the /users API only for the users who are online
h4r1m4u
@h4r1m4u
Nov 17 2015 12:41
@hushhoney it seems like you accidentally deleted part of the default HTML code

your HTML looks like this:

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

whereas the default HTML looks like this:

<div class="container-fluid">
  <h3 class="text-primary text-center">jQuery Playground</h3>
  <div class="row">
    <div class="col-xs-6">
      <h4>#left-well</h4>
      <div class="well" id="left-well">
        <button class="btn btn-default target" id="target1">#target1</button>
        <button class="btn btn-default target" id="target2">#target2</button>
        <button class="btn btn-default target" id="target3">#target3</button>
      </div>
    </div>
    <div class="col-xs-6">
      <h4>#right-well</h4>
      <div class="well" id="right-well">
        <button class="btn btn-default target" id="target4">#target4</button>
        <button class="btn btn-default target" id="target5">#target5</button>
        <button class="btn btn-default target" id="target6">#target6</button>
      </div>
    </div>
  </div>
</div>
if you fix the HTML, the waypoint will pass
hushhoney
@hushhoney
Nov 17 2015 12:44
ok, ive copied the second code, and its still not working @h4r1m4u
h4r1m4u
@h4r1m4u
Nov 17 2015 12:44
can you post the URL again?
hushhoney
@hushhoney
Nov 17 2015 12:44

@h4r1m4u this is my code now... <script>
$(document).ready(function() {
});
</script>

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

@h4r1m4u http://www.freecodecamp.com/challenges/waypoint-learn-how-script-tags-and-document-ready-work?solution=fccss%0A%24(document).ready(function()%20%7B%0A%20%7D)%3B%0Afcces%0A%0A%3Cdiv%20class%3D%22container-fluid%22%3E%0A%20%20%3Ch3%20class%3D%22text-primary%20text-center%22%3EjQuery%20Playground%3C%2Fh3%3E%0A%20%20%3Cdiv%20class%3D%22row%22%3E%0A%20%20%20%20%3Cdiv%20class%3D%22col-xs-6%22%3E%0A%20%20%20%20%20%20%3Ch4%3E%23left-well%3C%2Fh4%3E%0A%20%20%20%20%20%20%3Cdiv%20class%3D%22well%22%20id%3D%22left-well%22%3E%0A%20%20%20%20%20%20%20%20%3Cbutton%20class%3D%22btn%20btn-default%20target%22%20id%3D%22target1%22%3E%23target1%3C%2Fbutton%3E%0A%20%20%20%20%20%20%20%20%3Cbutton%20class%3D%22btn%20btn-default%20target%22%20id%3D%22target2%22%3E%23target2%3C%2Fbutton%3E%0A%20%20%20%20%20%20%20%20%3Cbutton%20class%3D%22btn%20btn-default%20target%22%20id%3D%22target3%22%3E%23target3%3C%2Fbutton%3E%0A%20%20%20%20%20%20%3C%2Fdiv%3E%0A%20%20%20%20%3C%2Fdiv%3E%0A%20%20%20%20%3Cdiv%20class%3D%22col-xs-6%22%3E%0A%20%20%20%20%20%20%3Ch4%3E%23right-well%3C%2Fh4%3E%0A%20%20%20%20%20%20%3Cdiv%20class%3D%22well%22%20id%3D%22right-well%22%3E%0A%20%20%20%20%20%20%20%20%3Cbutton%20class%3D%22btn%20btn-default%20target%22%20id%3D%22target4%22%3E%23target4%3C%2Fbutton%3E%0A%20%20%20%20%20%20%20%20%3Cbutton%20class%3D%22btn%20btn-default%20target%22%20id%3D%22target5%22%3E%23target5%3C%2Fbutton%3E%0A%20%20%20%20%20%20%20%20%3Cbutton%20class%3D%22btn%20btn-default%20target%22%20id%3D%22target6%22%3E%23target6%3C%2Fbutton%3E%0A%20%20%20%20%20%20%3C%2Fdiv%3E%0A%20%20%20%20%3C%2Fdiv%3E%0A%20%20%3C%2Fdiv%3E%0A%3C%2Fdiv%3E%0A
h4r1m4u
@h4r1m4u
Nov 17 2015 12:45
@hushhoney that passes for me now
this code is correct
hushhoney
@hushhoney
Nov 17 2015 12:46
really strange aint it ): @h4r1m4u
h4r1m4u
@h4r1m4u
Nov 17 2015 12:46
try to use another browser with this same exact code. it should let you through
hushhoney
@hushhoney
Nov 17 2015 12:47
on works computer cant download anything on it! :-1:
h4r1m4u
@h4r1m4u
Nov 17 2015 12:48
ok. could you try to open an incognito window and try it in there?
tiny3001
@tiny3001
Nov 17 2015 13:10
hey everyone
having an issue with "Chunky Monkey"
srinivas
@srinivasdasu
Nov 17 2015 13:11
post your problem
tiny3001
@tiny3001
Nov 17 2015 13:11
code seems correct, but one of the tests seem incorrect?
hushhoney
@hushhoney
Nov 17 2015 13:12
@h4r1m4u cant even get it to load on private browsing! give up with it ha!
tiny3001
@tiny3001
Nov 17 2015 13:12
hhmmm, now that I've pasted it flat, I think I see what's wrong... brb
StelSkrim
@StelSkrim
Nov 17 2015 13:19
anyone recalling waypoint-make-unique-objects-by-passing-parameters-to-our-constructor?
Bharath Gunapati
@gbharathsri
Nov 17 2015 13:23
I'm iterating over array with map and returning value+ 3 but it's not accepting my solution.

//Use map to add three to each value in the array
var array = [1,2,3,4,5];
// Only change code below this line.
var array = array.map(function(val) {
return val + 3;
});

// Only change code above this line.
(function() {return array;})();

any ideas?
Tomáš Kalný
@Sleepy-guy
Nov 17 2015 13:29

very lame question but i am not sure if it is a bug or i am doing something wrong the text should be orange and have orange-text id do you see any mistakes in code? <style>
body {
background-color: black;
font-family: Monospace;
color: green;
}
.pink-text {
color: pink;
}
.blue-text {
color: blue;
}
.orange-text {
color: orange;
}
</style>

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

Ezequiel Alba
@ezequielalba
Nov 17 2015 13:30
orange text with # on the css @Sleepy-guy

orange-text

tiny3001
@tiny3001
Nov 17 2015 13:30
okay, it was my mistake
fixed it
thanks all
Tomáš Kalný
@Sleepy-guy
Nov 17 2015 13:32
oh i forgot thanks @ezequielalba
CamperBot
@camperbot
Nov 17 2015 13:32
sleepy-guy sends brownie points to @ezequielalba :sparkles: :thumbsup: :sparkles:
:star: 177 | @ezequielalba | http://www.freecodecamp.com/ezequielalba
Bharath Gunapati
@gbharathsri
Nov 17 2015 13:47
nvm. I changed the variable names and it didn't accept it. All good now

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

// Only change code below this line.

var newArray = oldArray.map(function(val) {
return val + 3;
});

Francisco Chardin
@franchardin
Nov 17 2015 14:02
i can´t make this work ! ! i think it´s good, it works but i cant go to the next exercise. . .
<p>cat photos <a href='http://freecatphotoapp.com'> </a> </p> it has to say cat photos in the text and it does... but it says "your a element should have the anchor text of "cat photos". and has the red cross next to it...
anyone ?
Coira Ellison
@Coira
Nov 17 2015 14:05
@franchardin put cat photos inside the <a> tag
Francisco Chardin
@franchardin
Nov 17 2015 14:06
ok i did :D
Coira Ellison
@Coira
Nov 17 2015 14:06
did it work?
Francisco Chardin
@franchardin
Nov 17 2015 14:06
i got that ! thanks ! !
Coira Ellison
@Coira
Nov 17 2015 14:06
:)
Francisco Chardin
@franchardin
Nov 17 2015 14:07
tnx so much @Coira !
CamperBot
@camperbot
Nov 17 2015 14:07
franchardin sends brownie points to @coira :sparkles: :thumbsup: :sparkles:
:star: 318 | @coira | http://www.freecodecamp.com/coira
h4r1m4u
@h4r1m4u
Nov 17 2015 14:08
@hushhoney that's really strange. the only thing i can think of is that your browser has javascript disabled. or potentially your workplace is blocking the CDN from which FCC imports the jQuery library. have you tried any of the other jQuery waypoints? do you have the same problem with them as well?
Majd900
@Majd900
Nov 17 2015 14:19
Any motivation guys :D?
lo saephan
@lys916
Nov 17 2015 14:19
hmm.. stuck on javascript slot machine
Majd900
@Majd900
Nov 17 2015 14:19
When i got into jquery .. i kinda got outta the way :(
they say jquery is a fun lang.. well for me it has never been fun :D
mariocatch
@mariocatch
Nov 17 2015 14:20
it's a library :)
Majd900
@Majd900
Nov 17 2015 14:20
@mariocatch ik
mariocatch
@mariocatch
Nov 17 2015 14:20
javascript is the language
Majd900
@Majd900
Nov 17 2015 14:20
@mariocatch Wonder what happens
@mariocatch When i get into js :)
mariocatch
@mariocatch
Nov 17 2015 14:21
you already are into js!
jquery is javascript
Majd900
@Majd900
Nov 17 2015 14:21
yeah but much more simple
mariocatch
@mariocatch
Nov 17 2015 14:21
no, just a library written in javascript
learning and understanding javascript is paramount to being a full stack web developer
so you'll wrap your head around it at some point. just takes practice
Majd900
@Majd900
Nov 17 2015 14:22
@mariocatch Practice?? It's hell!
mariocatch
@mariocatch
Nov 17 2015 14:23
yeah it can look foreign at first
Majd900
@Majd900
Nov 17 2015 14:23
Yeah
mariocatch
@mariocatch
Nov 17 2015 14:23
i actually prefer native javascript for learning instead of jquery
Majd900
@Majd900
Nov 17 2015 14:23
that's why i need some motivation lol
rlly?
why?
mariocatch
@mariocatch
Nov 17 2015 14:23
jquery can be confusing, because it throws in symbols and concepts that aren't natural javascript
Majd900
@Majd900
Nov 17 2015 14:24
@mariocatch But it isn't easy?
mariocatch
@mariocatch
Nov 17 2015 14:24
like selecting elements on the page
easy is subjective :)
calculus comes easy to some people, and not others
there's many many papers written on learning styles. everyone is different. some things just click to certain people, and those same things might take hundreds of hours of practice to another person
doesn;'t mean someone is smarter than the other. maybe the person who toook hundrends of hours to understand one concept, understands another in just minutes
or maybe those hundreds of hours solidified their experience with it, and now truly undertstand its concepts
it's all about understanding how YOU learn, and then finding ways that fit your learning style
once you understand your weaknesses, finding solutions around that becomes easy. because you figure out your strengths, and learn that way instead
vamus7
@vamus7
Nov 17 2015 14:29
hi, i am doing basic javascript, and i have to give a random number to my slots in slot machine. can somebody plaese help me?
mariocatch
@mariocatch
Nov 17 2015 14:29
@vamus7 sure. what do you need help with? getting a random number?
vamus7
@vamus7
Nov 17 2015 14:29
yeah
mariocatch
@mariocatch
Nov 17 2015 14:29
@vamus7 what waypoint are you working on? what's the name?
vamus7
@vamus7
Nov 17 2015 14:30
Waypoint: Create a JavaScript Slot Machine
mariocatch
@mariocatch
Nov 17 2015 14:30
ok :)
did you read the instructions on the left?
they give you the code snippet for creating a random number.
vamus7
@vamus7
Nov 17 2015 14:31
yeas but how can i give it to my slots?
mariocatch
@mariocatch
Nov 17 2015 14:31
good question :) let's apply a piece of logic you've learned in the past
create a new variable and assign it to the string, "Hello"
do that in chat with me now :)
vamus7
@vamus7
Nov 17 2015 14:31
var "hello" ?
oh
mariocatch
@mariocatch
Nov 17 2015 14:32
close. var is a keyword in javascript, but it needs to be given an actual variable name. then you can assign that variable name to a value. in this case, "hello"
check up one of the early waypoints you had completed in the past: http://www.freecodecamp.com/challenges/waypoint-declare-javascript-variables
vamus7
@vamus7
Nov 17 2015 14:34
so something is missing in the middle
var .... = "hello" ?
mariocatch
@mariocatch
Nov 17 2015 14:35
yes :)
and you can replace those dots with any variable name
vamus7
@vamus7
Nov 17 2015 14:35
any?
mariocatch
@mariocatch
Nov 17 2015 14:35
yep!
you can assign any name you want to a variable
var x = 1;
var y = 2;
var z = "hello";
var thisIsAVariable = "foo bar";
vamus7
@vamus7
Nov 17 2015 14:36
so your task would be: var something = "hello" ?
mariocatch
@mariocatch
Nov 17 2015 14:36
yep, don't forget the semicolon ; at the end of each statement. that's how you tell javascript that everything before this is one statement
it's like ending a sentence in english by using a period.
Justin P
@lustyjusty
Nov 17 2015 14:36

Anyone know what I'm doing wrong with "Waypoint: Filter Arrays with .filter"? Here's the code I have in the designated area but I can't clear the "You should have removed all the values from the array that are greater than 5." even though my output is only [1, 2, 3, 4]

var newArray = oldArray.filter(function(val) {
return val < 5;
});

mariocatch
@mariocatch
Nov 17 2015 14:37
@vamus7 so now that you know how to create a variable, and assign it a value. you can use that same concept in your slot machine waypoint.
vamus7
@vamus7
Nov 17 2015 14:37
hang on i will try it
mariocatch
@mariocatch
Nov 17 2015 14:37
@vamus7 they give you the area in which they want you to edit the code:
    // Only change code below this line.



    // Only change code above this line.
one thing to keep in mind @vamus7 , they already declare the variables they want you to use at the top of the code snippet
    var slotOne;
    var slotTwo;
    var slotThree;
meawatso
@meawatso
Nov 17 2015 14:38
Can someone help me with the Style Text Inputs as controls? I'm on #81
</div>
<input class="form-control" placeholder="cat photo URL" required>
<div>
<button class="btn btn-primary"><i class="fa fa-paper-plane"></i> Submit</button>
</form>
</div>
</div>
mariocatch
@mariocatch
Nov 17 2015 14:38
@vamus7 so you don't need to re-declare them. you can simply use them in the section you're supposed to add code to
vamus7
@vamus7
Nov 17 2015 14:38
var slot = "slotOne"; Math.floor(Math.random() * (3 - 1 + 1)) + 1;
i so slot its not necessery?
*necessary
mariocatch
@mariocatch
Nov 17 2015 14:41
@vamus7 so they already gave you slotOne, slotTwo and slotThree. so you don't need to re-declare variables.
@vamus7 you should be able to simply do slotOne = ... and slotTwo = ..., etc.
vamus7
@vamus7
Nov 17 2015 14:42
nice!
mariocatch
@mariocatch
Nov 17 2015 14:42
@lustyjusty filter keeps items that pass the code in your function. in your case you wrote only keep items that are val < 5, meaning, only keep items that are less than 5.
vamus7
@vamus7
Nov 17 2015 14:42
@mariocatch thanks a lot
CamperBot
@camperbot
Nov 17 2015 14:42
vamus7 sends brownie points to @mariocatch :sparkles: :thumbsup: :sparkles:
:star: 54 | @mariocatch | http://www.freecodecamp.com/mariocatch
mariocatch
@mariocatch
Nov 17 2015 14:42
@lustyjusty the waypoint is asking you to remove items that are GREATER than 5.
@lustyjusty but you're only keeping items that are LESS THAN 5
@lustyjusty meaning, you want to keep items that are less than OR equal to 5
@meawatso what is the issue you're having?
Justin P
@lustyjusty
Nov 17 2015 14:47
@meawatso it looks like you're missing the type = "Submit" after (but still a part of) the button class, before the i class.
Kim
@gapeachcode
Nov 17 2015 14:47
I am stuck on "Change myFunction to return a random number instead of returning 0. "
Justin P
@lustyjusty
Nov 17 2015 14:47
thanks @mariocatch, it worked!!
CamperBot
@camperbot
Nov 17 2015 14:47
lustyjusty sends brownie points to @mariocatch :sparkles: :thumbsup: :sparkles:
:star: 55 | @mariocatch | http://www.freecodecamp.com/mariocatch
Kim
@gapeachcode
Nov 17 2015 14:47
it only will return zero
mariocatch
@mariocatch
Nov 17 2015 14:48
@gapeachode what did you try?
Kim
@gapeachcode
Nov 17 2015 14:48
myFunction(0 {
Math.random();
mariocatch
@mariocatch
Nov 17 2015 14:49
what's the waypoint name you're working on?
Kim
@gapeachcode
Nov 17 2015 14:49
159
Justin P
@lustyjusty
Nov 17 2015 14:49
@gapeachcode are you on "Waypoint: Generate Random Fractions with JavaScript"?
Kim
@gapeachcode
Nov 17 2015 14:49
yes
mariocatch
@mariocatch
Nov 17 2015 14:50
@gapeachcode ok so here's the code they give you:
function myFunction() {

  // Only change code below this line.

  return 0;

  // Only change code above this line.
}

(function(){return myFunction();})();
and they ask you to, instead of returning 0, return Math.random()
Kim
@gapeachcode
Nov 17 2015 14:50
k
right
mariocatch
@mariocatch
Nov 17 2015 14:50
@gapeachcode so you see where it has return 0;
@gapeachcode you need to replace that with the return they're asking you for instead.
Majd900
@Majd900
Nov 17 2015 14:50
@mariocatch so you think i should go with js?
mariocatch
@mariocatch
Nov 17 2015 14:51
@Majd900 i think following the curriculum would be good. i haven't done it all, i'm just here to help others because i get joy out of seeing others succeed
@Majd900 but if you think something is tricky, then continuing at it, asking questions, and studying why it's not working and how to fix is it most important
Majd900
@Majd900
Nov 17 2015 14:51
@mariocatch Idk man i'm so confused now :(
mariocatch
@mariocatch
Nov 17 2015 14:52
@Majd900 javascript is a core language to web development, and should be understood eventually. however, javascript is no different than any other language. php, c#, c, c++, ruby, python, java, etc... they all apply the same concepts... just with a different syntax
understanding the core purpose behind a language, which is variables, if statements, functions, objects, looping, etc...
is all that really matters
Kim
@gapeachcode
Nov 17 2015 14:53
thanks @mariocatch ... got it... blond moment ..hehehe
CamperBot
@camperbot
Nov 17 2015 14:53
gapeachcode sends brownie points to @mariocatch :sparkles: :thumbsup: :sparkles:
:star: 56 | @mariocatch | http://www.freecodecamp.com/mariocatch
mariocatch
@mariocatch
Nov 17 2015 14:53
once you understand why you would need to loop through an array, use if statements to make decisions, create functions to move large snippets of code into one line function calls...
then things will start clicking
it takes time though. it should be confusing at first. like riding a bike
the concept is easy to ride a bike, but teaching your body the new movements, stability, control, speed, etc... takes time
but once you learn it, all bikes are the same concept after that.
just like all languages
computer science is what you're trying to teach yourself at the moment. the things you should be taking out of this are, "why am i learning this?", "why is declaring a variable important?", "what can i do with a variable after it's created?", "why would i want to use an array?"
@gapeachcode good job :) glad to hear
lo saephan
@lys916
Nov 17 2015 15:20

var singleVal = array.reduce(function(previousVal, currentVal) {

return previousVal - currentVal;

}, 0);

what does the 0 at the end do?
lo saephan
@lys916
Nov 17 2015 15:25
ty
Joey Zhu
@Joey238
Nov 17 2015 15:30
How to : Waypoint: make dead links using the hash symbol? : Replace your a element's href attribute with a #, also known as a hash symbol, to turn it into a dead link.? Thank you
Kerry
@kerryliz
Nov 17 2015 15:32
hey everyone
I'm stuck
help?
CamperBot
@camperbot
Nov 17 2015 15:32

Hi, I'm CamperBot! I can help you in this chatroom :smile:

Basic Commands:

  • find TOPIC find all entries about topic. ex: find js
  • wiki TOPIC show contents of topic page
  • thanks @username send brownie points to another user
  • about @username shows info on that user
  • bonfire BONFIRENAME info on a bonfire

:speech_balloon: meet CamperBot in this room!

:pencil: read more about camperbot on the FCC Wiki

Kerry
@kerryliz
Nov 17 2015 15:32
Completely confused by 'Waypoint: Use Conditional Logic with If and Else Statements'
the coin toss one
find if else
mariocatch
@mariocatch
Nov 17 2015 15:35
@kerryliz what questions do you have?
lo saephan
@lys916
Nov 17 2015 15:36
i just passed the coin toss part.. i think it's asking you to return "heads" or "tails" depending on your variable
mariocatch
@mariocatch
Nov 17 2015 15:36
@Joey238 do you have an anchor tag on your page? <a href="...">Link</a>
lo saephan
@lys916
Nov 17 2015 15:38
so if your variable is === 0 then return "heads" else return "tails"
Ramakanth
@ramakanthmarda
Nov 17 2015 15:43
Hello there! where do i learn algorithm scripting because iam unable to solve them
Alexander Køpke
@alexanderkopke
Nov 17 2015 15:53
hello rama
HueCao
@HueCao
Nov 17 2015 15:59
This message was deleted
Craig Morrison
@frogmorton
Nov 17 2015 16:00
@mariocatch I have a question for you
HueCao
@HueCao
Nov 17 2015 16:01
This message was deleted
Craig Morrison
@frogmorton
Nov 17 2015 16:02
i am wanting to try using an api to populate my random quotes, rather than making a static array of quotes... I applied for and received the userID and token credentials from the site
you can hit 100 results per day for free
apparently, the results are stored via XML rather than a json file
Kerry
@kerryliz
Nov 17 2015 16:03
it's cool, i figured it out
Craig Morrison
@frogmorton
Nov 17 2015 16:03
and if you query by author, it seems to give you ALL the quotes by that person in the site's DB
Kerry
@kerryliz
Nov 17 2015 16:03
thanks @mariocatch
CamperBot
@camperbot
Nov 17 2015 16:03
kerryliz sends brownie points to @mariocatch :sparkles: :thumbsup: :sparkles:
:star: 57 | @mariocatch | http://www.freecodecamp.com/mariocatch
Craig Morrison
@frogmorton
Nov 17 2015 16:08
the xml seems to only have 2 nodes per entry, author and quote... I wanted to be able to search for a finite number of random authors and also randomize the quote from among however many that author has in the site
Zeljko Sevic
@schewmeister
Nov 17 2015 16:08
hi everybody
Craig Morrison
@frogmorton
Nov 17 2015 16:08
*in the site's database
so, I'm not sure if jQuery's .parseXML() would do much for me... how would it identify unique quotes, if there is no id number or result number
Zeljko Sevic
@schewmeister
Nov 17 2015 16:10
i have a problem with local json file, my editor recognise parts of parsed object, but browser doesn't show it
var req=new XMLHttpRequest();
  req.onreadystatechange=function(){
    if(req.readyState===4&&req.status===200){
      data=JSON.parse(req.responseText);
    }
  };
  req.open('GET','podaci.json',true);
  req.send();
Kerry
@kerryliz
Nov 17 2015 16:10
Hi @schewmeister
NewCareer
@NewCareer
Nov 17 2015 16:10
Can anyone help with basic Java? On a challenge and I don't get what I'm doing wrong at all...
Zeljko Sevic
@schewmeister
Nov 17 2015 16:11
@kerryliz hi, how is it going?
NewCareer
@NewCareer
Nov 17 2015 16:13
anyone at all?
Craig Morrison
@frogmorton
Nov 17 2015 16:13
i can practically hear the crickets... I need some help getting direction on how to attack aspects of my quote machine zipline
Blake Wight
@bwighthunter
Nov 17 2015 16:13
@NewCareer Whats up?
TIEGUY
@bfark13
Nov 17 2015 16:13
@NewCareer java? or javascript?
Blake Wight
@bwighthunter
Nov 17 2015 16:15
@bfark13 I guess he didn't need help anymore? hahaha
NewCareer
@NewCareer
Nov 17 2015 16:15
I'm stuck on a JS slotcoin challenge
Craig Morrison
@frogmorton
Nov 17 2015 16:16
i still need help...LOL
NewCareer
@NewCareer
Nov 17 2015 16:16
@bfark13 @bwighthunter stuck on a JS slotcoin challenge. Asking me to create an if statement to return null if all numbers are the same. Essentially I'm just copying the text in the box on the left; but yet it doesn't seem to work.

@bfark13 @bwighthunter This is the challenge " The user wins when all the three numbers match. Let's create an if statement with multiple conditions in order to check whether all numbers are equal.

if(slotOne === slotTwo && slotTwo === slotThree){

return null;

}

Also, we need to show the user that he has won the game when he gets the same number in all the slots.

If all three numbers match, we should also set the text "It's A Win" to the element with class logger."

Explvcit
@Explvcit
Nov 17 2015 16:17
stuck on js slotcoin machine ."you should be displaying the result of the numbers in the corresponding slots"
NewCareer
@NewCareer
Nov 17 2015 16:17
@bfark13 @bwighthunter so I essentially just use that if function as I can't see another way around it
@bwighthunter @bfark13 but i keep returning a fail and :If all three of our random numbers are the same we should return that number. Otherwise we should return null."
any ideas?!?
Explvcit
@Explvcit
Nov 17 2015 16:19
nvm got i
NewCareer
@NewCareer
Nov 17 2015 16:19
@Explvcit how did you do the one before? where you have to do an if function?
Blake Wight
@bwighthunter
Nov 17 2015 16:19
So let me get this straight, you have 3 numbers, and if they are all the same you want to return the number,
if they are not the same, just return null?
Right now your function returns null if they are all the same
NewCareer
@NewCareer
Nov 17 2015 16:20
@bwighthunter yeah i think
Blake Wight
@bwighthunter
Nov 17 2015 16:20
if(slotOne === slotTwo && slotTwo === slotThree){
return slotOne;
}else{
}
that should return the number if they are all the same
and I created an else statement for you
you just have to fill it out
with something like "return null;"
NewCareer
@NewCareer
Nov 17 2015 16:21
@bwighthunter should I always use an else statement where there is an if statement?
ok - i;ll give it a go - thanks!
Blake Wight
@bwighthunter
Nov 17 2015 16:21
not always, just think of it
like normal language
TIEGUY
@bfark13
Nov 17 2015 16:21
@NewCareer try just using a double equal instead of a triple
Sheng
@Shengxi208
Nov 17 2015 16:22
how do you change the style color
Blake Wight
@bwighthunter
Nov 17 2015 16:22
"if all of these are equal, return the number they all are, else, return null"
Sheng
@Shengxi208
Nov 17 2015 16:22
<h2 style="color: blue">CatPhotoApp</h2>
right?
...
TIEGUY
@bfark13
Nov 17 2015 16:23
@Shengxi208 yes
NewCareer
@NewCareer
Nov 17 2015 16:24
I'm back - nope - that doesn't work.
Think I'll leave it for a bit and look with fresh eyes
TIEGUY
@bfark13
Nov 17 2015 16:25
@NewCareer sorry, I just crammed it in last night I was trying to remember what I had done
Sheng
@Shengxi208
Nov 17 2015 16:26
@bfark13 but the h2 element is not red...it should be red
Blake Wight
@bwighthunter
Nov 17 2015 16:26
@NewCareer you can also set up multiple if statements in a row with "if else" statements.
TIEGUY
@bfark13
Nov 17 2015 16:26
@NewCareer I remember this one there