These are chat archives for FreeCodeCamp/Help

6th
Sep 2015
Parag Shah
@paragshah36
Sep 06 2015 00:05
what do they exactly mean by creating a style element? i am on Waypoint: Use CSS Selectors to Style Elements
SM
@nogo10
Sep 06 2015 00:07
@paragshah36 you can use class`` orid``` to 'target' specific content on your page. That way you make style changes to these targeted items. eg. make h1 red
Terry
@tmosoff
Sep 06 2015 00:09
@nogo10 Im doing the same zipline and im having a problem prepopulating the tweet function with my quotes
@nogo10 i didnt use the api though, i used an array and pulled elements using a random number
Parag Shah
@paragshah36
Sep 06 2015 00:11
ended up getting it right. Yeah
SM
@nogo10
Sep 06 2015 00:13
@tmosoff I just got the quotes done now I just delving into the twitter api
winstonlan
@winstonlan
Sep 06 2015 00:17
hey guys i need help on my bonfire
CamperBot
@camperbot
Sep 06 2015 00:17
type bonfire name to get some info on that bonfire. And check HelpBonfires chatroom
winstonlan
@winstonlan
Sep 06 2015 00:17
Bonfire: Title Case a Sentence
CamperBot
@camperbot
Sep 06 2015 00:17

:fire:Bonfire: Title Case a Sentence :link:

function titleCase(str) {
  return str;
}

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

Return the provided string with the first letter of each word capitalized.

more info:  bf details | bf links | hint

winstonlan
@winstonlan
Sep 06 2015 00:18
bf links
CamperBot
@camperbot
Sep 06 2015 00:18
winstonlan
@winstonlan
Sep 06 2015 00:18

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

var comeTogether = myArray.join(" ");
return comeTogether;
}

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

im not sure why my code isnt coming out right
i feel like im very close to the solution
Cordoba84
@fcordoba84
Sep 06 2015 00:21
hi can any help i feel lost with bonfire cant even do first challenge
function reverseString(str) {
  return str;
}

reverseString('hello');
String[] array = "hello".split("");
avatarhzh
@avatarhzh
Sep 06 2015 00:27
@fcordoba84 split the string into an array of characters inside the function instead of outside it
Also you don't need to say what type of variable it is when declaring the variable
Cordoba84
@fcordoba84
Sep 06 2015 00:28
still nothing
im really not getting a clue on what im supposed to do
Eric Gu (@ericguuu)
@ericcgu
Sep 06 2015 00:30
there is a function on array that can reverse the array
Austin Lin
@austinylin
Sep 06 2015 00:30
@TGwonton you need to define myArray outside of the loop:
var myArray = new Array();
Eric Gu (@ericguuu)
@ericcgu
Sep 06 2015 00:30
@duliodeni
@duliodenis
Austin Lin
@austinylin
Sep 06 2015 00:33
Hey @fcordoba84, did you do the Basic JavaScript waypoints?
avatarhzh
@avatarhzh
Sep 06 2015 00:34
Hey guys, I'm trying to use AJAX to get the API for the random quote machine zipline but I keep getting 404 error. Is it because I'm using codepen?
Here's my javascript code for the AJAX request:
// variable to hold the json response
var data; 

// if you want to see what the response looks like, you can just enter this url into your browser
var url = "api.forismatic.com/api/1.0/?method=getQuote&format=jsonp&lang=en&jsonp=callback";

var callback = function( response ) { 
  data = response; 
};

// build a new XML HTTP Request  
var xhr = new XMLHttpRequest();  

// add a method that checks that response has been received and it was successful 
xhr.onreadystatechange = function() {
  if ( xhr.readyState === 4 && xhr.status === 200 ) callback( xhr.response );
};

// predpare the xhr request to be sent 
xhr.open( 'GET', url );

// send request
xhr.send();
Cordoba84
@fcordoba84
Sep 06 2015 00:35
yea but im thinking in redoing them @austinylin
Austin Lin
@austinylin
Sep 06 2015 00:37
@avatarhzh 404 usually means you have the wrong url. try putting // in front of the url. You can also put https:// or http://, but the nice thing about // is that it will automatically use https if the rest of your app is.
Eric Gu (@ericguuu)
@ericcgu
Sep 06 2015 00:37
return str.split(',').reverse().join(',');
Austin Lin
@austinylin
Sep 06 2015 00:38
@fcordoba84 first thing about your code is you want to put things inside the function
avatarhzh
@avatarhzh
Sep 06 2015 00:38
@austinylin yea I tried that but then I'm the console says I'm breaking same origin policy
Going to the url in the code on my browser brings up the random quote I need fine
it's just when I'm sending the AJAX request with the url that I get back a 404 error
Austin Lin
@austinylin
Sep 06 2015 00:39
@avatarhzh did you try “http://“? Looks like forismatic doesn’t support https (which is sad).
Cordoba84
@fcordoba84
Sep 06 2015 00:40
what things?
SM
@nogo10
Sep 06 2015 00:40
@avatarhzh I just did that quote part of zipline2: the trick is to avoid the browser blocking non-origin domain access. Using .ajax with JSONP lets jquery handle that. See http://learn.jquery.com/ajax/working-with-jsonp/
Austin Lin
@austinylin
Sep 06 2015 00:41
@fcordoba84 your lines of code:
```
function reverseString(str) {
  // your code to reverse the string goes in here
  return str;
}

reverseString('hello');
avatarhzh
@avatarhzh
Sep 06 2015 00:41
yea @nogo10 I might try with jquery instead
Austin Lin
@austinylin
Sep 06 2015 00:42
@fcordoba84 second thing is I would google a bit about how to convert a string into an array in Javascript, then how to reverse an array, and finally how to convert an array into a string.
Cordoba84
@fcordoba84
Sep 06 2015 00:42
function reverseString(str) {
  reverseString('hello');
  return str;


}
ok ill google
thanks @austinylin
CamperBot
@camperbot
Sep 06 2015 00:43
fcordoba84 sends brownie points to @austinylin :sparkles: :thumbsup: :sparkles:
:star: 52 | @austinylin | http://www.freecodecamp.com/austinylin
Jose M Viloria
@josevill
Sep 06 2015 00:43
bf Reverse a String
CamperBot
@camperbot
Sep 06 2015 00:43
Sorry, can't find a bonfire called reverse string. [ Check the map? ]
Jose M Viloria
@josevill
Sep 06 2015 00:43
bf Reverse
CamperBot
@camperbot
Sep 06 2015 00:43

:fire:Bonfire: Reverse a String :link:

function reverseString(str) {
  return str;
}

reverseString('hello');

Reverse the provided string.

more info:  bf details | bf links | hint

Jose M Viloria
@josevill
Sep 06 2015 00:43
bf details
CamperBot
@camperbot
Sep 06 2015 00:43

:fire:Bonfire: Reverse a String :link:

function reverseString(str) {
  return str;
}

reverseString('hello');
Reverse the provided string.
You may need to turn the string into an array before you can reverse it.
Your result must be a string.
Remember to use RSAP if you get stuck. Try to pair program. Write your own code.
links:
Jose M Viloria
@josevill
Sep 06 2015 00:44
@fcordoba84 You have those functions already there
@fcordoba84 You can use split reverse and join to solve that Bonfire
@fcordoba84 Click each link and read how to use them :) No biggy
Austin Lin
@austinylin
Sep 06 2015 00:45
@fcordoba84 also I would also look at this waypoint again: Waypoint: Write Reusable JavaScript with Functions
Cordoba84
@fcordoba84
Sep 06 2015 00:45
ok thanks @josevill
CamperBot
@camperbot
Sep 06 2015 00:45
fcordoba84 sends brownie points to @josevill :sparkles: :thumbsup: :sparkles:
:star: 264 | @josevill | http://www.freecodecamp.com/josevill
avatarhzh
@avatarhzh
Sep 06 2015 01:03
@nogo10 so I changed it into jquery and I'm still getting 404 error
$(document).ready(function(){
  $("a").click(function(){
    $.ajax({
      url: "api.forismatic.com/api/1.0/?method=getQuote&format=jsonp&lang=en&jsonp=callback",
      jsonp: "callback",
      dataType: "jsonp",
      data: {
        method: "getQuote",
        format: "json",
        lang: "en",
        jsonp: "sCallback"
      },
      success: function sCallback(response){
        $("#quote").text(response);
      }
    });
  });
});
Nazgul13
@Nazgul13
Sep 06 2015 01:04
dont supposed there is a dark theme to this website??
DTing
@dting
Sep 06 2015 01:04
@avatarhzh i made a demo: http://codepen.io/dting/pen/PqrZgb
Moisés Man
@moigithub
Sep 06 2015 01:05
@avatarhzh add http:// to ur url
else it will be treated as relative path to ur host
DTing
@dting
Sep 06 2015 01:10
also remove ?method=getQuote&format=jsonp&lang=en&jsonp=callback
Daniel
@Smokenham
Sep 06 2015 01:10
Can someone please help me figure out why my if comparison isn't working?
    var weatherCodes = {
                            0: '<i class= "wi wi-day-sunny"></i>',
                            1: '<i class= "wi wi-day-cloudy"></i>',
                            2: '<i class= "wi wi-day-windy"></i>'
                        }

                        for(key in weatherCodes) {
                            if(weatherCodes[key]== weather.code) {
                                var value = weatherCodes[key];
                                 html += value;
                            }
                        }

$("#weatherResult").html(html);
DTing
@dting
Sep 06 2015 01:11
is weather.code == <i class= "wi wi-day-sunny"></i> ?
or is it 0, 1, or 2?
Daniel
@Smokenham
Sep 06 2015 01:12
weather.code outputs a number.
DTing
@dting
Sep 06 2015 01:13
weatherCodes[key] isn't a number
it's the value
you would probably write your code like:
 var weatherCodes = {
                            0: '<i class= "wi wi-day-sunny"></i>',
                            1: '<i class= "wi wi-day-cloudy"></i>',
                            2: '<i class= "wi wi-day-windy"></i>'
                        }
html += weatherCodes[weather.code];

$("#weatherResult").html(html);
Daniel
@Smokenham
Sep 06 2015 01:14
That makes much more sense. Thank you @dting
CamperBot
@camperbot
Sep 06 2015 01:14
smokenham sends brownie points to @dting :sparkles: :thumbsup: :sparkles:
:star: 1028 | @dting | http://www.freecodecamp.com/dting
avatarhzh
@avatarhzh
Sep 06 2015 01:29
I'm not getting the 404 error now but I'm still not getting the quote appearing on my page. Is there something wrong with my update function?
$(document).ready(function(){
  $("#link").click(function(){
    $.ajax({
      url: "http://api.forismatic.com/api/1.0/",
      jsonp: "jsonp",
      dataType: "jsonp",
      data: {
        method: "getQuote",
        format: "jsonp",
        lang: "en",
      },
      success: function sCallback(response){
        $("#quote").text(response);
      }
    })
    .done(update)
    .fail(handleErr);
  });
});

function update(response){
  $("#link").html("<p>" + JSON.stringify(response) + "</p>");
}

function handleErr(jqxhr, textStatus, err) {
  console.log("Request Failed: " + textStatus + ", " + err);
}
Hans van Riet
@hansinla
Sep 06 2015 01:34
@avatarhzh Maybe I’m reading it wrong but according to the documentation your url should be:
url: 'http://api.forismatic.com/api/1.0/?method=getQuote&format=jsonp&jsonp=parseResult&lang=en',
Then you hanlde the response in parseResult or whatever your call your success handler.
DTing
@dting
Sep 06 2015 01:41
@avatarhzh response is an object. if you are using .text(response) and seeing something like [object Object] then it is working correctly. you need to stringify the object or choose what property of the object to use. probably response.quoteText and response.quoteAuthor. also if you just use the success callback then you dont need that .done and .fail code
Parag Shah
@paragshah36
Sep 06 2015 01:59
to create a class smaller-image do i have to do more than what is written?
SojournerOctocat
@SojournerOctocat
Sep 06 2015 02:00
@paragshah36 Which waypoint are you working on?
Parag Shah
@paragshah36
Sep 06 2015 02:00
Waypoint: Size your Images
i wrote what they wanted me to write.
Ok. I am finding I have to go the element directly and say img class ="smaller-image" and it moved me one.
SojournerOctocat
@SojournerOctocat
Sep 06 2015 02:06
Good.
Parag Shah
@paragshah36
Sep 06 2015 02:11
if we have multiple classes do we have to say it twice in the original element. for example before i got into this waypoint here was my image element <img class="smaller-image" src="https://bit.ly/fcc-relaxing-cat">
now it wants me to add the class .thick-green-border
Hans van Riet
@hansinla
Sep 06 2015 02:14
@paragshah36 In class=“” you name every class that you want to influence the element, multiple classes are separated by a space.
Parag Shah
@paragshah36
Sep 06 2015 02:15
Thank you hansinla. That was helpful. :-)
CamperBot
@camperbot
Sep 06 2015 02:15
if you want to thank someone, put an @ before their name!
Parag Shah
@paragshah36
Sep 06 2015 02:16
thank you @hansinla
CamperBot
@camperbot
Sep 06 2015 02:16
paragshah36 sends brownie points to @hansinla :sparkles: :thumbsup: :sparkles:
:star: 343 | @hansinla | http://www.freecodecamp.com/hansinla
Parag Shah
@paragshah36
Sep 06 2015 02:16
thanks @camperbot
CamperBot
@camperbot
Sep 06 2015 02:16
paragshah36 sends brownie points to @camperbot :sparkles: :thumbsup: :sparkles:
:star: 178 | @camperbot | http://www.freecodecamp.com/camperbot
DJ
@qualitymanifest
Sep 06 2015 02:18
day 8 of where art thou... rations are running low... words don't look like words anymore... i've made freinds with a volleyball...
Austin Lin
@austinylin
Sep 06 2015 02:21
@qualitymanifest lol
SojournerOctocat
@SojournerOctocat
Sep 06 2015 02:23
@qualitymanifest What do you have so far?
Matthew Farlymn
@matthewfarlymn
Sep 06 2015 02:32
Is anyone familiar with gulp?
Rafael J. Rodriguez
@Rafase282
Sep 06 2015 02:54
nope
Steve Tang
@Thescuba
Sep 06 2015 03:01
bf Bonfire: Spinal Tap Case
CamperBot
@camperbot
Sep 06 2015 03:01

:fire:Bonfire: Spinal Tap Case :link:

function spinalCase(str) {
  // "It's such a fine line between stupid, and clever."
  // --David St. Hubbins
  return str;
}

spinalCase('This Is Spinal Tap');

Convert a string to spinal case. Spinal case is all-lowercase-words-joined-by-dashes.

more info:  bf details | bf links | hint

Steve Tang
@Thescuba
Sep 06 2015 03:01
hint
CamperBot
@camperbot
Sep 06 2015 03:01
:construction: Spoilers are only in the Bonfire's Custom Room :point_right:
Raj Vansia
@rajvansia
Sep 06 2015 03:06
using codepen for pomodoro clock does anyone know how I can add a sound file to make the timer.
Jack
@yakschuss
Sep 06 2015 03:08
This message was deleted
This message was deleted
CamperBot
@camperbot
Sep 06 2015 03:09
:bulb: to format code use backticks! ``` more info
Jack
@yakschuss
Sep 06 2015 03:10
if (flip === 0) {
    return  heads;

  }

  else {
    return tails;
  }
I keep getting "Unexpected End of Script", on this Waypoint: Use Conditional Logic with IfElse Statements. Where did I go wrong?
Moisés Man
@moigithub
Sep 06 2015 03:13
heads / tails should be string.. so .. surround em with quotes
"heads"
"tails"
Jesse
@jctm30
Sep 06 2015 03:29
hi guys! just a quick question:
what does += mean in the following for loop?
for (var i = 0; i < array.length; i += size)
SojournerOctocat
@SojournerOctocat
Sep 06 2015 03:33
@jctm30 It means add size to whatever i equals.
Parag Shah
@paragshah36
Sep 06 2015 03:35
i see there are no tests or quizzes here
I have had trouble with CSS before and I get concerned about not ending up knowing CSS after I go through the lessons.
Rex Schrader
@SaintPeter
Sep 06 2015 03:47
@jctm30 i += size means i = i + size - basically it's a shortcut for adding something to a variable. You can also do *= and -=.
Parag Shah
@paragshah36
Sep 06 2015 03:54
i dont understand what they mean by turning an a element into an #
SojournerOctocat
@SojournerOctocat
Sep 06 2015 03:58
@paragshah36 Which one are you working on?
Alex
@wishe
Sep 06 2015 03:58

`function destroyer(arr, arg1, arg2) {

function isNotNumber(value) {
if (value === arg2) {
return false;
}
if (value === arg1) {
return false;
} else {
return true;
}
}
return arr.filter(isNotNumber);

}

destroyer([1, 2, 3, 1, 2, 3], 2, 3);`
didnt account for more arguments, no idea how to make a wildcard for any number of arguments. any ideas?

SojournerOctocat
@SojournerOctocat
Sep 06 2015 04:00
@wishe I used slice to grab all arguments from 1 to end.
Parag Shah
@paragshah36
Sep 06 2015 04:02

learn to code javascript at Free Code Camp logo

Map
Chat
News
Wiki
[ 26 ]

Waypoint: Make Dead Links using the Hash Symbol

I meant make Dead Links Using the Hash Symbol
@SojournerOctocat are you there?
Alex
@wishe
Sep 06 2015 04:04
@SojournerOctocat I will try another approach, thanks!
CamperBot
@camperbot
Sep 06 2015 04:04
wishe sends brownie points to @sojourneroctocat :sparkles: :thumbsup: :sparkles:
:star: 276 | @sojourneroctocat | http://www.freecodecamp.com/sojourneroctocat
SojournerOctocat
@SojournerOctocat
Sep 06 2015 04:10
@paragshah36 I'm back.
@paragshah36 For your a href link, use # instead of the url text.
As in <a href="#">
Johannes Lyytikkä
@Wildarts
Sep 06 2015 04:14

Hello guys! I would need a bit of help with "Where art thou". My code only works for 50% of the cases, but I can't figure out why the rest 50% don't work. Here is the code: function where(collection, source) {
var collectionKey= Object.keys(collection);
var sourceKey= Object.keys(source);
var arrMatch = [];

for (i=0; i<collectionKey.length-1;i++) {}
var property = collection[collectionKey[i]][sourceKey];
if (property === source[sourceKey]) {
arrMatch.push(collection[collectionKey[i]]);
}

return arrMatch;
}

Rex Schrader
@SaintPeter
Sep 06 2015 04:20
@Wildarts I believe you need to loop through all of the keys in source - there may be more than one.
Johannes Lyytikkä
@Wildarts
Sep 06 2015 04:21
@SaintPeter Thanks, I'll try that!
CamperBot
@camperbot
Sep 06 2015 04:21
wildarts sends brownie points to @saintpeter :sparkles: :thumbsup: :sparkles:
:star: 502 | @saintpeter | http://www.freecodecamp.com/saintpeter
Johannes Lyytikkä
@Wildarts
Sep 06 2015 04:26

@SaintPeter Still no luck: function where(collection, source) {
var collectionKey= Object.keys(collection);
var sourceKey= Object.keys(source);
var arrMatch = [];

for (i=0; i<collectionKey.length-1;i++) {
for (j=0; j<sourceKey.length-1;j++) {
var property = collection[collectionKey[i]][sourceKey[j]];
if (property === source[sourceKey[j]]) {
arrMatch.push(collection[collectionKey[i]]);
}
}
}

return arrMatch;
}

Robert Richey
@0x0936
Sep 06 2015 04:29
@Wildarts formatted
function where(collection, source) {
  var collectionKey= Object.keys(collection);
  var sourceKey= Object.keys(source);
  var arrMatch = [];
  for (i=0; i<collectionKey.length-1;i++) {
    for (j=0; j<sourceKey.length-1;j++) {
      var property = collection[collectionKey[i]][sourceKey[j]];
      if (property === source[sourceKey[j]]) {
        arrMatch.push(collection[collectionKey[i]]);
      }
    }
  }
  return arrMatch;
}
Rex Schrader
@SaintPeter
Sep 06 2015 04:29
@Wildarts Remmeber that all the key have to match, not just some of them.
aslamweb
@aslamweb
Sep 06 2015 04:34
Give your div element the class gray-background.
Your div element should have a gray background.
Whats wrong with my grey-background class
Robert Richey
@0x0936
Sep 06 2015 04:34
@Wildarts here is my response to another member on the same bonfire
function where(collection, source) {
  var arr = [];
  // source is static, so we can get it's keys outside the loops
  for (var x = 0; x < collection.length; x++) {
    // let's keep track of each matching key value pair with a counter
    for (var item in source) {      
      if (collection[x].hasOwnProperty(item)) {
        if (collection[x][item] == source[item]) {
          // we don't want to push the object to arr unless is has >= 
          // the number of matching key value pairs as source. increment counter
        }
      }
    }
    // if our counter >= the number of source key value pairs, it's safe to push the object to arr
  }
  return arr;
}
Johannes Lyytikkä
@Wildarts
Sep 06 2015 04:35
@SaintPeter Ok...I see what you mean, thanks!
CamperBot
@camperbot
Sep 06 2015 04:35
wildarts sends brownie points to @saintpeter :sparkles: :thumbsup: :sparkles:
:warning: wildarts already gave saintpeter points
aslamweb
@aslamweb
Sep 06 2015 04:36
Help me
CamperBot
@camperbot
Sep 06 2015 04:36

:point_right: adding environment variables [wiki]

  1. Download Varpanel.
  2. Open Varpanel.
  3. In PATH variable, add the relevant path.

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

aslamweb
@aslamweb
Sep 06 2015 04:37
I'm stuck with 37 level
Rex Schrader
@SaintPeter
Sep 06 2015 04:38
@0x0936 Thanks - great explanation for @Wildarts
CamperBot
@camperbot
Sep 06 2015 04:38
saintpeter sends brownie points to @0x0936 and @wildarts :sparkles: :thumbsup: :sparkles:
:star: 109 | @0x0936 | http://www.freecodecamp.com/0x0936
:star: 200 | @wildarts | http://www.freecodecamp.com/wildarts
x34passenger
@x34passenger
Sep 06 2015 04:38
Zipline: Build a Personal Portfolio Webpage - how do you get the background images?
Rex Schrader
@SaintPeter
Sep 06 2015 04:39
@x34passenger You can hot link 'em off the interwebs. I used www.pexels.com
@x34passenger They have great free stock images.
Feners4
@Feners4
Sep 06 2015 04:39
@SaintPeter hey, can you by any chance help me out with some Python?
SaintPeter @SaintPeter waves to @Feners4
x34passenger
@x34passenger
Sep 06 2015 04:40
@SaintPeter How do I make it a background image on twitter bootstrap?
@SaintPeter or how do I make a background image on bootstrap?
aslamweb
@aslamweb
Sep 06 2015 04:40
@dting I have problem with " Give your div element the class gray-background.
Your div element should have a gray background. " all code is correct but can't submit " it's showing that task is incomplete help
Robert Richey
@0x0936
Sep 06 2015 04:41
lolwut
Rex Schrader
@SaintPeter
Sep 06 2015 04:42
@x34passenger You can do it in css. Like:
body {
background-image: url('imageURLhere');
background-size: cover;
background-repeat: no-repeat;  /* not sure about this one */
}
aslamweb
@aslamweb
Sep 06 2015 04:45
:( no one is here to help me :(
Ashraful Islam
@iashraful
Sep 06 2015 04:47
@aslamweb what do you need?
x34passenger
@x34passenger
Sep 06 2015 04:47
@SaintPeter so you have two style file links in the html page?
<link href="main_style.css" rel="stylesheet" type="text/css">
<link href="bootstrap-3.3.5-dist/css/bootstrap.min.css" rel="stylesheet">
Robert Richey
@0x0936
Sep 06 2015 04:47
@aslamweb show us your code
aslamweb
@aslamweb
Sep 06 2015 04:49
How
How to show code ?
Copy and past
Robert Richey
@0x0936
Sep 06 2015 04:49
copy / paste is a start
aslamweb
@aslamweb
Sep 06 2015 04:50
copy and paste ?

<style>
3
.red-text {
4
color: red;
5
}
6

7
h2 {
8
font-family: Lobster, Monospace;
9
}
10

11
p {
12
font-size: 16px;
13
font-family: Monospace;
14
}
15

16
.thick-green-border {
17
border-color: green;
18
border-width: 10px;
19
border-style: solid;
20
border-radius: 50%;
21
}
22

23
.smaller-image {
24
width: 100px;
25
}
26
.grey-background
27
{
28
background-color: grey;
29
}
30
</style>
31

32

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

34

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

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

38

<div class="grey-background">
39

40
<p>Things cats love:</p>
41
<ul>
42
<li>cat nip</li>
43
<li>laser pointers</li>
44
<li>lasagna</li>
45
</ul>
46
<p>Top 3 things cats hate:</p>
47
<ol>
48
<li>flea treatment</li>
49
<li>thunder</li>
50
<li>other cats</li>
51
</ol>
52

53
</div>

Whats wrong with code , I'm unable yo
to submit level 37 grey-background
Robert Richey
@0x0936
Sep 06 2015 04:52
and before I forget, thank you @SaintPeter for thanking me. We are the unsung heroes of unofficial support staff
CamperBot
@camperbot
Sep 06 2015 04:52
0x0936 sends brownie points to @saintpeter :sparkles: :thumbsup: :sparkles:
:star: 504 | @saintpeter | http://www.freecodecamp.com/saintpeter
Jon Lucas
@jonslucas
Sep 06 2015 04:53
help format
CamperBot
@camperbot
Sep 06 2015 04:53

:point_right: code formatting [wiki]

Inline code

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

Code Block

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

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

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

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

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

Ashraful Islam
@iashraful
Sep 06 2015 04:54
<style>
3
  .red-text {
4
    color: red;
5
  }
6
​
7
  h2 {
8
    font-family: Lobster, Monospace;
9
  }
10
​
11
  p {
12
    font-size: 16px;
13
    font-family: Monospace;
14
  }
15
​
16
  .thick-green-border {
17
    border-color: green;
18
    border-width: 10px;
19
    border-style: solid;
20
    border-radius: 50%;
21
  }
22
​
23
  .smaller-image {
24
    width: 100px;
25
  }
26
  .grey-background
27
  {
28
    background-color: grey;
29
  }
30
</style>
31
​
32
<h2 class="red-text">CatPhotoApp</h2>
33
​
34
<p>Click here for <a href="#">cat photos</a>.</p>
35
​
36
<a href="#"><img class="smaller-image thick-green-border" src="https://bit.ly/fcc-relaxing-cat"></a>
37
​
38
<div class="grey-background">
39

40
  <p>Things cats love:</p>
41
  <ul>
42
    <li>cat nip</li>
43
    <li>laser pointers</li>
44
    <li>lasagna</li>
45
  </ul>
46
  <p>Top 3 things cats hate:</p>
47
  <ol>
48
    <li>flea treatment</li>
49
    <li>thunder</li>
50
    <li>other cats</li>
51
  </ol>
52

53
</div>
aslamweb
@aslamweb
Sep 06 2015 04:54

'<<style>
3
.red-text {
4
color: red;
5
}
6

7
h2 {
8
font-family: Lobster, Monospace;
9
}
10

11
p {
12
font-size: 16px;
13
font-family: Monospace;
14
}
15

16
.thick-green-border {
17
border-color: green;
18
border-width: 10px;
19
border-style: solid;
20
border-radius: 50%;
21
}
22

23
.smaller-image {
24
width: 100px;
25
}
26
.grey-background
27
{
28
background-color: grey;
29
}
30
</style>
31

32

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

34

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

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

38

<div class="grey-background">
39

40
<p>Things cats love:</p>
41
<ul>
42
<li>cat nip</li>
43
<li>laser pointers</li>
44
<li>lasagna</li>
45
</ul>
46
<p>Top 3 things cats hate:</p>
47
<ol>
48
<li>flea treatment</li>
49
<li>thunder</li>
50
<li>other cats</li>
51
</ol>
52

53
</div>>'

Ashraful Islam
@iashraful
Sep 06 2015 04:55
line numbers are looking good
Nazgul13
@Nazgul13
Sep 06 2015 04:55
@aslamweb you have a grey vs gray problem I think
aslamweb
@aslamweb
Sep 06 2015 04:56
Then what's wrong
why can't submit ?
Nazgul13
@Nazgul13
Sep 06 2015 04:57
@aslamweb change grey to gray
aslamweb
@aslamweb
Sep 06 2015 04:57
Let me check
Robert Richey
@0x0936
Sep 06 2015 04:58
formatted
<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;
}
.grey-background {
  background-color: grey;
}
</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="grey-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>
Rex Schrader
@SaintPeter
Sep 06 2015 04:58
@x34passenger Sure, you can have the css in an external file or you can put it inline.
aslamweb
@aslamweb
Sep 06 2015 04:59
@0x0936 thank
CamperBot
@camperbot
Sep 06 2015 04:59
aslamweb sends brownie points to @0x0936 :sparkles: :thumbsup: :sparkles:
:star: 111 | @0x0936 | http://www.freecodecamp.com/0x0936
Robert Richey
@0x0936
Sep 06 2015 04:59
on behalf of @x34passenger I thank you @SaintPeter
CamperBot
@camperbot
Sep 06 2015 04:59
0x0936 sends brownie points to @x34passenger and @saintpeter :sparkles: :thumbsup: :sparkles:
:warning: 0x0936 already gave saintpeter points
:warning: could not find receiver for x34passenger
Rex Schrader
@SaintPeter
Sep 06 2015 05:00
@0x0936 :P
aslamweb
@aslamweb
Sep 06 2015 05:00
@Nazgul13 yeah it's was grey and gray problem :) thanks
CamperBot
@camperbot
Sep 06 2015 05:00
aslamweb sends brownie points to @nazgul13 :sparkles: :thumbsup: :sparkles:
:star: 140 | @nazgul13 | http://www.freecodecamp.com/nazgul13
Nazgul13
@Nazgul13
Sep 06 2015 05:00
@aslamweb yw
Robert Richey
@0x0936
Sep 06 2015 05:02
Thank You @Nazgul13
CamperBot
@camperbot
Sep 06 2015 05:02
0x0936 sends brownie points to @nazgul13 :sparkles: :thumbsup: :sparkles:
:star: 141 | @nazgul13 | http://www.freecodecamp.com/nazgul13
aslamweb
@aslamweb
Sep 06 2015 05:02
How to send code formatted like you guys c
do
Robert Richey
@0x0936
Sep 06 2015 05:03
```javascript
// code
```
unless it's html
then
```html
<!-- html -->
```
Rex Schrader
@SaintPeter
Sep 06 2015 05:04
wiki format
CamperBot
@camperbot
Sep 06 2015 05:04

:point_right: code formatting [wiki]

Inline code

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

Code Block

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

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

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

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

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

Rex Schrader
@SaintPeter
Sep 06 2015 05:04
@aslamweb ^ ^
aslamweb
@aslamweb
Sep 06 2015 05:05
''' HTML
CamperBot
@camperbot
Sep 06 2015 05:05
:bulb: to format code use backticks! ``` more info
Robert Richey
@0x0936
Sep 06 2015 05:07
triple backticks on one line, then code, then triple backticks on one line
language specifier is optional, but useful for syntax highlighting
Rex Schrader
@SaintPeter
Sep 06 2015 05:10
@aslamweb The back tick is usually next to the 1 key on your keyboard, it's on the same key as the tilde ~, but unshifted. NOTE: The backticks need to be on their own line, use shift-enter to get a new line without transmitting.
Robert Richey
@0x0936
Sep 06 2015 05:10

example html code

```html

<!DOCTYPE html>
<html>
<head>
</head>
<body>
</body>
</html>

```

aslamweb
@aslamweb
Sep 06 2015 05:11
Using iPad
They describe hitting the symbol/123 key, then press and hold the apostraphe ' key
Sounds like it'll be a bit of a drag.
Hard to do on a tablet.
aslamweb
@aslamweb
Sep 06 2015 05:14
`
``` JavaScript
Its Damn hard to do with iPad
btw thanks
CamperBot
@camperbot
Sep 06 2015 05:17
if you want to thank someone, put an @ before their name!
aslamweb
@aslamweb
Sep 06 2015 05:18
@0x0936 @SaintPeter Thanks :smile: :+1:
CamperBot
@camperbot
Sep 06 2015 05:18
aslamweb sends brownie points to @0x0936 and @saintpeter :sparkles: :thumbsup: :sparkles:
:warning: aslamweb already gave 0x0936 points
:star: 506 | @saintpeter | http://www.freecodecamp.com/saintpeter
Robert Richey
@0x0936
Sep 06 2015 05:20

time for some coffee, or sleep, can't decide

coffee

aslamweb
@aslamweb
Sep 06 2015 05:20

` <style>
3
.red-text {
4
color: red;
5
}
6

7
h2 {
8
font-family: Lobster, Monospace;
9
}
10

11
p {
12
font-size: 16px;
13
font-family: Monospace;
14
}
15

16
.thick-green-border {
17
border-color: green;
18
border-width: 10px;
19
border-style: solid;
20
border-radius: 50%;
21
}
22

23
.smaller-image {
24
width: 100px;
25
}
26
.grey-background
27
{
28
background-color: grey;
29
}
30
</style>
31

32

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

34

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

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

38

<div class="grey-background">
39

40
<p>Things cats love:</p>
41
<ul>
42
<li>cat nip</li>
43
<li>laser pointers</li>
44
<li>lasagna</li>
45
</ul>
46
<p>Top 3 things cats hate:</p>
47
<ol>
48
<li>flea treatment</li>
49
<li>thunder</li>
50
<li>other cats</li>
51
</ol>
52

53
</div> '

3
  .red-text {
4
    color: red;
5
  }
6
​
7
  h2 {
8
    font-family: Lobster, Monospace;
9
  }
10
​
11
  p {
12
    font-size: 16px;
13
    font-family: Monospace;
14
  }
15
​
16
  .thick-green-border {
17
    border-color: green;
18
    border-width: 10px;
19
    border-style: solid;
20
    border-radius: 50%;
21
  }
22
​
23
  .smaller-image {
24
    width: 100px;
25
  }
26
  .grey-background
27
  {
28
    background-color: grey;
29
  }
30
</style>
31
​
32
<h2 class="red-text">CatPhotoApp</h2>
33
​
34
<p>Click here for <a href="#">cat photos</a>.</p>
35
​
36
<a href="#"><img class="smaller-image thick-green-border" src="https://bit.ly/fcc-relaxing-cat"></a>
37
​
38
<div class="grey-background">
39

40
  <p>Things cats love:</p>
41
  <ul>
42
    <li>cat nip</li>
43
    <li>laser pointers</li>
44
    <li>lasagna</li>
45
  </ul>
46
  <p>Top 3 things cats hate:</p>
47
  <ol>
48
    <li>flea treatment</li>
49
    <li>thunder</li>
50
    <li>other cats</li>
51
  </ol>
52

53
</div>
Wow I dit it but it's not well formatted
3
  .red-text {
4
    color: red;
5
  }
6
​
7
  h2 {
8
    font-family: Lobster, Monospace;
9
  }
10
​
11
  p {
12
    font-size: 16px;
13
    font-family: Monospace;
14
  }
15
​
16
  .thick-green-border {
17
    border-color: green;
18
    border-width: 10px;
19
    border-style: solid;
20
    border-radius: 50%;
21
  }
22
​
23
  .smaller-image {
24
    width: 100px;
25
  }
26
  .grey-background
27
  {
28
    background-color: grey;
29
  }
30
</style>
31
​
32
<h2 class="red-text">CatPhotoApp</h2>
33
​
34
<p>Click here for <a href="#">cat photos</a>.</p>
35
​
36
<a href="#"><img class="smaller-image thick-green-border" src="https://bit.ly/fcc-relaxing-cat"></a>
37
​
38
<div class="grey-background">
39

40
  <p>Things cats love:</p>
41
  <ul>
42
    <li>cat nip</li>
43
    <li>laser pointers</li>
44
    <li>lasagna</li>
45
  </ul>
46
  <p>Top 3 things cats hate:</p>
47
  <ol>
48
    <li>flea treatment</li>
49
    <li>thunder</li>
50
    <li>other cats</li>
51
  </ol>
52

53
</div>
Prashanth Chandra
@prashcr
Sep 06 2015 05:23
// This makes sense because JS's operators compare object references when dealing with objects
[1, 2, 3] === [1, 2, 3]   // false
[1, 2, 3] == [1, 2, 3] // false, because type coercion doesn't apply to object references?
[1, 2, 3] <   [1, 2, 3]   // false
[1, 2, 3] >   [1, 2, 3]   // false
// But if object references are like pointers, which are numbers,
// shouldn't they be either greater, less or equal to each other?
// Otherwise, how do they work?

// Why are these true?
// I'm guessing >= and <= call Array.prototype.valueOf()
// instead of using object references
// And then it becomes "[1, 2, 3]"

[1, 2, 3] <= [1, 2, 3]   // true
[1, 2, 3] >= [1, 2, 3]   // true
Robert Richey
@0x0936
Sep 06 2015 05:26
may or may not be information overload
aslamweb
@aslamweb
Sep 06 2015 05:27
<style>
3
  .red-text {
4
    color: red;
5
  }
6
​
7
  h2 {
8
    font-family: Lobster, Monospace;
9
  }
10
​
11
  p {
12
    font-size: 16px;
13
    font-family: Monospace;
14
  }
15
​
16
  .thick-green-border {
17
    border-color: green;
18
    border-width: 10px;
19
    border-style: solid;
20
    border-radius: 50%;
21
  }
22
​
23
  .smaller-image {
24
    width: 100px;
25
  }
26
  .grey-background
27
  {
28
    background-color: grey;
29
  }
30
</style>
31
​
32
<h2 class="red-text">CatPhotoApp</h2>
33
​
34
<p>Click here for <a href="#">cat photos</a>.</p>
35
​
36
<a href="#"><img class="smaller-image thick-green-border" src="https://bit.ly/fcc-relaxing-cat"></a>
37
​
38
<div class="grey-background">
39

40
  <p>Things cats love:</p>
41
  <ul>
42
    <li>cat nip</li>
43
    <li>laser pointers</li>
44
    <li>lasagna</li>
45
  </ul>
46
  <p>Top 3 things cats hate:</p>
47
  <ol>
48
    <li>flea treatment</li>
49
    <li>thunder</li>
50
    <li>other cats</li>
51
  </ol>
52

53
</div>
var code= "formated";
<style>
3
  .red-text {
4
    color: red;
5
  }
6
​
7
  h2 {
8
    font-family: Lobster, Monospace;
9
  }
10
​
11
  p {
12
    font-size: 16px;
13
    font-family: Monospace;
14
  }
15
​
16
  .thick-green-border {
17
    border-color: green;
18
    border-width: 10px;
19
    border-style: solid;
20
    border-radius: 50%;
21
  }
22
​
23
  .smaller-image {
24
    width: 100px;
25
  }
26
  .grey-background
27
  {
28
    background-color: grey;
29
  }
30
</style>
31
​
32
<h2 class="red-text">CatPhotoApp</h2>
33
​
34
<p>Click here for <a href="#">cat photos</a>.</p>
35
​
36
<a href="#"><img class="smaller-image thick-green-border" src="https://bit.ly/fcc-relaxing-cat"></a>
37
​
38
<div class="grey-background">
39

40
  <p>Things cats love:</p>
41
  <ul>
42
    <li>cat nip</li>
43
    <li>laser pointers</li>
44
    <li>lasagna</li>
45
  </ul>
46
  <p>Top 3 things cats hate:</p>
47
  <ol>
48
    <li>flea treatment</li>
49
    <li>thunder</li>
50
    <li>other cats</li>
51
  </ol>
52

53
</div>

var code = "formated";
How to formate code
Rex Schrader
@SaintPeter
Sep 06 2015 05:29
@aslamweb Suffice to say we're not goint to get any better. What is the question?
aslamweb
@aslamweb
Sep 06 2015 05:29
@0x0936 how to formate the code
Rex Schrader
@SaintPeter
Sep 06 2015 05:29
wiki format
CamperBot
@camperbot
Sep 06 2015 05:29

:point_right: code formatting [wiki]

Inline code

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

Code Block

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

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

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

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

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

DJ
@qualitymanifest
Sep 06 2015 05:33
@SojournerOctocat thanks for the help
CamperBot
@camperbot
Sep 06 2015 05:33
qualitymanifest sends brownie points to @sojourneroctocat :sparkles: :thumbsup: :sparkles:
:star: 277 | @sojourneroctocat | http://www.freecodecamp.com/sojourneroctocat
x34passenger
@x34passenger
Sep 06 2015 06:06
Zipline: Build a Personal Portfolio Webpage - how do I make the four web pages all available on one page via scrollling?
Gaurav Chauhan
@gschauhan
Sep 06 2015 06:06
Hello, I just reached at ziplines. the first one,making "about me" page. I am confused. Where to start? what should i do first?
Gaurav Chauhan
@gschauhan
Sep 06 2015 06:17
@x34passenger i was talking about the same zipline
DTing
@dting
Sep 06 2015 06:24
i think they just mean have sections on your portfolio page for each of those 4 things.
x34passenger
@x34passenger
Sep 06 2015 06:25
@dting is it a <section> tag?
Bill
@kirah1314
Sep 06 2015 06:31
@gschauhan this would be a good start
http://getbootstrap.com/getting-started/
DTing
@dting
Sep 06 2015 06:33
you could use sections but i just meant that as a generic term.
Bill
@kirah1314
Sep 06 2015 06:33
@x34passenger you just need to add this background-attachment: fixed;
to CSS
x34passenger
@x34passenger
Sep 06 2015 06:41
@kirah1314 I need to have 4 areas on the html page in which each area would have its own background image, do I use <div> to mimic each of the 4 pages?
Bill
@kirah1314
Sep 06 2015 06:42
@x34passenger yeah you should have separate <div> for each area. And a container for each page too
Brad Johnson
@ozjohnson
Sep 06 2015 06:55
i can't seem to get this to return true for the Mutations problem. is my second return in the wrong place?
function mutation(arr) {

var str0 = arr[0].toLowerCase().split("");
var str1 = arr[1].toLowerCase().split("");
for (var i = 0; i < str0.length;i++){
  if(str0.indexOf(str1[i]) === -1){
    return false;
  }
}
    return true;
}
mutation(['hello', 'Hello']);
ah just found an error but still failing on 3 tests. any suggestions?
Aleksandar B.
@aleksandar-b
Sep 06 2015 07:13
@ozjohnson you should check indexOf for second array not first
@ozjohnson actually no, my mistake
@ozjohnson just change str0.length to str1.length
Brad Johnson
@ozjohnson
Sep 06 2015 07:29
thanks @samosale! kicking myself over missing that. time to step away from the keyboard methinks.
CamperBot
@camperbot
Sep 06 2015 07:29
ozjohnson sends brownie points to @samosale :sparkles: :thumbsup: :sparkles:
:star: 257 | @samosale | http://www.freecodecamp.com/samosale
kioufhs
@kioufhs
Sep 06 2015 07:41
hello, i try to run test and shows me "unexpected token;"
Greg
@theMugician
Sep 06 2015 07:42

I can't seem to get Bonfire: Title Case A Sentence working.
What is wrong with my code.

function titleCase(str) {
var word = str.toLowerCase().split(" ");
for(var i = 0; i < word.length; i++){
word[i].charAt(0).ToUpperCase();
}
word.join(" ");
return word;
}

Rex Schrader
@SaintPeter
Sep 06 2015 07:50

@theMugician Strings in javascript are immutable - they cannot be changed.
This code:

word[i].charAt(0).ToUpperCase();

returns a single character. It's not assigned to anything, so nothing happens.
You need to do something like this:

word[i] = word[i].charAt(0).ToUpperCase(); // plus some more stuff here
Steve Tang
@Thescuba
Sep 06 2015 07:54
with codepen i am having trouble getting a link to open up
<div class='col-md-3'> <button class='btn btn-block btn-danger' href='http://www.freecodecamp.com/thescuba' target='_blank'>Free Code Camp</button> </div>
Thomas Vaeth
@thomasvaeth
Sep 06 2015 07:55
Did anyone do the Zipline for the pomodoro clock?
Chris Kissoon
@ChrisKissoon
Sep 06 2015 07:55
You forgot the
Anchor tag
<A href="">hi</a>
Steve Tang
@Thescuba
Sep 06 2015 07:56
@ChrisKissoon Thank you!
CamperBot
@camperbot
Sep 06 2015 07:56
thescuba sends brownie points to @chriskissoon :sparkles: :thumbsup: :sparkles:
:star: 32 | @chriskissoon | http://www.freecodecamp.com/chriskissoon
Chris Kissoon
@ChrisKissoon
Sep 06 2015 07:57
No Probs
Steve Tang
@Thescuba
Sep 06 2015 07:57
@ChrisKissoon is it just that simple in this case? where im tryin to link from a botton rather than text
Chris Kissoon
@ChrisKissoon
Sep 06 2015 07:57
@Thescuba
kangyao
@kay78
Sep 06 2015 07:59
how do i paste my code so that it appear in the black box with color text format?
Thomas Vaeth
@thomasvaeth
Sep 06 2015 07:59
<div class='col-md-3'> <a href = 'http://www.freecodecamp.com/thescuba' target='_blank'><button class='btn btn-block btn-danger'>Free Code Camp</button> </div>
Chris Kissoon
@ChrisKissoon
Sep 06 2015 07:59
Yes it should be but the anchor tag is supposed to be nesting the button if you are linking the button
Thomas Vaeth
@thomasvaeth
Sep 06 2015 07:59
And then you need a </a> after the </button>
@kay78 On the side of the chat there is a M with a down arrow. That will show you how to do everything.
Vos
@KrisVos130
Sep 06 2015 08:00
@thomasvaeth Yeah, I completed the Pomodoro clock
Thomas Vaeth
@thomasvaeth
Sep 06 2015 08:02
@KrisVos130 I have no idea how to get the clock working. I have everything else ready to go.
Steve Tang
@Thescuba
Sep 06 2015 08:02
@thomasvaeth Thanks is worked great
CamperBot
@camperbot
Sep 06 2015 08:02
thescuba sends brownie points to @thomasvaeth :sparkles: :thumbsup: :sparkles:
:star: 222 | @thomasvaeth | http://www.freecodecamp.com/thomasvaeth
Vos
@KrisVos130
Sep 06 2015 08:02
@thomasvaeth Could you send me the link to the codepen?
Thomas Vaeth
@thomasvaeth
Sep 06 2015 08:05
@KrisVos130 I haven't even started working on the clock part, but here is everything else.
kangyao
@kay78
Sep 06 2015 08:05
can someone help me with the code below, i got the message "Invalid left hand side in assignment"
function titleCase(str) {
  str = str.split(" ");
  for (i = 0; i < str.length; i++) {
    str[i].charAt(0) = str[i].charAt(0).toUpperCase();
  };

  return str.join(' ');

}

titleCase("I'm a little tea pot");
Vos
@KrisVos130
Sep 06 2015 08:07
@thomasvaeth You can for example set an interval of 1 second and then every 1 second subtract 1 second from the total time
Thomas Vaeth
@thomasvaeth
Sep 06 2015 08:08
@KrisVos130 I might need to sleep on it. I'm really stumped here.
Luis Felipe López G.
@luishendrix92
Sep 06 2015 08:09
@kay78 Strings are immutable, you'd need to either re-split each word and then join them or using a slicing method.
Chris Kissoon
@ChrisKissoon
Sep 06 2015 08:11
Topics
Topic
Help
CamperBot
@camperbot
Sep 06 2015 08:11

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

Chris Kissoon
@ChrisKissoon
Sep 06 2015 08:11
Find topic
CamperBot
@camperbot
Sep 06 2015 08:11

find topic

:zero: topic

Chris Kissoon
@ChrisKissoon
Sep 06 2015 08:11
Find css
Steve Tang
@Thescuba
Sep 06 2015 08:13
@kay78 @luishendrix92 is right, you are going to fins that using substring() is very useful
oliverbru
@oliverbru
Sep 06 2015 08:22
find jquery
oliverbru
@oliverbru
Sep 06 2015 08:23
wiki jquery
CamperBot
@camperbot
Sep 06 2015 08:23

:point_right: waypoint change the css of an element using jquery [wiki]

Change the CSS of an Element Using jQuery

We can also change the CSS of an HTML element directly with jQuery.

Query has a function called .css() that allows you to change the CSS of an element.

<script>
  $(document).ready(function() {
    $("#target1").css("color", "red");

  });
</script>

:pencil: read more about waypoint change the css of an element using jquery on the FCC Wiki

Brad Johnson
@ozjohnson
Sep 06 2015 08:52
any suggestions on how this could be written more concisely?
function bouncer(arr) {
  // Don't show a false ID to this bouncer.
  var filtered = arr.filter(
    function (filFalse) {
        return (filFalse != 0 && filFalse != "" && filFalse != null & filFalse != undefined && filFalse != NaN);
    }
  )
  return filtered;
 }

bouncer([7, 'ate', '', false, 9]);
Soumya Rauth
@soumyaRauth
Sep 06 2015 10:32
Need help... With Pomodoro clock... I don't know why the interval timer is not starting... Plz help... Here'e my codepen link... http://codepen.io/soumya_rauth/pen/PPoZMM
I think it is not entering into the if(duration===0 && sec===0){} block....
LilitAl
@LilitAl
Sep 06 2015 10:45
reverse a string.png
Hi everybody! I'm stuck in Bonfire: Reverse a string. How to return multiple variables?
in this way I get only last one reversed.
Afroz (zorfa)
@zorfa
Sep 06 2015 10:52
Hi everyone!! I've just started doing the Ziplines.... does anybody have some good resources on how to use API for the random quote machine? I am lost and clueless!
Mateja Trifunovski
@Matko95
Sep 06 2015 11:01
@LilitAl you are trying to hard code the bonfire
This message was deleted

@LilitAl

function reverseString(str){
       return str.split("").reverse().join("");
}

will do it for every case, str is a parameter that the function is given, for every case

Rory Smith
@alanbuchanan
Sep 06 2015 11:48
@soumyaRauth did you see that clue i gave you yesterday?
@LilitAl your function has to apply to any string that's passed into it. you only need 1 function
Alex
@wishe
Sep 06 2015 11:55

```function destroyer(arr) {

function isNotNumber(v) {
for (var i = 1; i < arguments.length; i++) {
if(v === arguments[i]) {
return false;
} else {
return true;
}
}
}

return arr.filter(isNotNumber);

}
destroyer([1, 2, 3, 1, 2, 3], 2, 3);
```
Why does this not work?

```
function destroyer(arr) {
function isNotNumber(v) {
for (var i = 1; i < arguments.length; i++) {
if(v === arguments[i]) {
return false;
} else {
return true;
}
}
}
return arr.filter(isNotNumber);
}
destroyer([1, 2, 3, 1, 2, 3], 2, 3);
Cant get this markdown to work in chat here either!
Rory Smith
@alanbuchanan
Sep 06 2015 12:02
@wishe filter() will test all the elements of the array
so you shouldn't need a for loop
@wishe ah sorry you're testing the arguments in that
Alex
@wishe
Sep 06 2015 12:04
It just returns the array like nothing has been filtered
Rory Smith
@alanbuchanan
Sep 06 2015 12:10
@wishe i did pretty much the same as you, but i made a new array called numsToRemove and then tested that with indexOf
Alex
@wishe
Sep 06 2015 12:14
Hmm, i guess i can try another approach. I just dont understand why my way does not work.
Ahmed Elsersy
@sersy
Sep 06 2015 12:22
Bonfire: Factorialize a Number
CamperBot
@camperbot
Sep 06 2015 12:22

:fire:Bonfire: Factorialize a Number :link:

function factorialize(num) {
  return num;
}

factorialize(5);

Return the factorial of the provided integer.

more info:  bf details | bf links | hint

kaubin05
@kaubin05
Sep 06 2015 12:24
Hello, I am doing a bonfire to try and get the top value from 4 arrays. I am trying to loop through each array, store the number in a new array, reset my top, and go to the next array in the array, but it doesnt seem to be working. Similar google examples dont seem to work either. I added notes to try and understand better...

function largestOfFour(arr) {
// You can do this!
//array to push the answers
var answers = [];
//value to collect my top numbers
var top = 0;
//for loop to go through the first array level
for(var j = 0; j > arr.length; j++){
//for loop to go through each second level array
for(var i = 0; i > arr[j].length; i++){
if(top < arr[j][i]){
//push the answer to top
top = arr[j][i];
}
//push top to my final array
answers.push(top)
// reset top before starting the loop again.
top = 0
}
}
//change array to answers so I dont have to change the final return
arr = answers
return arr;
}

largestOfFour([[4, 5, 1, 3], [13, 27, 18, 26], [32, 35, 37, 39], [1000, 1001, 857, 1]]);

Rory Smith
@alanbuchanan
Sep 06 2015 12:25
@wishe have you tried debugging your code in dev tools? i don't think it treats arguments as expected
Screen Shot 2015-09-06 at 13.24.51.png
Alex
@wishe
Sep 06 2015 12:29
my console dont display anything in the fcc windows
Rory Smith
@alanbuchanan
Sep 06 2015 12:34
@wishe https://developer.chrome.com/devtools/docs/javascript-debugging try this if you want to debug your code. it will save a lot of time
Alex
@wishe
Sep 06 2015 12:35
thanks @alanbuchanan
CamperBot
@camperbot
Sep 06 2015 12:35
wishe sends brownie points to @alanbuchanan :sparkles: :thumbsup: :sparkles:
:star: 246 | @alanbuchanan | http://www.freecodecamp.com/alanbuchanan
Arooj
@aroojahmad
Sep 06 2015 12:40
$("#left-well").parent().css("background-color", "red")
Why does this not satisfy: "Your left-well element should have a red background."?
Alex
@wishe
Sep 06 2015 12:41
change parent to addClass i think
Aniruddh Agarwal
@anrddh
Sep 06 2015 12:41
@wishe nope, that wouldn't work
Alex
@wishe
Sep 06 2015 12:41
or no, actually
Aniruddh Agarwal
@anrddh
Sep 06 2015 12:41
@aroojahmad can you link me to the waypoint?
Alex
@wishe
Sep 06 2015 12:42
but you are targeting the parent element of the #left-well
try remove parent
Alex
@wishe
Sep 06 2015 12:43
#left-well should be #target1 because you are targeting the parent of that element which is the #left-well
wow
enlarge text much
Aniruddh Agarwal
@anrddh
Sep 06 2015 12:44
Give the parent of the #target1 element a background-color of red.
Gotta read the waypoint description more closely :D
Arooj
@aroojahmad
Sep 06 2015 12:45
lol
rookie mistake, thank you @wishe @awesomeaniruddh
CamperBot
@camperbot
Sep 06 2015 12:46
aroojahmad sends brownie points to @wishe and @awesomeaniruddh :sparkles: :thumbsup: :sparkles:
:star: 237 | @wishe | http://www.freecodecamp.com/wishe
:star: 364 | @awesomeaniruddh | http://www.freecodecamp.com/awesomeaniruddh
Aniruddh Agarwal
@anrddh
Sep 06 2015 12:46
:D
Keep the mistakes rolling in, so that my brownie points keep coming in too :P
Hector
@hectormanzani
Sep 06 2015 12:48
Hey is there any place where I can find Bonfire explanations? Not the actual solution but how they got to the final point
Aniruddh Agarwal
@anrddh
Sep 06 2015 12:49
Hints are being implemented right now.
bf where art thou
CamperBot
@camperbot
Sep 06 2015 12:49

:fire:Bonfire: Where art thou :link:

function where(collection, source) {
  var arr = [];
  // What's in a name?
  return arr;
}

where([{ first: 'Romeo', last: 'Montague' }, { first: 'Mercutio', last: null }, { first: 'Tybalt', last: 'Capulet' }], { last: 'Capulet' });

Make a function that looks through a list (first argument) and returns an array of all objects that have equivalent property values (second argument).

more info:  bf details | bf links | hint

Aniruddh Agarwal
@anrddh
Sep 06 2015 12:49
hint
CamperBot
@camperbot
Sep 06 2015 12:49
:construction: Spoilers are only in the Bonfire's Custom Room :point_right:
Aniruddh Agarwal
@anrddh
Sep 06 2015 12:49
^ do that for any bonfire
I'm not sure if they have done it for all of the bonfires though
Hector
@hectormanzani
Sep 06 2015 12:50
@awesomeaniruddh thanks!
CamperBot
@camperbot
Sep 06 2015 12:50
hectormanzani sends brownie points to @awesomeaniruddh :sparkles: :thumbsup: :sparkles:
:star: 365 | @awesomeaniruddh | http://www.freecodecamp.com/awesomeaniruddh
Christopher Hinojosa
@Draxell
Sep 06 2015 13:06
anyone know how I can share my copdepen full page preview?
Abhisek Pattnaik
@abhisekp
Sep 06 2015 13:08
@Draxell just paste the link here
Abhisek Pattnaik
@abhisekp
Sep 06 2015 13:09
@0x0936 nice work :+1:
Christopher Hinojosa
@Draxell
Sep 06 2015 13:09
every time I try to share that link the person keeps telling me the link won't work
Abhisek Pattnaik
@abhisekp
Sep 06 2015 13:10
lolz :D
Christopher Hinojosa
@Draxell
Sep 06 2015 13:13
any idea why?
Mateja Trifunovski
@Matko95
Sep 06 2015 13:13
works for me
is that the shatterer on the website? :D
Christopher Hinojosa
@Draxell
Sep 06 2015 13:14
shatterer?
Mateja Trifunovski
@Matko95
Sep 06 2015 13:14
The dragon on the about page
Christopher Hinojosa
@Draxell
Sep 06 2015 13:14
idk, I just looked up dragon and found it
Abhisek Pattnaik
@abhisekp
Sep 06 2015 13:14
@Draxell what you mean by link not won't work?
Christopher Hinojosa
@Draxell
Sep 06 2015 13:15
idk the guys I was asking to look at it said when he clicked it it said "<deleted link>"
marzelin
@marzelin
Sep 06 2015 13:24

in Bonfire: Symmetric Difference the second assertion is

assert.deepEqual(sym([1, 2, 5], [2, 3, 5], [3, 4, 5]), [1, 4, 5], 'should return the symmetric difference of the given arrays');

According to the definition: The mathematical term symmetric difference refers to the elements in two sets that are in either the first or second set, but not in both.
the number 5 is in more than one array so the result of symmetric difference of those arrays should be [1,4] not [1,4,5], or am I missing something?

Alex
@wishe
Sep 06 2015 13:27
function destroyer(arr) {

  var args = [];
  for (i = 1; i < arguments.length; i++) {
    args.push(arguments[i]);
  }
  function isNotNumber(v) {
    for (i = 1; i <= args.length; i++) {
       if(v === args[i]) {
         return false;
       } else {
         return true;
       }
    }
  }
  return arr.filter(isNotNumber);
}

destroyer([1, 2, 3, 1, 2, 3], 2, 3);
Why does this not work, what am i missing here?
Mateja Trifunovski
@Matko95
Sep 06 2015 13:28
@marzelin I don't know if I'm wrong, but if you first do symmetric difference of arr[0], and arr1, you get [1,3] and then with [3,4,5], you would get [1,4,5]
Osazeme Usen
@osazemeu
Sep 06 2015 13:29
Anybody guide me on Map the Debris bonfire?
Christopher Hinojosa
@Draxell
Sep 06 2015 13:34
not I
can anyone look at my code and tell me why my picture isn't showing up on my portfolio?
marzelin
@marzelin
Sep 06 2015 13:38
@Matko95 oh so it works like this: take two first arrays and do simmetric comparison on them, then take that new array and compare it with the next array. Thanks :)
CamperBot
@camperbot
Sep 06 2015 13:38
marzelin sends brownie points to @matko95 :sparkles: :thumbsup: :sparkles:
:star: 209 | @matko95 | http://www.freecodecamp.com/matko95
Christopher Hinojosa
@Draxell
Sep 06 2015 13:39
!points
what are points for?
x34passenger
@x34passenger
Sep 06 2015 13:39
Zipline: Build a Personal Portfolio Webpage - I'm not sure how to set the background for one of the webpages, I've declared a <div id="pageOne"> but not sure how to set the background image in the css file
Mateja Trifunovski
@Matko95
Sep 06 2015 13:39
@marzelin I'm not entirely sure, but i think it's like that :D
wiki points
CamperBot
@camperbot
Sep 06 2015 13:39

:point_right: brownie points [wiki]

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

A user profile picture next to a with Brownie Points score

There are three ways you can get Brownie Points:

  1. Complete challenges - you get one point per challenge you complete
  2. Post relevant links on Camper News - you get 1 point for posting a link, and another point for each upvote your link gets
  3. Help other campers in chat - each time you help another camper and they thank you (by typing "thanks @yourname"), you will get a point

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

They also add to your Streak.
:pencil: read more about brownie points on the FCC Wiki

Mateja Trifunovski
@Matko95
Sep 06 2015 13:39
@x34passenger background: red; etc
Christopher Hinojosa
@Draxell
Sep 06 2015 13:39

Home {

background-image: url(http://orig02.deviantart.net/da43/f/2013/219/9/a/9a9f97500bdbf13dfddc1e1b61ace8bf-d6h59lm.jpg);
background-size: cover;
background-attachment: fixed;
}
Mateja Trifunovski
@Matko95
Sep 06 2015 13:40
@x34passenger or background: url("url.com");
Christopher Hinojosa
@Draxell
Sep 06 2015 13:40
i didn't know it would actually show my image on here
x34passenger
@x34passenger
Sep 06 2015 13:42
It is not showing up:
#homePage
{
    background-image: url('images/sea.jpg');
    background-size: cover;
    background-repeat: no-repeat;  /* not sure about this one */
}
Mateja Trifunovski
@Matko95
Sep 06 2015 13:42
@x34passenger are you doing it on codepen?
x34passenger
@x34passenger
Sep 06 2015 13:43
@Matko95 no, I got it to show up in the body, but I can upload the code to codepen
Christopher Hinojosa
@Draxell
Sep 06 2015 13:43
i don't think url() will work with a .jpg
x34passenger
@x34passenger
Sep 06 2015 13:43
@Matko95 let me do that now
Mateja Trifunovski
@Matko95
Sep 06 2015 13:44
@x34passenger i'm not sure what images/ represents
Christopher Hinojosa
@Draxell
Sep 06 2015 13:45
I'm sure it's a file saved to his computer
x34passenger
@x34passenger
Sep 06 2015 13:45
@Matko95 it is a local folder on my macbook that holds all the images
let me upload the code to codepen
Christopher Hinojosa
@Draxell
Sep 06 2015 13:46
can you upload a picture from your computer for a website?
i thought it had to use a URL image?
Mateja Trifunovski
@Matko95
Sep 06 2015 13:47
yes you can
c:/images/img.jpg is still a url
Christopher Hinojosa
@Draxell
Sep 06 2015 13:48
but how does the site know to look at your computer for the image?
Raj Vansia
@rajvansia
Sep 06 2015 13:48
@Draxell that will only work locally unsless thoes files are also hosted with your site
Christopher Hinojosa
@Draxell
Sep 06 2015 13:49
kinda makes sense
I'm still new to this whole thing
Raj Vansia
@rajvansia
Sep 06 2015 13:50
you can have 'images/sea.jpg' as you saw in that code snippite but you would need a hosted file in your public folder as folder 'images' containing the sea.jpg
x34passenger
@x34passenger
Sep 06 2015 13:51
@Matko95 I've uploaded my code to codepen, now how can I show the code on codepen?
Mateja Trifunovski
@Matko95
Sep 06 2015 13:51
@x34passenger just send the link
x34passenger
@x34passenger
Sep 06 2015 13:51
Abdelaziz Mokhnache
@Abdelaziz18003
Sep 06 2015 13:52
@x34passenger try to do like so
#homePage
{
    background-image: url('../images/sea.jpg');
    background-size: cover;
    background-repeat: no-repeat;  /* not sure about this one */
}
x34passenger
@x34passenger
Sep 06 2015 13:52
@Abdelaziz18003 I did, not working
Raj Vansia
@rajvansia
Sep 06 2015 13:53
@x34passenger so if you are using codepen from what i know i think the only way is to host your image file in an other site like imgur
raykoff
@raykoff
Sep 06 2015 13:53
I need some help with bonfire Where art thou
CamperBot
@camperbot
Sep 06 2015 13:53
type bonfire name to get some info on that bonfire. And check HelpBonfires chatroom
x34passenger
@x34passenger
Sep 06 2015 13:53
@rajvansia I have the image linked from a url
Raj Vansia
@rajvansia
Sep 06 2015 13:54
what is the url look like
does*
Christopher Hinojosa
@Draxell
Sep 06 2015 13:54
idk, I'm lost as well. my picture doesn't show up on mine either the only difference I can see between ours is mine is a url from google
Raj Vansia
@rajvansia
Sep 06 2015 13:55
i think the issue @x34passenger is that that url does not end in .jpg or .png
one sec let me show you an example
Alex
@wishe
Sep 06 2015 13:55
How can i use the chrome dev tools for debugging on Waypoints and stuff, i dont even know which files the code is in
this is the direct link to the image url
Mateja Trifunovski
@Matko95
Sep 06 2015 13:57
@x34passenger yes, try using this link https://static.pexels.com/photos/7663/pexels-photo.jpeg
and put your id above the container
@x34passenger or just do this
body
{
    background-image: url('https://static.pexels.com/photos/7663/pexels-photo.jpeg');
    background-size: cover;
    background-repeat: no-repeat;  /* not sure about this one */
}
x34passenger
@x34passenger
Sep 06 2015 14:01
@Matko95 that works, however, the entire html page has that image, how do I make it like the example and have 4 background images that are scrollable on one web page?
Mateja Trifunovski
@Matko95
Sep 06 2015 14:03
@x34passenger wrap a div around that area, and target it's class or id
x34passenger
@x34passenger
Sep 06 2015 14:03
@Matko95 around the <body> tag?
Mateja Trifunovski
@Matko95
Sep 06 2015 14:04
@x34passenger no, sec
@x34passenger http://codepen.io/Matko95/pen/qOWVmZ etc for my portoflio, if i wanted several background i would wrap a div around about me, portofolio and contact
Abdelaziz Mokhnache
@Abdelaziz18003
Sep 06 2015 14:05
@wishe I don't think that it's possible to do so, but you can use console.log() and it will be printed out in your browser console
x34passenger
@x34passenger
Sep 06 2015 14:09
@Matko95 ok I see what you are saying, you have essentially 4 containers with a <div> wrapping each container
Alex
@wishe
Sep 06 2015 14:09
@Abdelaziz18003 Yea i will try to debug it with logging. Thanks!
CamperBot
@camperbot
Sep 06 2015 14:09
wishe sends brownie points to @abdelaziz18003 :sparkles: :thumbsup: :sparkles:
:star: 244 | @abdelaziz18003 | http://www.freecodecamp.com/abdelaziz18003
Mateja Trifunovski
@Matko95
Sep 06 2015 14:10
@x34passenger yep, i would recommend that you start your portfolio on your own, without that template, because it's harder to manipulate that one
x34passenger
@x34passenger
Sep 06 2015 14:10
@Matko95 I see what you are saying
@Matko95 I can now see that the template is harder to manipulate as you've stated exactly
@Matko95 how do I give you brownie points?
Mateja Trifunovski
@Matko95
Sep 06 2015 14:12
@x34passenger you just say thank you and tag me :D
CamperBot
@camperbot
Sep 06 2015 14:12
matko95 sends brownie points to @x34passenger :sparkles: :thumbsup: :sparkles:
:warning: could not find receiver for x34passenger
x34passenger
@x34passenger
Sep 06 2015 14:12
@Matko95 thank you
CamperBot
@camperbot
Sep 06 2015 14:12
x34passenger sends brownie points to @matko95 :sparkles: :thumbsup: :sparkles:
:star: 211 | @matko95 | http://www.freecodecamp.com/matko95
Cicero82
@Cicero82
Sep 06 2015 14:14
hi
Alex
@wishe
Sep 06 2015 14:15
This is driving me crazy!
CamperBot
@camperbot
Sep 06 2015 14:15
type bonfire name to get some info on that bonfire. And check HelpBonfires chatroom
Alex
@wishe
Sep 06 2015 14:16
bonfire seek and destroy
CamperBot
@camperbot
Sep 06 2015 14:16

:fire:Bonfire: Seek and Destroy :link:

function destroyer(arr) {
  // Remove all the values
  return arr;
}

destroyer([1, 2, 3, 1, 2, 3], 2, 3);

You will be provided with an initial array (the first argument in the destroyer function), followed by one or more arguments. Remove all elements from the initial array that are of the same value as these arguments.

more info:  bf details | bf links | hint

Mateja Trifunovski
@Matko95
Sep 06 2015 14:17
@Cicero82 what is wrong?
Abdelaziz Mokhnache
@Abdelaziz18003
Sep 06 2015 14:19
@wishe show us your code
LilitAl
@LilitAl
Sep 06 2015 14:20
@Matko95 , thanks a lot!
CamperBot
@camperbot
Sep 06 2015 14:20
lilital sends brownie points to @matko95 :sparkles: :thumbsup: :sparkles:
:star: 212 | @matko95 | http://www.freecodecamp.com/matko95
Alex
@wishe
Sep 06 2015 14:21
function destroyer(arr) {

  var args = [];
  for (i = 1; i < arguments.length; i++) {
    args.push(arguments[i]);
  }
  function isNotNumber(v) {
    for (i = 1; i <= args.length; i++) {
       if(v === args[i]) {
         return false;
       } else {
         return true;
       }
    }
  }

  return arr.filter(isNotNumber);
}

destroyer([1, 2, 3, 1, 2, 3], 2, 3);
Still dont understand why this does not work. @Abdelaziz18003 !
Michael Swartz
@mlswartz
Sep 06 2015 14:25
is there a ziplines room?
Robert Richey
@0x0936
Sep 06 2015 14:29
@wishe only return true if v is not equal to any of args - outside the loop. initialize i to 0, because arrays start counting from 0, and change condition to i < args.length
Cicero82
@Cicero82
Sep 06 2015 14:33
@Matko82 how can I best share what code I have?
Alex
@wishe
Sep 06 2015 14:33
function destroyer(arr) {

  var args = [];
  for (i = 1; i < arguments.length; i++) {
    args.push(arguments[i]);
  }
  function isNotNumber(v) {
    for (i = 0; i < args.length; i++) {
       if(v !== args[i]) {
         return true;
       } else {
         return false;
       }
    }
  }

  return arr.filter(isNotNumber);
}

destroyer([1, 2, 3, 1, 2, 3], 2, 3);
@0x0936 It still only filters out the first argument, 2 and leaves the 3 in there.
Robert Richey
@0x0936
Sep 06 2015 14:34
@wishe you're still trying to return true within the loop
Alex
@wishe
Sep 06 2015 14:34
@0x0936 But i need to do something when it matches right?
Robert Richey
@0x0936
Sep 06 2015 14:35
when it matches, you return false. if the code exits the loop, then no match was found. return true
Cicero82
@Cicero82
Sep 06 2015 14:35
@Matko95 it seems everything that should test as true is correct but the ones that should be false are also returning a true value
Mateja Trifunovski
@Matko95
Sep 06 2015 14:36
@Cicero82 can you send the code?
Cicero82
@Cicero82
Sep 06 2015 14:37
how do i get it to paste like the examples above lol
x34passenger
@x34passenger
Sep 06 2015 14:37
@Matko95 I've got the 4 images on one page, however it does not look anything like what I am suppose to build
http://codepen.io/x34passenger/pen/KdwjEB
Alex
@wishe
Sep 06 2015 14:37
function destroyer(arr) {

  var args = [];
  for (i = 1; i < arguments.length; i++) {
    args.push(arguments[i]);
  }
  function isNotNumber(v) {
    for (i = 0; i < args.length; i++) {
       if(v === args[i]) {
         return false;
       } 
    }
    return true;
  }

  return arr.filter(isNotNumber);
}

destroyer([1, 2, 3, 1, 2, 3], 2, 3);
OK @0x0936 This works now. But the reason i shouldn't return true inside that loop because of the way filter works and that its already running the function for every number in the array and only takes true or false as a return?
@0x0936 Thanks alot btw, been pondering this issue for a while now!
CamperBot
@camperbot
Sep 06 2015 14:38
wishe sends brownie points to @0x0936 :sparkles: :thumbsup: :sparkles:
:star: 114 | @0x0936 | http://www.freecodecamp.com/0x0936
ronald
@ronstarcool
Sep 06 2015 14:38
is there a pro here who can help me on this little thing with a zip? im struggling now for 3 days on it. and i cant get that last thing to work. getting me all stressed out
its the pomodoro
HELP
CamperBot
@camperbot
Sep 06 2015 14:39

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

ronald
@ronstarcool
Sep 06 2015 14:39
or i might need to go to an institute
wiki pomodoro
CamperBot
@camperbot
Sep 06 2015 14:39
no wiki entry for: pomodoro
:pencil: click here to create one now!after creating your page type update to reload it here
ronald
@ronstarcool
Sep 06 2015 14:39
omg
Robert Richey
@0x0936
Sep 06 2015 14:39
@wishe the reason you don't return true in the loop is because the loop will only ever evaluate the first element in args. if args[0] === v return false, else return true is essentially what your loop was doing.
Alex
@wishe
Sep 06 2015 14:40
So it does not continue on ah ok i see
Robert Richey
@0x0936
Sep 06 2015 14:40
exactly :)
Alex
@wishe
Sep 06 2015 14:40
It just stops because it has gotten its answer!
thanks @0x0936
CamperBot
@camperbot
Sep 06 2015 14:40
wishe sends brownie points to @0x0936 :sparkles: :thumbsup: :sparkles:
:warning: wishe already gave 0x0936 points
Alex
@wishe
Sep 06 2015 14:41
So now my function always returns true if it does not match and return false
Great!
ronald
@ronstarcool
Sep 06 2015 14:42
@evelynmitchell you must be a pro! got a minute to help me on the pomodoro?? i got everything to work, its just....not at the same time
Cicero82
@Cicero82
Sep 06 2015 14:42
This message was deleted
CamperBot
@camperbot
Sep 06 2015 14:42
:bulb: to format code use backticks! ``` more info
Cicero82
@Cicero82
Sep 06 2015 14:42
oops
function palindrome(str) {
  str.replace(/[.,-\/#!$%\^&\*;:{}=\-_`~()]/g,"");
  str.toLowerCase();
  var myArray = str.split();
  myArray = myArray.reverse();
  var newString = myArray.join();

  if (newString = str) {   
    return true;
  } else {   
    return false;
  } 

}

palindrome("eye");
preetham s
@preetham90
Sep 06 2015 14:43
assert((function(){if(typeof(firstLetterOfLastName) !== "undefined" && editor.getValue().match(/[0]/gi) && typeof(firstLetterOfLastName) === "string" && firstLetterOfLastName === "L"){return true;}else{return false;}})(), 'The first letter of firstLetterOfLastName should be a L');The first letter of firstLetterOfLastName should be a L
x34passenger
@x34passenger
Sep 06 2015 14:45
Can anyone help me with Zipline: Build a Personal Portfolio Webpage
http://codepen.io/x34passenger/pen/KdwjEB
Mateja Trifunovski
@Matko95
Sep 06 2015 14:49
@Cicero82 if (newString = str) "=" assigns a value , you need to use a comparator which is "===" if(newString===str)
@x34passenger what's up?
x34passenger
@x34passenger
Sep 06 2015 14:51
@Matko95 I was able to get the 4 images on one page, but I don't know how to make each image show up or fill up the screen completely
Abdelaziz Mokhnache
@Abdelaziz18003
Sep 06 2015 14:53
@Cicero82 this is a working version ``````
function palindrome(str) {
  var str2 = [];
  str2 = str.replace(/[.,-\/#!$%\?^&\*;:{}=\-_`~() ]/g,"");
  str2 = str2.toLowerCase();
  var myArray = str2.split('');
  myArray = myArray.reverse();
  var newString = myArray.join('');

  if (newString == str2) {   
    return true;
  } else {   
    return false;
  } 

}

palindrome("eye");
aslamweb
@aslamweb
Sep 06 2015 14:54

1
<div class="container-fluid">
2
  <h3 class="text-primary text-center">jQuery Playground</h3>
3
  <div class="row">
4
    <div class="col-xs-6">
5
​
6
      <div class="well" id="left-well">
7
        <h4> #left-well </h4>
8
        <button class="btn btn-default target"></button>
9
        <button class="btn btn-default target"></button>
10
        <button class="btn btn-default target"></button>
11
      </div>
12
    </div>
13

14
    <div class="col-xs-6">
15
​
16
      <div class="well" id="right-well">
17
        <h4> #right-well </h4>
18
        <button class="btn btn-default target"></button>
19
        <button class="btn btn-default target"></button>
20
        <button class="btn btn-default target"></button>
21
      </div>
22
    </div>
23
  </div>
24
</div>
25
​
Abdelaziz Mokhnache
@Abdelaziz18003
Sep 06 2015 14:55
@Cicero82 methods replace() and toLowerCase() don't change the original string
Robert Richey
@0x0936
Sep 06 2015 14:56
@Cicero82 check out the regexp /\W/ RegExp - special non-word
Mateja Trifunovski
@Matko95
Sep 06 2015 14:56
@x34passenger you need to either fill them with content or set a height attribute
Cicero82
@Cicero82
Sep 06 2015 14:56
thank you @Abdelaziz18003 @Matko95 will give it a try
CamperBot
@camperbot
Sep 06 2015 14:56
cicero82 sends brownie points to @abdelaziz18003 and @matko95 :sparkles: :thumbsup: :sparkles:
:star: 213 | @matko95 | http://www.freecodecamp.com/matko95
:star: 245 | @abdelaziz18003 | http://www.freecodecamp.com/abdelaziz18003
aslamweb
@aslamweb
Sep 06 2015 14:57
What's wrong with my code showing that " Add an h4 element to each of your <div class="col-xs-6"> elements"
x34passenger
@x34passenger
Sep 06 2015 14:58
@Matko95 you say "...fill them with content..." <- do I do this in CSS?
Alex
@wishe
Sep 06 2015 14:58
@aslamweb put h4 outside the well!
Robert Richey
@0x0936
Sep 06 2015 14:58
@aslamweb make the h4 a direct child of .col-xs-6
Mateja Trifunovski
@Matko95
Sep 06 2015 14:58
@x34passenger no, i mean adding some text, picture, heading or something
aslamweb
@aslamweb
Sep 06 2015 14:58
Mateja Trifunovski
@Matko95
Sep 06 2015 14:59
@x34passenger http://codepen.io/Matko95/pen/WQbVwg etc like this
x34passenger
@x34passenger
Sep 06 2015 15:00
@Matko95 so you are saying there is no way to show the background fully without putting things like text, buttons, etc.?
@Matko95 ok
Mateja Trifunovski
@Matko95
Sep 06 2015 15:01
@x34passenger there is, but you need to format it with css, specifing the height
@x34passenger it is currently covering the whole div, but let's say the divs height is small
aslamweb
@aslamweb
Sep 06 2015 15:03
@wishe @0x0936 ! Thanks :+1:
CamperBot
@camperbot
Sep 06 2015 15:03
aslamweb sends brownie points to @wishe and @0x0936 :sparkles: :thumbsup: :sparkles:
:star: 239 | @wishe | http://www.freecodecamp.com/wishe
:star: 115 | @0x0936 | http://www.freecodecamp.com/0x0936
x34passenger
@x34passenger
Sep 06 2015 15:03
@Matko95 what would be the height value in pixels to cover the entire screen?
Mateja Trifunovski
@Matko95
Sep 06 2015 15:04
@x34passenger depends on the image, check it's height
rinyfo4
@rinyfo4
Sep 06 2015 15:04

I'm having difficulty figuring out which word is the longest in a string. I'm stuck on basic algorithm scripting and I've been trying to figure this out for a while. I've searched everywhere with no luck. Here's my code:

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

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

I've tried looping, and some other things but I just can't seem to make sense of it...

Peter Deal
@DealPete
Sep 06 2015 15:06
@rinyfo4 you can use str.split(' ') to break up the string, then test each word seperately
rinyfo4
@rinyfo4
Sep 06 2015 15:07
@DealPete thanks for the reply. where? I've tried that, it doesn't output the words. Either way it doesn't break it down and show which is the longest.
CamperBot
@camperbot
Sep 06 2015 15:07
rinyfo4 sends brownie points to @dealpete :sparkles: :thumbsup: :sparkles:
:star: 251 | @dealpete | http://www.freecodecamp.com/dealpete
Elizabeth Hatleli
@TheHighPriestess
Sep 06 2015 15:07
Am I going to have to use regular expressions for Search and Replace?
Ionut Costica
@souldreamer
Sep 06 2015 15:07
Anyone know how to rebase a github fork to the current FCC codebase?
Hans van Riet
@hansinla
Sep 06 2015 15:07
@rinyfo4 If I remember correctly you only have to return the length of the longest word, not the word itself. So when you loop through all the words, just keep track of what the highest value for length is.
Mateja Trifunovski
@Matko95
Sep 06 2015 15:07
@rinyfo4 when you use .split you get an array of words, make an algorithm for finding a max value in a for loop
x34passenger
@x34passenger
Sep 06 2015 15:08
@Matko95 it does not seem to be working
I've specified in the CSS:
background-size: 100% 100%;
Mateja Trifunovski
@Matko95
Sep 06 2015 15:12
@x34passenger you must target the div, not the background, try this height:500px;
x34passenger
@x34passenger
Sep 06 2015 15:17
@Matko95 it works!
@Matko95 thank you!
CamperBot
@camperbot
Sep 06 2015 15:17
x34passenger sends brownie points to @matko95 :sparkles: :thumbsup: :sparkles:
:star: 214 | @matko95 | http://www.freecodecamp.com/matko95
Jack
@yakschuss
Sep 06 2015 15:21
how does a Regular Expression know which target string to select? - I'm trying to understand how it works, google ain't helping :)
  var testString = "How many spaces are there in this sentence?";

  // Only change code below this line.

  var expression = /.+/gi;
Elizabeth Hatleli
@TheHighPriestess
Sep 06 2015 15:22
@yakschuss are you working on a bonfire?
Did you go through this?
Jack
@yakschuss
Sep 06 2015 15:22
nope, still in JavaScript
Elizabeth Hatleli
@TheHighPriestess
Sep 06 2015 15:22
oh ok
Jack
@yakschuss
Sep 06 2015 15:23
I can't find a good resource for theoretical concepts...may have to go to school :)
Elizabeth Hatleli
@TheHighPriestess
Sep 06 2015 15:24
@yakschuss Yeah, I'm not that thrilled with the resources either. However, regexone.com isn't bad.
but the first time through...didn't make much sense
Jack
@yakschuss
Sep 06 2015 15:25
is it specifically for Regular Expressions?
Elizabeth Hatleli
@TheHighPriestess
Sep 06 2015 15:25
yes..check it out
Jack
@yakschuss
Sep 06 2015 15:25
thanks, will do! @TheHighPriestess
CamperBot
@camperbot
Sep 06 2015 15:25
if you want to thank someone, put an @ before their name!
Elizabeth Hatleli
@TheHighPriestess
Sep 06 2015 15:27
@yakschuss I went through it several weeks back...but I'm going to go through it again.
It's a bit confusing at first
Jack
@yakschuss
Sep 06 2015 15:30
yep. My specific question though, how does it find the target string, i'm not sure about
I can stomach learning how to match certain characters of different strings, but which strings?
Rex Schrader
@SaintPeter
Sep 06 2015 15:36
@yakschuss Look at String.match() - it executes a regex you pass it on a string and returns all the matching items. IE:
var str = "this is a test";
console.log(str.match(/\s/gi).length);  // returns 3
Elizabeth Hatleli
@TheHighPriestess
Sep 06 2015 15:40
@SaintPeter For the Search and Replace bonfire will I need to use regular expressions?
Rex Schrader
@SaintPeter
Sep 06 2015 15:43
@TheHighPriestess It is not required, but it can be helpful. You can easily write a regex to determine the case of a letter.
@TheHighPriestess There are other less elegent ways to make the same determination.
Elizabeth Hatleli
@TheHighPriestess
Sep 06 2015 15:46
@SaintPeter ah ok..thanks. I just wanted to know if it was necessary to use them for that bonfire. If it's not...good.
CamperBot
@camperbot
Sep 06 2015 15:46
thehighpriestess sends brownie points to @saintpeter :sparkles: :thumbsup: :sparkles:
:star: 510 | @saintpeter | http://www.freecodecamp.com/saintpeter
Rex Schrader
@SaintPeter
Sep 06 2015 15:46
@TheHighPriestess I encourage you to use them - it's a good opportunity to learn them.
Elizabeth Hatleli
@TheHighPriestess
Sep 06 2015 15:47
Well...I was thinking that a regex would be necessary to determine...as you said...the case of a letter. I was also thinking that it might be possible using charAt and toUppercase and toLowercase. Is it?
although....I found that rather ugly and abandoned it.
rinyfo4
@rinyfo4
Sep 06 2015 15:48
@Matko95 how would i go about making that? I'm so confused...
x34passenger
@x34passenger
Sep 06 2015 15:49
Zipline: Build a Personal Portfolio Webpage - I'm having some trouble formatting my page, I have some white spaces between each image page and I don't know how to get rid of them:
http://codepen.io/x34passenger/pen/KdwjEB
rinyfo4
@rinyfo4
Sep 06 2015 15:49
@hansinla im not sure how to do that... How do i set up the loop to keep track of it?
Mateja Trifunovski
@Matko95
Sep 06 2015 15:51
@x34passenger you could remove the jumbotron class, if you don't need it, or override the padding-bottom and margin-bottom

@rinyfo4

var maximum = 0;
for (var i = 1; i < arr.length; i++) {
        if (maximum < arr[i]) {
            maximum = arr[i];
        }
    }

this would give you the maximum value

just picture arr[i] as each word of your sentence
when you split it
etc arr[0] then arr1 and so on
x34passenger
@x34passenger
Sep 06 2015 15:53
@Matko95 thanks
CamperBot
@camperbot
Sep 06 2015 15:53
x34passenger sends brownie points to @matko95 :sparkles: :thumbsup: :sparkles:
:warning: x34passenger already gave matko95 points
rinyfo4
@rinyfo4
Sep 06 2015 15:53
i see...
Rex Schrader
@SaintPeter
Sep 06 2015 15:54
@TheHighPriestess You can do it that way. Remember also that you can access any position in a string with str[x], where 0 <= x < str.length, which is the same as charAt
Thomas Vaeth
@thomasvaeth
Sep 06 2015 15:54
@rinyfo4 You need to split the string first into an array. When you split the string you want to use .sort on that array (look it up how to work the function because you'll be comparing each item in the array). And then you will want to return the first item in the array.
x34passenger
@x34passenger
Sep 06 2015 15:54
@Matko95 how do I make my navbar static, when I scroll, it scrolls away, part of scrolling, how do I make it independent of scrolling, so when scrolling it is always there on the page?
Rex Schrader
@SaintPeter
Sep 06 2015 15:55
@x34passenger Give it a class of navbar-fixed
Mateja Trifunovski
@Matko95
Sep 06 2015 15:55
yes, as saintpeter said
Thomas Vaeth
@thomasvaeth
Sep 06 2015 15:55
@rinyfo4 You don't need a loop at all. It could be much shorter than that.
Mateja Trifunovski
@Matko95
Sep 06 2015 15:56
@thomasvaeth enlighten us
x34passenger
@x34passenger
Sep 06 2015 15:56
@SaintPeter <nav class="navbar navbar-fixed" role="navigation"> , like this?
Elizabeth Hatleli
@TheHighPriestess
Sep 06 2015 15:56
@SaintPeter ah yes...that's what I was wondering. Thank you.
CamperBot
@camperbot
Sep 06 2015 15:56
thehighpriestess sends brownie points to @saintpeter :sparkles: :thumbsup: :sparkles:
:warning: thehighpriestess already gave saintpeter points
Mateja Trifunovski
@Matko95
Sep 06 2015 15:56
@x34passenger yep
Rex Schrader
@SaintPeter
Sep 06 2015 15:56
@x34passenger I believe so
x34passenger
@x34passenger
Sep 06 2015 15:56
@SaintPeter not working
Thomas Vaeth
@thomasvaeth
Sep 06 2015 15:57
function findLongestWord(str) {
    var findArray = str.split(' ');
    findArray.sort(function (a, b) {
        return b.length - a.length;
    });
    return findArray[0].length;
}

findLongestWord('The quick brown fox jumped over the lazy dog');
Rex Schrader
@SaintPeter
Sep 06 2015 15:57
@x34passenger Sorry, it's navbar-fixed-top, my bad
rinyfo4
@rinyfo4
Sep 06 2015 15:57
@thomasvaeth the whole string or the words individually?
Rex Schrader
@SaintPeter
Sep 06 2015 15:58
@x34passenger You also need navbar-default
x34passenger
@x34passenger
Sep 06 2015 15:58
@SaintPeter thanks
CamperBot
@camperbot
Sep 06 2015 15:58
x34passenger sends brownie points to @saintpeter :sparkles: :thumbsup: :sparkles:
:star: 511 | @saintpeter | http://www.freecodecamp.com/saintpeter
x34passenger
@x34passenger
Sep 06 2015 15:58
@Matko95 thanks
@Matko95 thank you
CamperBot
@camperbot
Sep 06 2015 15:59
x34passenger sends brownie points to @matko95 :sparkles: :thumbsup: :sparkles:
:warning: x34passenger already gave matko95 points
Mateja Trifunovski
@Matko95
Sep 06 2015 15:59
@thomasvaeth Nice solution, I like it :)
rinyfo4
@rinyfo4
Sep 06 2015 16:00
@thomasvaeth thanks a lot. Gonna dig deeper into the logic behind it. It works
CamperBot
@camperbot
Sep 06 2015 16:00
rinyfo4 sends brownie points to @thomasvaeth :sparkles: :thumbsup: :sparkles:
Rex Schrader
@SaintPeter
Sep 06 2015 16:00
@thomasvaeth The only problem with that solution is that it's a O( n log(n) ) solution, whereas a direct search is O(n). IE: Sorting the strings is going to take a bit longer. It's not an effecient soltion.
CamperBot
@camperbot
Sep 06 2015 16:00
:star: 223 | @thomasvaeth | http://www.freecodecamp.com/thomasvaeth
Thomas Vaeth
@thomasvaeth
Sep 06 2015 16:01
@SaintPeter It timed quicker than a loop. What was your solution?
Ngaosathe
@ThekhoN
Sep 06 2015 16:01
Guys why ist my reduce function not worken..please help
var x = ["one", "two", "three"];
x.reduce(function(p,c,i,a){
 p.charAt(0).toUpperCase() + p.slice(1) + " " + c.charAt(0).toUpperCase() + c.slice(1)
})
Rex Schrader
@SaintPeter
Sep 06 2015 16:02
@thomasvaeth Just a straight up loop. The sort should always take longer. How are you doing your timing comparison?
@ThekhoN You need to return something for reduce to work.
Thomas Vaeth
@thomasvaeth
Sep 06 2015 16:03
@SaintPeter I was using getTime. I was in a group when I was working on the basic ones and we would always get into arguments about what was best hah.
Ngaosathe
@ThekhoN
Sep 06 2015 16:04
@SaintPeter thanks..
CamperBot
@camperbot
Sep 06 2015 16:04
thekhon sends brownie points to @saintpeter :sparkles: :thumbsup: :sparkles:
:star: 512 | @saintpeter | http://www.freecodecamp.com/saintpeter
Rex Schrader
@SaintPeter
Sep 06 2015 16:05
@thomasvaeth It may be for certain degnerate cases that it's faster, but in the general case, the loop takes a fixed time proportional to n, whereas the sort should always take longer - it has to do more comparisons.
Ngaosathe
@ThekhoN
Sep 06 2015 16:06
@SaintPeter are Array methods faster than string methods?
Rex Schrader
@SaintPeter
Sep 06 2015 16:06
@ThekhoN Depends on the method. It's a bit of apples and oranges there - they're doing different things.
Ngaosathe
@ThekhoN
Sep 06 2015 16:08
hmmm..so the beginner bonfires suggest us to use string methods but I've been trying to solve them using array methods..if we are to do the same in production, what would you recommend?
Rex Schrader
@SaintPeter
Sep 06 2015 16:10
@ThekhoN I strongly suggest that you don't worry about performance at all. That is not the point of solving these problems. "Premature optimization is the root of all evil".
@ThekhoN Focus on understanding and solving the problem with the tools at hand. Later, when you know more, you can always come back and solve it later.
@ThekhoN Also, in "the real world", sometimes a more readable/maintainable solution is better than the most effecient solution.
Ngaosathe
@ThekhoN
Sep 06 2015 16:12
@SaintPeter Thank you. I'll keep these things in mind.
CamperBot
@camperbot
Sep 06 2015 16:12
thekhon sends brownie points to @saintpeter :sparkles: :thumbsup: :sparkles:
:warning: thekhon already gave saintpeter points
x34passenger
@x34passenger
Sep 06 2015 16:13
Is Infinito Web Design Studio on http://codepen.io/ThiagoFerreir4/full/eNMxEp an <h1>?
Rex Schrader
@SaintPeter
Sep 06 2015 16:13
@x34passenger It is an H1, but there is a lot of other stuff applied to it.
x34passenger
@x34passenger
Sep 06 2015 16:14
@SaintPeter how do I find out what is applied to it?
Rex Schrader
@SaintPeter
Sep 06 2015 16:14
@x34passenger Do you know how to open the dev tools in your browser?
x34passenger
@x34passenger
Sep 06 2015 16:15
@SaintPeter I use chrome, yes I know how to open dev tools but I've never really used it
Mateja Trifunovski
@Matko95
Sep 06 2015 16:15
@x34passenger you can just press edit this pen in the bottom left corner though
Rex Schrader
@SaintPeter
Sep 06 2015 16:16
@x34passenger Ah - so, what you can do is either right-click and inspect element on the title, or press F12 to open the dev tools and choose the inspection item and click on the element. Or, as @Matko95 suggests, just edit the Pen and read the CSS/HTML
x34passenger
@x34passenger
Sep 06 2015 16:16
i'd like to learn dev tools on chrome, I think it is good to learn
aslamweb
@aslamweb
Sep 06 2015 16:16
Wiki
CamperBot
@camperbot
Sep 06 2015 16:16
usage:
wiki $topic info on that topic
topics for a list of topics
x34passenger
@x34passenger
Sep 06 2015 16:17
@SaintPeter okay, I see it now
@SaintPeter thank you
CamperBot
@camperbot
Sep 06 2015 16:17
x34passenger sends brownie points to @saintpeter :sparkles: :thumbsup: :sparkles:
:warning: x34passenger already gave saintpeter points
x34passenger
@x34passenger
Sep 06 2015 16:17
@Matko95 thank you
Matthias Leconte
@Tix6
Sep 06 2015 16:17
Hi guys
x34passenger
@x34passenger
Sep 06 2015 16:17
@Matko95 thank you
CamperBot
@camperbot
Sep 06 2015 16:17
x34passenger sends brownie points to @matko95 :sparkles: :thumbsup: :sparkles:
:star: 215 | @matko95 | http://www.freecodecamp.com/matko95
Rex Schrader
@SaintPeter
Sep 06 2015 16:17
@Tix6 hey hey
Matthias Leconte
@Tix6
Sep 06 2015 16:18
somebody can help me with Bonfire: Mutations ?? :)
CamperBot
@camperbot
Sep 06 2015 16:18
type bonfire name to get some info on that bonfire. And check HelpBonfires chatroom
Rex Schrader
@SaintPeter
Sep 06 2015 16:18
@Tix6 Sure, what's the trouble?
Matthias Leconte
@Tix6
Sep 06 2015 16:18
Thx!! I succeed all the test, except this one : expect(mutation(['hello', 'neo'])).to.be.false;expected true to be false
CamperBot
@camperbot
Sep 06 2015 16:18
if you want to thank someone, put an @ before their name!
Rex Schrader
@SaintPeter
Sep 06 2015 16:19
@Tix6 ok, so the requirement is that all of the letters in the second string be present in the first. The letter n is not present.
@Tix6 Do you know how to share your code?
wiki format
CamperBot
@camperbot
Sep 06 2015 16:19

:point_right: code formatting [wiki]

Inline code

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

Code Block

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

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

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

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

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

Matthias Leconte
@Tix6
Sep 06 2015 16:20
thanks
CamperBot
@camperbot
Sep 06 2015 16:20
if you want to thank someone, put an @ before their name!
Matthias Leconte
@Tix6
Sep 06 2015 16:21
function mutation(arr) {
  var i = 0;
  var it = 0;
  while (i < arr[0].length)
  {
    if (arr[1].toLowerCase().indexOf(arr[0][i].toLowerCase()) != -1) 
      it += arr[1].toLowerCase().indexOf(arr[0][i].toLowerCase());
    i++;
  }
  if (it >= arr[1].length - 1)
    return true;
  else
    return false;
}
Rex Schrader
@SaintPeter
Sep 06 2015 16:23
@Tix6 Oh, that's a very interesting solution. Here is where that breaks down: What if you had these: mutation(['hellllllllllo', 'gal']) - there are LOTS of 'l's in the first, so your it is going to be really high, but 'g' and 'a' are not present.
Matthias Leconte
@Tix6
Sep 06 2015 16:24
Its true, you are right!
I don't think about that... damn :)
Rex Schrader
@SaintPeter
Sep 06 2015 16:26
@Tix6 ;)
@Tix6 using .indexOf is smart, though. You're on to something. Just think about what happens if you don't find arr[1][i] in arr[0] at all?
Matthias Leconte
@Tix6
Sep 06 2015 16:28
In this case i just return false i guess... ?
Rex Schrader
@SaintPeter
Sep 06 2015 16:28
@Tix6 Sounds about right.
@Tix6 Then you just need to think about when you can return true.
Matthias Leconte
@Tix6
Sep 06 2015 16:32
Done! Thank u =D
CamperBot
@camperbot
Sep 06 2015 16:32
if you want to thank someone, put an @ before their name!
Matthias Leconte
@Tix6
Sep 06 2015 16:33
@SaintPeter thanks
CamperBot
@camperbot
Sep 06 2015 16:33
tix6 sends brownie points to @saintpeter :sparkles: :thumbsup: :sparkles:
:star: 516 | @saintpeter | http://www.freecodecamp.com/saintpeter
Rajaselvan Thangaraj
@rajaselvan
Sep 06 2015 16:45
Hi. What is wrong with my solution to bonfire-make-a-person question?
Rex Schrader
@SaintPeter
Sep 06 2015 16:46
@rajaselvan Share your code?
wiki format
CamperBot
@camperbot
Sep 06 2015 16:46

:point_right: code formatting [wiki]

Inline code

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

Code Block

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

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

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

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

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

Rex Schrader
@SaintPeter
Sep 06 2015 16:49
@rajaselvan Taking a look
Rajaselvan Thangaraj
@rajaselvan
Sep 06 2015 16:50
Sorry cudnt figure out how to paste code here
this is the error i get
expect(Object.keys(bob).length).to.eql(6);expected 1 to deeply equal 6
Rex Schrader
@SaintPeter
Sep 06 2015 16:51
@rajaselvan ok, so the problem is that you are not defining/assigning your member function inside the person object.
@rajaselvan You are doing it the "right" way for effeciency and stuff, but for the purposes of this exercise, you need to do it more like this:
var Person = function(firstAndLast) {
    this.setFirst = function(firstname) {
     // Set the name, etc.
   }
   // and so on
}
Rajaselvan Thangaraj
@rajaselvan
Sep 06 2015 16:53
There was a link on the sidebar that said to refer Closures on MDN. I thought why create and assign functions to every object when they can share one
John Carl James Nebab
@navip0t
Sep 06 2015 16:53
anyone still doing basic algorithm here?
Rex Schrader
@SaintPeter
Sep 06 2015 16:53
@navip0t I can help
Rajaselvan Thangaraj
@rajaselvan
Sep 06 2015 16:54
oh ok. Thanks St.Peter
CamperBot
@camperbot
Sep 06 2015 16:54
if you want to thank someone, put an @ before their name!
Rex Schrader
@SaintPeter
Sep 06 2015 16:54
@rajaselvan Nope, not this one. I know it's confusing
John Carl James Nebab
@navip0t
Sep 06 2015 16:54
Im trying to solve bonfire #7 and I am stuck :(
Sami
@asamiweb
Sep 06 2015 16:54
Capture d’écran 2015-09-06 à 18.54.22.png
John Carl James Nebab
@navip0t
Sep 06 2015 16:54
its to return the largest numbers from a provided subarray
Rex Schrader
@SaintPeter
Sep 06 2015 16:55
@navip0t ok, do you have any code to share?
wiki format
CamperBot
@camperbot
Sep 06 2015 16:55

:point_right: code formatting [wiki]

Inline code

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

Code Block

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

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

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

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

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

Rex Schrader
@SaintPeter
Sep 06 2015 16:55
@asamiweb Please share code inline, as shown ^^
John Carl James Nebab
@navip0t
Sep 06 2015 16:55
how can I share it in wikiformat? idk
Sami
@asamiweb
Sep 06 2015 16:56
This message was deleted
Rex Schrader
@SaintPeter
Sep 06 2015 16:56
@navip0t Type the three backticks ``` do shift-enter for a new line, paste your code, shft enter, then three more backticks. See above.
x34passenger
@x34passenger
Sep 06 2015 16:57
Zipline: Build a Personal Portfolio Webpage - I am not sure how to center my title: Infinite Web Design Studio on my home page
Mateja Trifunovski
@Matko95
Sep 06 2015 16:58
add a text-center class
Can we use jquery in our bonfires?
Sami
@asamiweb
Sep 06 2015 16:59
This message was deleted
x34passenger
@x34passenger
Sep 06 2015 16:59
@Matko95 okay cool, but I don't know how to center it or lower it to be more center from the top
Rex Schrader
@SaintPeter
Sep 06 2015 17:00
@Matko95 Nope - only in the jQuery waypoints.
Mateja Trifunovski
@Matko95
Sep 06 2015 17:01
@x34passenger you'll have to read about vertical alignment then :D
Too bad
Rex Schrader
@SaintPeter
Sep 06 2015 17:01
@x34passenger You can increase your margin-top, or go for absolute positioning and use top
Sami
@asamiweb
Sep 06 2015 17:02
Hi, anyone see the trouble ?

function chunk(arr, size) {
  // Break it up.
  var bigArray = new Array();
  for(var i=0; i<arr.length; i++){
      bigArray.push(arr.slice(0,size));
      arr.splice(0,size);
  }
  return bigArray;
}

console.log(chunk(['a', 'b', 'c', 'd'], 2));
x34passenger
@x34passenger
Sep 06 2015 17:02
@SaintPeter I tried using margin-top, the entire page or image gets shifted down instead of just the <h1>
John Carl James Nebab
@navip0t
Sep 06 2015 17:02
function largestOfFour(arr) {
  // You can do this!
  var newArr = [];
  for (var i = 0; i < arr.length; i++){
    var largeArr = newArr.push(arr[i])
    if(arr[i] < largeArr) {
      arr[i] = largeArr;
    }
  }
    return largeArr;
}

largestOfFour([[4, 5, 1, 3], [13, 27, 18, 26], [32, 35, 37, 39], [1000, 1001, 857, 1]]);
```
@SaintPeter check the code above
Sami
@asamiweb
Sep 06 2015 17:03
Ps : Write a function that splits an array (first argument) into groups the length of size (second argument) and returns them as a multidimensional array.
Rex Schrader
@SaintPeter
Sep 06 2015 17:03
@navip0t Assignment is from right to left. The thing on the left recieves the assignment, the thing on the right does the assigning. Your assignment is backwards.
Vick003
@Vick003
Sep 06 2015 17:03
@asimiweb Your incrementer, it should be different. Think about how much you increment by
Rex Schrader
@SaintPeter
Sep 06 2015 17:04
@asamiweb The problem is that whenever you do a splice operation, the length of arr changes. You're always pulling the front off, but i keeps going up.
Sami
@asamiweb
Sep 06 2015 17:04
@Vick003 Thank you !! :smile:
CamperBot
@camperbot
Sep 06 2015 17:04
asamiweb sends brownie points to @vick003 :sparkles: :thumbsup: :sparkles:
:star: 20 | @vick003 | http://www.freecodecamp.com/vick003
John Carl James Nebab
@navip0t
Sep 06 2015 17:05
@SaintPeter the same result
it only returns a number(4)
Rex Schrader
@SaintPeter
Sep 06 2015 17:07
@navip0t You also need to push your largeArr value onto an array for each sub-array you evaluate
Knut Jackowski
@doxanthropos
Sep 06 2015 17:17
Hello! Has someone done the "Pairwise" Bonfire and is able to explain why pairwise([0, 0, 0, 0, 1, 1], 1) is supposed to return 10? As I understand the bonfire it shoud be 9.
Rex Schrader
@SaintPeter
Sep 06 2015 17:19
@doxanthropos Humm, that is odd
@doxanthropos Ah, ok
Knut Jackowski
@doxanthropos
Sep 06 2015 17:20
I think the first index is 4 and the second 5 so it should be 9?
Rex Schrader
@SaintPeter
Sep 06 2015 17:20
@doxanthropos index 0 + index 4, index 1 + index 5
@doxanthropos because you can't reuse the same numbers
@doxanthropos "Once an element has been used, it cannot be reused to pair with another."
Knut Jackowski
@doxanthropos
Sep 06 2015 17:22
Oh, I did not count the 0s. That's it. Thank you @SaintPeter
CamperBot
@camperbot
Sep 06 2015 17:22
doxanthropos sends brownie points to @saintpeter :sparkles: :thumbsup: :sparkles:
:star: 523 | @saintpeter | http://www.freecodecamp.com/saintpeter
Rex Schrader
@SaintPeter
Sep 06 2015 17:23
@doxanthropos No, you do count the zeroes. You just can't use them twice.
Knut Jackowski
@doxanthropos
Sep 06 2015 17:26
@SaintPeter Somehow I only thought about the 4 and the 5 and did not think about counting the 0s at all. That what confused me. ;)
Rex Schrader
@SaintPeter
Sep 06 2015 17:26
@doxanthropos :D
Knut Jackowski
@doxanthropos
Sep 06 2015 17:27
@SaintPeter Possibly just a sign that I should take a break. ;)
Rex Schrader
@SaintPeter
Sep 06 2015 17:28
@doxanthropos HAHa, maybe so - I found that particular bonfire to be maddening! It is so hard to seperate values from indicies in my head.
Knut Jackowski
@doxanthropos
Sep 06 2015 17:29
@SaintPeter I think i nearly got it, but still some small parts to smooth out.
Peter Deal
@DealPete
Sep 06 2015 17:37
I've been hosting my images on Imgur, what's a good place to host fonts, sounds, &c
Dhananjay Mehrotra
@dj8923
Sep 06 2015 17:42
bonfire Where art thou
CamperBot
@camperbot
Sep 06 2015 17:42

:fire:Bonfire: Where art thou :link:

function where(collection, source) {
  var arr = [];
  // What's in a name?
  return arr;
}

where([{ first: 'Romeo', last: 'Montague' }, { first: 'Mercutio', last: null }, { first: 'Tybalt', last: 'Capulet' }], { last: 'Capulet' });

Make a function that looks through a list (first argument) and returns an array of all objects that have equivalent property values (second argument).

more info:  bf details | bf links | hint

Dhananjay Mehrotra
@dj8923
Sep 06 2015 17:43
bf details
CamperBot
@camperbot
Sep 06 2015 17:43

:fire:Bonfire: Where art thou :link:

function where(collection, source) {
  var arr = [];
  // What's in a name?
  return arr;
}

where([{ first: 'Romeo', last: 'Montague' }, { first: 'Mercutio', last: null }, { first: 'Tybalt', last: 'Capulet' }], { last: 'Capulet' });
Make a function that looks through a list (first argument) and returns an array of all objects that have equivalent property values (second argument).
Remember to use RSAP if you get stuck. Try to pair program. Write your own code.
links:
Dhananjay Mehrotra
@dj8923
Sep 06 2015 17:43
rsap
Rex Schrader
@SaintPeter
Sep 06 2015 17:44
@dj8923 Do you need help?
Dhananjay Mehrotra
@dj8923
Sep 06 2015 17:45
yes
@SaintPeter
Rex Schrader
@SaintPeter
Sep 06 2015 17:45
@dj8923 What's the trouble? Do you have code?
Dhananjay Mehrotra
@dj8923
Sep 06 2015 17:46

i am stuck at
function where(collection, source) {
var arr = [];
// What's in a name?
return arr;
}

where([{ first: 'Romeo', last: 'Montague' },
{ first: 'Mercutio', last: null }, { first: 'Tybalt', last: 'Capulet' }], { last: 'Capulet' });

i need some hint
Fábio Paraíso Oliveira
@FabioParaiso
Sep 06 2015 17:48
Hey guys. I've got a little question.
Rex Schrader
@SaintPeter
Sep 06 2015 17:49
@dj8923 ok. There are several things you need to do:
1) Enumerate the keys in source using the Object.keys() function
2) Search each element of collection for the key(s) in source
3) For each key you find, check if the value matches.
4) if all of the keys match, push the object onto your output
@FabioParaiso shoot
Dhananjay Mehrotra
@dj8923
Sep 06 2015 17:49
bf links
Fábio Paraíso Oliveira
@FabioParaiso
Sep 06 2015 17:49
trying to implement a dropdown bar in the page i'm creating, following the bootstrap page for help (http://www.w3schools.com/bootstrap/bootstrap_navbar.asp) but it doesn't seem to work in code pen. Is this normal?
Tried different ways of implementing too.
Rex Schrader
@SaintPeter
Sep 06 2015 17:50
@FabioParaiso Do you have bootstrap included in your codepen settings?
Knut Jackowski
@doxanthropos
Sep 06 2015 17:50
@DealPete I don't know a good site for this because I have some small webspace at a university. Maybe a normal webhoster would be god?
Fábio Paraíso Oliveira
@FabioParaiso
Sep 06 2015 17:51
@SaintPeter yes i do (3.3.2). Using other things of boostrap which are working fine.
Here's the code: <div>
<ul class = "nav navbar-nav navbar-right">
<li class = "dropdown">
<a href = "#" class="dropdown-toggle" data-toggle = "dropdown">General information<b class="caret"></b></a>
<ul class="dropdown-menu">
<li><a href="#">Page 1-1</a></li>
<li><a href="#">Page 1-2</a></li>
</ul>
</li>
<li>
<a href = "#">Projects</a>
</li>
</ul>
</div>
ups not very readable =S
Peter Deal
@DealPete
Sep 06 2015 17:52
@doxanthropos that could certainly work, but I'm wondering what other people have been doing for the ziplines.
Rex Schrader
@SaintPeter
Sep 06 2015 17:52
@FabioParaiso I think you need navbar-default as well
Knut Jackowski
@doxanthropos
Sep 06 2015 17:52
@FabioParaiso Maybe you are missing the Bootstr.js? It is necessary for this function.
Rex Schrader
@SaintPeter
Sep 06 2015 17:53
@FabioParaiso or what @doxanthropos said - dropdowns need the js file
Fábio Paraíso Oliveira
@FabioParaiso
Sep 06 2015 17:56
@SaintPeter navbar-default was before =)
JMitnik
@JMitnik
Sep 06 2015 17:56
What does the clearfix do in Bootstrap in this example:
<div class="container">
    <div class="row">
        <div class="col-md-4"><p>Box 1</p></div>
        <div class="col-md-4"><p>Box 2</p></div>
        <div class="col-md-4"><p>Box 3</p></div>
        <div class="clearfix visible-md-block"></div>
        <div class="col-md-4"><p>Box 4</p></div>
        <div class="col-md-4"><p>Box 5</p></div>
        <div class="col-md-4"><p>Box 6</p></div>
        <div class="clearfix visible-md-block"></div>
        <div class="col-md-4"><p>Box 7</p></div>
        <div class="col-md-4"><p>Box 8</p></div>
        <div class="col-md-4"><p>Box 9</p></div>
        <div class="clearfix visible-md-block"></div>
        <div class="col-md-4"><p>Box 10</p></div>
        <div class="col-md-4"><p>Box 11</p></div>
        <div class="col-md-4"><p>Box 12</p></div>
    </div>
</div>
Fábio Paraíso Oliveira
@FabioParaiso
Sep 06 2015 17:56
@doxanthropos it was this!
JMitnik
@JMitnik
Sep 06 2015 17:56
I know clearfix clears floats, but I don't really understand it
Fábio Paraíso Oliveira
@FabioParaiso
Sep 06 2015 17:57
thank you @doxanthropos and thank you @SaintPeter
CamperBot
@camperbot
Sep 06 2015 17:57
fabioparaiso sends brownie points to @doxanthropos and @saintpeter :sparkles: :thumbsup: :sparkles:
CamperBot
@camperbot
Sep 06 2015 17:57
:star: 526 | @saintpeter | http://www.freecodecamp.com/saintpeter
:star: 250 | @doxanthropos | http://www.freecodecamp.com/doxanthropos
Dhananjay Mehrotra
@dj8923
Sep 06 2015 17:58
hint
CamperBot
@camperbot
Sep 06 2015 17:58
:construction: Spoilers are only in the Bonfire's Custom Room :point_right:
Rex Schrader
@SaintPeter
Sep 06 2015 17:58
@JMitnik Under certain circumstances, a div will not automatically expland to contain it's contents. You end up with bits hanging out of the bottom or side of the div. adding clearfix forces the parent div to expand to contain its children.
JMitnik
@JMitnik
Sep 06 2015 18:00
@SaintPeter Right, but testing it out with and without, I don't see any clear difference
Rex Schrader
@SaintPeter
Sep 06 2015 18:00
@JMitnik Its one of those things that may be needed but is not always needed. You add it when things break. :D
JMitnik
@JMitnik
Sep 06 2015 18:01
@SaintPeter I will take it as something I will run into later :), thanks !
CamperBot
@camperbot
Sep 06 2015 18:01
jmitnik sends brownie points to @saintpeter :sparkles: :thumbsup: :sparkles:
:star: 527 | @saintpeter | http://www.freecodecamp.com/saintpeter
Dhananjay Mehrotra
@dj8923
Sep 06 2015 18:04
@SaintPeter 1st step done ....how to do the second step
?
Rex Schrader
@SaintPeter
Sep 06 2015 18:06
@dj8923 ok, you have a list of keys, right? can you tihnk of a way to itterate through them and see if they exist in each object of the collection array?
Dhananjay Mehrotra
@dj8923
Sep 06 2015 18:08
using for each loop @SaintPeter
Rex Schrader
@SaintPeter
Sep 06 2015 18:08
@dj8923 Can you post your code, please?
Dhananjay Mehrotra
@dj8923
Sep 06 2015 18:09
function where(collection, source) {
var arr = [];
var sourceKey = Object.keys(source);
for each(var key2 in colllection){
Object.keys(collection[key2]);
}
// What's in a name?
return arr;
}
Rex Schrader
@SaintPeter
Sep 06 2015 18:11
@dj8923 It may be easier to itterate over source's keys, because those are the only ones we care about.
Dhananjay Mehrotra
@dj8923
Sep 06 2015 18:14
@SaintPeter :/
i am not getting dear
Rex Schrader
@SaintPeter
Sep 06 2015 18:15
@dj8923 Ok, the only thing we care is:
a) Does source's key exist in the colleciton object?
b) if not, it doesn't match, we're done.
c) if so, we then need to check if the value matches.
d) Was that the last key in source? If so, and everything matched, we can push the collection object onto our output
Dhananjay Mehrotra
@dj8923
Sep 06 2015 18:16
correct
Rex Schrader
@SaintPeter
Sep 06 2015 18:18
@dj8923 Well, yeah ;) - I'm trying to be helpful without telling you how to write your code. You've got the tools and the pieces, just gotta put 'em together.
Dhananjay Mehrotra
@dj8923
Sep 06 2015 18:19
var sourceKey = Object.keys(source); gives me array ...now i have to check whether this is present in collection object? right @SaintPeter
correct me if i am wrong
Rex Schrader
@SaintPeter
Sep 06 2015 18:20
@dj8923 You are correct. You can use collection[i].hasOwnProperty() to check this.
xtylerdurdenx
@xtylerdurdenx
Sep 06 2015 18:22

question about add your javascript slot machine slots

```

This message was deleted
Dhananjay Mehrotra
@dj8923
Sep 06 2015 18:22
@SaintPeter ok....let me try
xtylerdurdenx
@xtylerdurdenx
Sep 06 2015 18:23

question about Waypoint: Add your javascript slot machine slots

if(slotOne !== slotTwo || slotTwo !== slotThree){

  return null;

}

how do I type the vertical lines between slotTwo SlotTwo ?

I felt like I cheated b/c I had to copy & paste it.
instead of actually typing it.
Indranil Maji
@indranilphp
Sep 06 2015 18:25
bonfire where art thou
CamperBot
@camperbot
Sep 06 2015 18:25

:fire:Bonfire: Where art thou :link:

function where(collection, source) {
  var arr = [];
  // What's in a name?
  return arr;
}

where([{ first: 'Romeo', last: 'Montague' }, { first: 'Mercutio', last: null }, { first: 'Tybalt', last: 'Capulet' }], { last: 'Capulet' });

Make a function that looks through a list (first argument) and returns an array of all objects that have equivalent property values (second argument).

more info:  bf details | bf links | hint

Indranil Maji
@indranilphp
Sep 06 2015 18:25
hint
CamperBot
@camperbot
Sep 06 2015 18:25
:construction: Spoilers are only in the Bonfire's Custom Room :point_right:
Dhananjay Mehrotra
@dj8923
Sep 06 2015 18:25
@SaintPeter if i do this collection[i].hasOwnProperty(sourceKey)....it is returning me true
now what..
Rex Schrader
@SaintPeter
Sep 06 2015 18:25
@xtylerdurdenx They are shifted version of the \ key (above enter on most keyboard)
xtylerdurdenx
@xtylerdurdenx
Sep 06 2015 18:26
|||||
@SaintPeter I GOT IT!! ty!
Dhananjay Mehrotra
@dj8923
Sep 06 2015 18:26
@indranilphp i am also stuck in this
Rex Schrader
@SaintPeter
Sep 06 2015 18:27
@dj8923 Well, now you know it exists . . . so now you need to test if the values match.
aslamweb
@aslamweb
Sep 06 2015 18:28
How to how to disable
How to Disable your target1 button. ?
Rex Schrader
@SaintPeter
Sep 06 2015 18:30
@aslamweb There are instructions, right? About how to use .prop?
aslamweb
@aslamweb
Sep 06 2015 18:30
Yeah there is
Rex Schrader
@SaintPeter
Sep 06 2015 18:30
@aslamweb ok, do you understand what .prop does?
aslamweb
@aslamweb
Sep 06 2015 18:31
but instruction of all button not only target
change property of element
Rex Schrader
@SaintPeter
Sep 06 2015 18:31
@aslamweb So you need to build a selector that just selects that specific target. Do you know what the id is of the target you're looking at?
Dhananjay Mehrotra
@dj8923
Sep 06 2015 18:31
@SaintPeter i dunno how to fetch value from hasOwnproperty method...can we do so?
Rex Schrader
@SaintPeter
Sep 06 2015 18:31
@aslamweb And do you know how to specifiy that for jquery
aslamweb
@aslamweb
Sep 06 2015 18:32
Yeah I'd is target1
("#target1")
Dhananjay Mehrotra
@dj8923
Sep 06 2015 18:32
@SaintPeter collection[i].hasOwnProperty(sourceKey).value; .....is it possible...i don't seem any output coming
aslamweb
@aslamweb
Sep 06 2015 18:32
right ?
Rex Schrader
@SaintPeter
Sep 06 2015 18:33
@dj8923 you can't. hasOwnProperty returns a true or a false. you can access an object like this:
myObject['keyname']
// or
myObject[aVariableWithAKeyNameInIt]
@aslamweb Correct. Now just use .prop to add the disabled value to it.
aslamweb
@aslamweb
Sep 06 2015 18:34
Not working
still saying : Disable your target1 button.
Rex Schrader
@SaintPeter
Sep 06 2015 18:34
@aslamweb Share your code, please?
aslamweb
@aslamweb
Sep 06 2015 18:35

``<script>
2
$(document).ready(function() {
3
$("#target1").css("color", "red");
4

5
$("#target1").prop ("disabled,true");
6

7
});
8
</script>` ```

xtylerdurdenx
@xtylerdurdenx
Sep 06 2015 18:35
@aslamweb you need 3 ```
aslamweb
@aslamweb
Sep 06 2015 18:35

``<script>
2
$(document).ready(function() {
3
$("#target1").css("color", "red");
4

5
$("#target1").prop ("disabled,true");
6

7
});
8
</script>` ```

xtylerdurdenx
@xtylerdurdenx
Sep 06 2015 18:35
@aslamweb also the ``` should have their own line.
@aslamweb

test
aslamweb
@aslamweb
Sep 06 2015 18:36
cant do that in iPad
Rex Schrader
@SaintPeter
Sep 06 2015 18:36

@aslamweb ok, the problem is your quotes:

$("#target1").prop ("disabled,true");

Only disabled needs to be in quotes.

$("#target1").prop ("disabled", true);
Dhananjay Mehrotra
@dj8923
Sep 06 2015 18:38

@SaintPeter
function where(collection, source) {
var arr = [];
var sourceKey = Object.keys(source);
for (var i = 0; i < collection.length; i++) {
if(collection[i].hasOwnProperty(sourceKey)){
if(collection[i][sourceKey[i]].value == sourceKey[i].value){
console.log(sourceKey[i].value);
}
}
};
// What's in a name?
return arr;
}

where([{ first: 'Romeo', last: 'Montague' },
{ first: 'Mercutio', last: null },
{ first: 'Tybalt', last: 'Capulet' }
],{ last: 'Capulet' });

aslamweb
@aslamweb
Sep 06 2015 18:38
@SaintPeter Thanks Buddy :smile :+1:
CamperBot
@camperbot
Sep 06 2015 18:38
aslamweb sends brownie points to @saintpeter :sparkles: :thumbsup: :sparkles:
:star: 531 | @saintpeter | http://www.freecodecamp.com/saintpeter
Rex Schrader
@SaintPeter
Sep 06 2015 18:39
@dj8923 Gettign there! Now you need to think about how do you check all of the source keys before you return a value. You also need to think about how you're going to store the objects which meet the criteria in arr
FYI, I'm off to camping. Keep truckin' folks!
Yuriy
@theGame
Sep 06 2015 18:46

Hi all, I have a problem in 'Return Largest Numbers in Arrays' chapter so I have a code but the test is doesn't pass. Please help! function largestOfFour(arr) {
// You can do this!
var index;
var max = 0;
for (var i = 0; i<arr.length; i++ ){ for (var j = 0; j < arr[i].length; j++) { console.log(arr[i][j]); if (arr[i][j] > max){
max = arr[i][j];
index = i;
}
}
}
return arr[index];
}

largestOfFour([[4, 5, 1, 3], [13, 27, 18, 26], [32, 35, 37, 39], [1000, 1001, 857, 1]]);

Bill
@kirah1314
Sep 06 2015 18:47
@theGame
function largestOfFour(arr) {
// You can do this!
var index;
var max = 0;
for (var i = 0; i<arr.length; i++ ){ for (var j = 0; j < arr[i].length; j++) { console.log(arr[i][j]); if (arr[i][j] > max){
max = arr[i][j];
index = i;
}
}
}
return arr[index];
}
largestOfFour([[4, 5, 1, 3], [13, 27, 18, 26], [32, 35, 37, 39], [1000, 1001, 857, 1]]);
@theGame you're missing a way to push max into a new array
@theGame use the push() method and then you have to reset max to 0
Yuriy
@theGame
Sep 06 2015 18:50
@kirah1314 yeah, I've just noticed it, thanks a lot
CamperBot
@camperbot
Sep 06 2015 18:50
thegame sends brownie points to @kirah1314 :sparkles: :thumbsup: :sparkles:
:star: 192 | @kirah1314 | http://www.freecodecamp.com/kirah1314
Bill
@kirah1314
Sep 06 2015 18:52
:thumbsup:
aslamweb
@aslamweb
Sep 06 2015 18:58


$("#left-well").parent().css("background-color", "red");
Whats wrong ?
AnyBody there?
Pratik Ratnaparkhi
@pratikr1593
Sep 06 2015 19:01
<link href="http://fonts.googleapis.com/css?family=Lobster" rel="stylesheet" type="text/css">
<style>
  h2 {
    font-family: Lobster, Monospace;
  }

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

<button>

  <i class="fa-thumbs-up fa"></i>

</button>

<div class="container-fluid">
  <div class="row">
    <div class="col-xs-8">
      <h2 class="text-primary text-center">CatPhotoApp</h2>
    </div>
    <div class="col-xs-4">
      <a href="#"><img class="img-responsive thick-green-border" src="https://bit.ly/fcc-relaxing-cat"></a>
    </div>
  </div>
  <img src="http://bit.ly/fcc-running-cats" class="img-responsive">
  <div class="row">
    <div class="col-xs-4">
      <button class="btn btn-block btn-primary">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 <span class="text-danger">love:</span></p>
  <ul>
    <li>cat nip</li>
    <li>laser pointers</li>
    <li>lasagna</li>
  </ul>
  <p>Top 3 things cats hate:</p>
  <ol>
    <li>flea treatment</li>
    <li>thunder</li>
    <li>other cats</li>
  </ol>
  <form action="/submit-cat-photo">
    <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>
it says Add an i element with the classes fa and fa-thumbs-up.
I think i have already done that
am i wrong?
aslamweb
@aslamweb
Sep 06 2015 19:02


$("#left-well").parent().css("background-color", "red");
Help
CamperBot
@camperbot
Sep 06 2015 19:02

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

Philip Warkentien II
@warkentien2
Sep 06 2015 19:03
@pratikr1593 there's no such thing as a <i> element. was it <li>?
Bill
@kirah1314
Sep 06 2015 19:03
@aslamweb i'm not sure if you need .parent(). Tried removing it?
Jose E. Pimentel
@jedpimentel
Sep 06 2015 19:04
@pratikr1593 did you try using fa and then fa-thumbs-up? (in that order)
Pratik Ratnaparkhi
@pratikr1593
Sep 06 2015 19:05
@jedpimentel changing the order worked
aslamweb
@aslamweb
Sep 06 2015 19:05
@kirah1314 it's required : left-well element should have a red background.
You should use the parent( function to modify this element.)
Only use jQuery to add these classes to the element.
Pratik Ratnaparkhi
@pratikr1593
Sep 06 2015 19:05
@jedpimentel thanks
CamperBot
@camperbot
Sep 06 2015 19:05
pratikr1593 sends brownie points to @jedpimentel :sparkles: :thumbsup: :sparkles:
:star: 282 | @jedpimentel | http://www.freecodecamp.com/jedpimentel
Bill
@kirah1314
Sep 06 2015 19:06
@aslamweb I see, what's the waypoint's web link?
@kirah1314
Jose E. Pimentel
@jedpimentel
Sep 06 2015 19:07
@pratikr1593 some times these are FCC bugs, but if I remember correctly you'll always want to use the "parent" class first, since if they both have a different property (ex: one says black text, the other orange), the html will override the first class' with the second's (I haven't tested it myself yet, though)
Bill
@kirah1314
Sep 06 2015 19:07
@aslamweb ok I saw it. The objective was to: Give the parent of the #target1 element a background-color of red.
not left-well
aslamweb
@aslamweb
Sep 06 2015 19:10
Oh ! My mistake
thanks
CamperBot
@camperbot
Sep 06 2015 19:10
if you want to thank someone, put an @ before their name!
Bill
@kirah1314
Sep 06 2015 19:11
the parent is left-well but you have to use #target1
aslamweb
@aslamweb
Sep 06 2015 19:11
Thanks @kirah1314 | <3
CamperBot
@camperbot
Sep 06 2015 19:11
aslamweb sends brownie points to @kirah1314 :sparkles: :thumbsup: :sparkles:
:star: 193 | @kirah1314 | http://www.freecodecamp.com/kirah1314
aslamweb
@aslamweb
Sep 06 2015 19:11
yeah ! I got it.
Bill
@kirah1314
Sep 06 2015 19:12
@aslamweb glad I can help :)
Ashraful Islam
@iashraful
Sep 06 2015 19:19
hello!
aslamweb
@aslamweb
Sep 06 2015 19:20
Hello
Ashraful Islam
@iashraful
Sep 06 2015 19:20
this room looks pretty quiet
Indranil Maji
@indranilphp
Sep 06 2015 19:20
bonfire seek and destroy
CamperBot
@camperbot
Sep 06 2015 19:20

:fire:Bonfire: Seek and Destroy :link:

function destroyer(arr) {
  // Remove all the values
  return arr;
}

destroyer([1, 2, 3, 1, 2, 3], 2, 3);

You will be provided with an initial array (the first argument in the destroyer function), followed by one or more arguments. Remove all elements from the initial array that are of the same value as these arguments.

more info:  bf details | bf links | hint

Indranil Maji
@indranilphp
Sep 06 2015 19:20
hint
CamperBot
@camperbot
Sep 06 2015 19:20
:construction: Spoilers are only in the Bonfire's Custom Room :point_right:
Nnxoxo
@Nnxoxo
Sep 06 2015 19:22
@indranilphp do u have some code?
Indranil Maji
@indranilphp
Sep 06 2015 19:23
@Nnutthowze i had used arguments but didnt use splice
it was a silly error !
Nnxoxo
@Nnxoxo
Sep 06 2015 19:24
@indranilphp show waht u get
Indranil Maji
@indranilphp
Sep 06 2015 19:25
it was including the entire array itself in the beginning
but only the rest of the arguments were required
so i used splice
@Nnutthowze
Ashraful Islam
@iashraful
Sep 06 2015 19:26
@Nnutthowze hello!
Nnxoxo
@Nnxoxo
Sep 06 2015 19:27
@indranilphp so u have an array and 2 values, u can use for loop and loop over this array and check if arr[i] === val1 or val2 than delete this number from array
@iashraful hi
Ashraful Islam
@iashraful
Sep 06 2015 19:27
@Nnutthowze filter(...) is a better option
Nnxoxo
@Nnxoxo
Sep 06 2015 19:28
@iashraful he needs to think a little bit...
Ashraful Islam
@iashraful
Sep 06 2015 19:28
ok
Gwendolyn Young
@GwendolynOlivia
Sep 06 2015 19:30

Please help me. I dont not understand the If-Else statements at all. Instructions: = 2) {

  return true;

}

else {

  return false;

}
Let's use if and else statements to make a coin-flip game. Create an if-else statement to return heads if the flip var is zero, or else return tails if it's not.

Indranil Maji
@indranilphp
Sep 06 2015 19:31
@Nnutthowze but what if i use filter ?
Gwendolyn Young
@GwendolynOlivia
Sep 06 2015 19:31

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.

Example:

if (1 === 2) {

  return true;

}

else {

  return false;

}

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

Create an if-else statement to return heads if the flip var is zero, or else return tails if it's not.

Run tests (ctrl + enter)

Nnxoxo
@Nnxoxo
Sep 06 2015 19:31
@indranilphp use what u want i told u basic logic
Indranil Maji
@indranilphp
Sep 06 2015 19:31
ya mate i got that :smile: @Nnutthowze
Nnxoxo
@Nnxoxo
Sep 06 2015 19:32
@GwendolynOlivia 1 === 2? true or false?
Gwendolyn Young
@GwendolynOlivia
Sep 06 2015 19:33
false?
Ashraful Islam
@iashraful
Sep 06 2015 19:33
@Nnutthowze don't think shoting him a ternary helps
*her
ops!
Nnxoxo
@Nnxoxo
Sep 06 2015 19:33
@GwendolynOlivia false, so if it's false else will work
@GwendolynOlivia and the result will be false
@GwendolynOlivia if (3 > 2) { return true; } else { return false; }
what will be in such situation?
Ashraful Islam
@iashraful
Sep 06 2015 19:36
confusion?
Josh
@jeblin71
Sep 06 2015 19:37
function where(collection, source) {
  var arr = [];
  var keyArr = Object.keys(source);
  for (var i = 0; i < collection.length; i++){
    if (keyArr === Object.keys(collection[i])){
      for(var j = 0; j < source.length; j++){
        if (source[j] === collection[j]){
          arr.push(collection[j]);
        }
      }
    }
  }

  return arr;
}
why does this return an empty array?
Gwendolyn Young
@GwendolynOlivia
Sep 06 2015 19:37
@Nnutthowze true
Nnxoxo
@Nnxoxo
Sep 06 2015 19:37
@GwendolynOlivia have u understood the logic?
Ashraful Islam
@iashraful
Sep 06 2015 19:38
@jeblin71 if (keyArr === Object.keys(collection[i])){ problem here
Josh
@jeblin71
Sep 06 2015 19:38
@iashraful whats the problem?
Gwendolyn Young
@GwendolynOlivia
Sep 06 2015 19:38
@Nnutthowze yes. thank you!
CamperBot
@camperbot
Sep 06 2015 19:38
gwendolynolivia sends brownie points to @nnutthowze :sparkles: :thumbsup: :sparkles:
:star: 313 | @nnutthowze | http://www.freecodecamp.com/nnutthowze
Hans van Riet
@hansinla
Sep 06 2015 19:38

@jeblin71 j is a number so this

if (source[j] === collection[j])

is not true.

Josh
@jeblin71
Sep 06 2015 19:39
@hansinla the j in that line is used to check the index of those two arrays
Ashraful Islam
@iashraful
Sep 06 2015 19:39
['lastname'] === ['firstname','lastname'] always false
Josh
@jeblin71
Sep 06 2015 19:39
@iashraful of course. easy answer, thank you
CamperBot
@camperbot
Sep 06 2015 19:39
jeblin71 sends brownie points to @iashraful :sparkles: :thumbsup: :sparkles:
:star: 345 | @iashraful | http://www.freecodecamp.com/iashraful
Ashraful Islam
@iashraful
Sep 06 2015 19:41
@jeblin71 never compare two arrays unless you did arr2 = arr1
array compares = always false
Josh
@jeblin71
Sep 06 2015 19:42
what about comparing two objects?
Ashraful Islam
@iashraful
Sep 06 2015 19:42
false as usual
you need to rethink your strategy
michaelcaetano
@michaelcaetano
Sep 06 2015 19:46
Checklist window underneath "RESET HELP BUG" has disappeared on me. Any suggestions? Tried reloading/exiting page to no avail.
Ashraful Islam
@iashraful
Sep 06 2015 19:46
@michaelcaetano screenshot please