These are chat archives for FreeCodeCamp/Help

18th
Aug 2017
Gersho
@Gersho
Aug 18 2017 00:23
@ericmiller777 by the way what did you change in the end to make it work ?
Gersho
@Gersho
Aug 18 2017 00:30
https://codepen.io/Gersho/pen/YxWLBJ
added alarm, and i think i'm finally done with this one
Eric Miller
@ericmiller777
Aug 18 2017 00:36
@gersho the problem was in my if statement I was using var instead of let
@Gersho I'm used to programming in unity didn't know there was a difference
Gersho
@Gersho
Aug 18 2017 00:39
i played around unity a bit a couple months ago
but learning c# today feels a bit weird
Eric Miller
@ericmiller777
Aug 18 2017 00:54
@Gersho it's OOP it's not hard to learn if you know javascript.
Gersho
@Gersho
Aug 18 2017 00:56
guess i'll give a look when i'm done with front end here
i still have
tictactoe (working, but need a heavy CSS lifting)
Simon (working, css ready but poorly scaled need to be redone)
calculator (not started)
portfolio / tribute to remake
coding wise is there many difference between 2D/3D ?
aRtoo
@artoodeeto
Aug 18 2017 01:11
hi everyone. i dont get the algorithm problem entitled smallest common multiple. i dont quite understand the question but heres my solution and its wrong.

function smallestCommons(arr) {


  var lcm = arr[0] * arr[1];
  var result = 0;

  for(var i=0; i<lcm; i++){
    if(i % 2 === 0){
      result +=i;
    }
  }

  return result;
}
smallestCommons([1,5]);
Gersho
@Gersho
Aug 18 2017 01:12
you can't really code if you don't understand what is being ask, try to look at the expected answers on the bottom left so you can make sense of it (i hate maths too)
korzo
@korzo
Aug 18 2017 01:45
@artoodeeto I skipped this, because I didn't understand the question, but I think that the result should be divided by the whole range of numbers, so for smallestCommons([1, 5]) it's 1, 2, 3, 4, 5
wyxEillen
@wyxEillen
Aug 18 2017 02:14
把你的文本框嵌套进form元素,并为此form元素添加action="/submit-cat-photo"。
how to solve it
aRtoo
@artoodeeto
Aug 18 2017 02:19
@korzo skip? how? can you skip the problem?
korzo
@korzo
Aug 18 2017 02:24
@artoodeeto I skipped this challenge and continued with next one
aRtoo
@artoodeeto
Aug 18 2017 02:32
@korzo felt so dumb in some of this challenge. :(
korzo
@korzo
Aug 18 2017 02:35
@artoodeeto that's what those challenges are for. You are here to learn ;)
I skipped it, because I didn't understand it (my English is not very good with math terms), but I re-read it now and made it. it's that hard.
aRtoo
@artoodeeto
Aug 18 2017 02:36
@korzo me too. same same. english is bad. haha. but ill comeback tomorrow
Daniel Ahn
@danii956
Aug 18 2017 02:49
Does anybody know how to put a semicolon in href?
eeflores
@eeflores
Aug 18 2017 03:15
escape with \?
or go with a percent value thingy, like %20 is space
Albert Cardona II
@daddycardona
Aug 18 2017 03:19
@ericmiller777 looks good bro :)
@danii956 what do you mean ? you trying to put the semicolon at the end
Albert Cardona II
@daddycardona
Aug 18 2017 03:29
@danii956 you could put a , and that would work or are you trying to use the semi colon for some special part of the quote?
Vuyani M Ngcana
@celfInfinite
Aug 18 2017 04:16
@sjames1958gm Thank you it works.
CamperBot
@camperbot
Aug 18 2017 04:16
celfinfinite sends brownie points to @sjames1958gm :sparkles: :thumbsup: :sparkles:
:star2: 8335 | @sjames1958gm |http://www.freecodecamp.com/sjames1958gm
Vuyani M Ngcana
@celfInfinite
Aug 18 2017 04:19
@daddycardona the problem is resolved, i needed to add origin=* to my url
Albert Cardona II
@daddycardona
Aug 18 2017 04:20
oh okay
gn
Manish Giri
@Manish-Giri
Aug 18 2017 04:42
@thekholm80 ty
CamperBot
@camperbot
Aug 18 2017 04:42
manish-giri sends brownie points to @thekholm80 :sparkles: :thumbsup: :sparkles:
:star2: 1447 | @thekholm80 |http://www.freecodecamp.com/thekholm80
Kyle Holm
@thekholm80
Aug 18 2017 04:43
@Manish-Giri np ty
CamperBot
@camperbot
Aug 18 2017 04:43
thekholm80 sends brownie points to @manish-giri :sparkles: :thumbsup: :sparkles:
:star2: 6436 | @manish-giri |http://www.freecodecamp.com/manish-giri
kingsniper10
@kingsniper10
Aug 18 2017 05:06

I need help i dont know how I need to do

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

<h2>CatPhotoApp</h2>

<p>Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.</p>
can some one explain to me how you do it.

heroiczero
@heroiczero
Aug 18 2017 05:09
@kingsniper10 what are you trying to do?
Gulsvi
@gulsvi
Aug 18 2017 05:13
Inventory Update challenge was bothering me so much a few months ago....

I sat down today and got it in like 10 minutes:

function updateInventory(arr1, arr2) {
  var finalInv = {};
  arr1.concat(arr2).forEach(sku => (finalInv[sku[1]] = finalInv[sku[1]] + sku[0] || sku[0]));
  return Object.keys(finalInv).sort().map(item => [finalInv[item], item]);
}

Real proud of that 3-liner :)

Thank you @camperbot for all your support over the past few months
CamperBot
@camperbot
Aug 18 2017 05:14
skyc0der sends brownie points to @camperbot :sparkles: :thumbsup: :sparkles:
:star2: 3384 | @camperbot |http://www.freecodecamp.com/camperbot
刘明
@loveher147
Aug 18 2017 05:50
color
Joseph
@revisualize
Aug 18 2017 06:07
Hello.
Darren
@DarrenfJ
Aug 18 2017 06:30
evening fCC
hey man :D @revisualize
Jill Lee
@jill-lee
Aug 18 2017 06:30
Hi, need help with the logo. It doesnt show when scrolled down. It should go to the top left. It doesnt work on github but it works on codepen
Darren
@DarrenfJ
Aug 18 2017 06:30
@Dhavalc2012 sorry for the late reply but was busy testing all day man :D
@phoenix-burn the House of Max thang? (I don't see an icon type logo)
Joseph
@revisualize
Aug 18 2017 06:32
@DarrenfJ Hey hey.
Darren
@DarrenfJ
Aug 18 2017 06:32
@revisualize how the recouperation coming along?
Joseph
@revisualize
Aug 18 2017 06:32
@DarrenfJ It's a long process.
Gulsvi
@gulsvi
Aug 18 2017 06:32
@phoenix-burn check your console, several errors about not finding your JS files
Jill Lee
@jill-lee
Aug 18 2017 06:33
@DarrenfJ its not an icon it should go from a bigger one to a smaller one positioned to the top left
lots of 404 errors
Darren
@DarrenfJ
Aug 18 2017 06:33
@phoenix-burn ah ok.. the words
Jill Lee
@jill-lee
Aug 18 2017 06:34
@SkyC0der thanks I'll check it out
CamperBot
@camperbot
Aug 18 2017 06:34
phoenix-burn sends brownie points to @skyc0der :sparkles: :thumbsup: :sparkles:
:star2: 2437 | @skyc0der |http://www.freecodecamp.com/skyc0der
Darren
@DarrenfJ
Aug 18 2017 06:34
@phoenix-burn all the pics of the jewelry in the github one don;t show up either
the top nav bar scrolls up and doesn't stay 'locked' like it does in CodePen...
Jill Lee
@jill-lee
Aug 18 2017 06:35
@DarrenfJ really? It does on my computer weird. thanks
CamperBot
@camperbot
Aug 18 2017 06:35
phoenix-burn sends brownie points to @darrenfj :sparkles: :thumbsup: :sparkles:
:star2: 1976 | @darrenfj |http://www.freecodecamp.com/darrenfj
Darren
@DarrenfJ
Aug 18 2017 06:36
@phoenix-burn this is what it does in the GitHub one:
image.png
if I hit the arrow it loads the second then third ring but only shows one at a time
@SkyC0der is probably right that the js isn't doing the same thang in the GitHub as it does in the CodePen
Gulsvi
@gulsvi
Aug 18 2017 06:38
Those JS files seem kind of important :), probably just need to make sure they're in the right place.
Darren
@DarrenfJ
Aug 18 2017 06:39
the CodePen has all the rings in one line and slowly automatically scroll through them
so definitely something with the automation on the GitHub page
Jill Lee
@jill-lee
Aug 18 2017 06:40
@DarrenfJ yea it works perfectly on codepen. I copied from pen to git but not sure why it isnt working thanks guys. @SkyC0der
CamperBot
@camperbot
Aug 18 2017 06:40
:warning: phoenix-burn already gave skyc0der points
:warning: phoenix-burn already gave darrenfj points
phoenix-burn sends brownie points to @darrenfj and @skyc0der :sparkles: :thumbsup: :sparkles:
Darren
@DarrenfJ
Aug 18 2017 06:40
and brownies for ya'all since this is one of the few times in the last few days I've come in and actually done something.. so thanks for that :D
thanks @phoenix-burn @SkyC0der @revisualize
CamperBot
@camperbot
Aug 18 2017 06:40
darrenfj sends brownie points to @phoenix-burn and @skyc0der and @revisualize :sparkles: :thumbsup: :sparkles:
:cookie: 159 | @phoenix-burn |http://www.freecodecamp.com/phoenix-burn
:star2: 2439 | @skyc0der |http://www.freecodecamp.com/skyc0der
:star2: 4441 | @revisualize |http://www.freecodecamp.com/revisualize
Gulsvi
@gulsvi
Aug 18 2017 06:41
Brownie party :) wohoo :confetti_ball:
Jill Lee
@jill-lee
Aug 18 2017 06:41
:D
Darren
@DarrenfJ
Aug 18 2017 06:41
:dancers:
hermeticlock
@hermeticlock
Aug 18 2017 06:56

How can I make my 'Hello World' text vertically aligned to the center of the transparent orange box?

http://codingforkids.us/newcodingforkids/

http://codingforkids.us/newcodingforkids/style.css

It's under .main h1

Eric Miller
@ericmiller777
Aug 18 2017 07:00
@Gersho sorry, yes 3d is very different, but 2d is mostly just stuff we do here @freeCodeCamp.
Owais Ahmed
@owaisehmed
Aug 18 2017 07:49
The code in my JS section isn't working? Do i need to change some settings or what?
Karan
@kazanski
Aug 18 2017 09:07
Greetings fellow campers!
Need some help

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

switch(val){
case "bob":
answer = "Marley";
break;

case 42:
  answer = "The Answer";
  break;

case 1:
  answer = "There is no #1";
  break;

case 99:
  answer = "Missed my by this much!";
  break;

case 7:
  answer = "Ate nine";
  break;

}

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

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

Challenge: replacing if else with switch
I am getting the required output with my code, but it is not passing the challenge
Tiago Correia
@tiagocorreiaalmeida
Aug 18 2017 09:12
@kazanski missing a letter
there .D
@kazanski
change case 99 Missed my to Missed me
BuntyBru
@BuntyBru
Aug 18 2017 09:19

hi all

Does anyone has an idea on

"What does a "Software Architecture and design" personnel does ?"

i need urgent help
Karan
@kazanski
Aug 18 2017 09:35
@tiagocorreiaalmeida Ah man!
Thanks alot. I feel stupid now.
Owais Ahmed
@owaisehmed
Aug 18 2017 12:32
How can i make one button appear before the other using jQuery?
Or do i have to just place them accordingly in html code?
Johnny
@JohnnyBizzel
Aug 18 2017 12:33
@owaisehmed side by side or stacked?
Owais Ahmed
@owaisehmed
Aug 18 2017 12:33
Side by side
I want home to be the first one
Do i need to change it in html code or is there a jQuery command for that>
One more thing
When i shorten the size of the page, it shows in the right sequence.
Stephen James
@sjames1958gm
Aug 18 2017 12:40
@owaisehmed A more modern way would be to wrap in a div (class="btns") and use flex
.btns {
  display:flex;
  justify-content:flex-end;
  flex-wrap:wrap;
}
Or wrap in a div and float:right the div
Johnny
@JohnnyBizzel
Aug 18 2017 12:42
@owaisehmed https://codepen.io/JohnnyBizzel/pen/wqydGL
fixed height of the container so it's a hacky solution. Try what @sjames1958gm suggests.
Owais Ahmed
@owaisehmed
Aug 18 2017 12:44
@sjames1958gm it looks kinda weird
https://codepen.io/OwaisEhmed/pen/zdRozE
Vuyani M Ngcana
@celfInfinite
Aug 18 2017 13:10

The following json doc is generated:
//(["God",["God","God Save the Queen","Godzilla (2014 film)","Godzilla (franchise)","GoDaddy","Godzilla (1954 film)","Godzilla (1998 film)","God of War (franchise)","God in Islam","Gods of Egypt (film)"],["In monotheism, God is conceived of as the supreme being and principal object of faith. The concept of God, as described by theologians, commonly includes the attributes of omniscience (all-knowing), omnipotence (unlimited power), omnipresence (present everywhere), divine simplicity, and as having an eternal and necessary existence.","\"God Save the Queen\" (alternatively \"God Save the King\", depending on the gender of the reigning monarch) is the national or royal anthem in a number of Commonwealth realms, their territories, and the British Crown Dependencies.","Godzilla is a 2014 American monster film directed by Gareth Edwards and a reboot of Toho's Godzilla franchise.","The Godzilla (\u30b4\u30b8\u30e9, Gojira) franchise is a series of multi-media featuring the monster Godzilla, owned and created by Toho.","GoDaddy Inc. is an American publicly traded Internet domain registrar and web hosting company. As of May 2017, GoDaddy has served approximately 17 million customers and had over 6,000 employees worldwide.","Godzilla (\u30b4\u30b8\u30e9, Gojira) is a 1954 Japanese kaiju film featuring Godzilla, produced and distributed by Toho.","Godzilla is a 1998 American monster film directed and co-written by Roland Emmerich that is a reimagining of Toho's Godzilla franchise.","God of War is an action-adventure hack and slash video game series loosely based on Greek mythology, originally created by David Jaffe at Sony's Santa Monica Studio.","In Islamic theology, God (Arabic: \u0627\u0644\u0644\u0647\u200e, translit. All\u0101h\u200e, contraction of Arabic: \u0627\u0644\u0652\u0625\u0650\u0644\u0670\u0647\u200f\u200e, translit.","Gods of Egypt is a 2016 American-Australian fantasy action-adventure film directed by Alex Proyas and portraying ancient Egyptian deities."],["https://en.wikipedia.org/wiki/God","https://en.wikipedia.org/wiki/God_Save_the_Queen","https://en.wikipedia.org/wiki/Godzilla_(2014_film)","https://en.wikipedia.org/wiki/Godzilla_(franchise)","https://en.wikipedia.org/wiki/GoDaddy","https://en.wikipedia.org/wiki/Godzilla_(1954_film)","https://en.wikipedia.org/wiki/Godzilla_(1998_film)","https://en.wikipedia.org/wiki/God_of_War_(franchise)","https://en.wikipedia.org/wiki/God_in_Islam","https://en.wikipedia.org/wiki/Gods_of_Egypt_(film)"]])** when this code is run

$(document).ready(function() {
  $('#icon').click(function() {
    var searchText = document.getElementById('search').value;//.replace(/\s/g,"%20");
    var url = "https://en.wikipedia.org/w/api.php?action=opensearch&search="+searchText+"&format=json&origin=*&callback=?";
   //console.log(url);
    //$.getJSON(url, function(json) {
      //console.log(json);
    //});
    $.ajax({
      type:"GET",
      url:url,
      async:false,
      datatype:"json",
      success:function(data) {
        console.log(data);
      },
      error:function(errorMessage) {
        console.log(errorMessage);
      }
    });
  });
});

why is the json doc in wrapped in brackets and starts with a forward slash.

Ken Haduch
@khaduch
Aug 18 2017 13:34

@celfInfinite - sometimes things are a little strange looking when you just use console.log - try wrapping the data in a JSON.stringify function, like this:

success:function(data) {
        console.log(JSON.stringify(data));
      },

And see if it makes any more sense to you.

@celfInfinite - and another thing to try, gives a different console output console.table(data) - see what that does, it formats the data in a table format.
Stephen James
@sjames1958gm
Aug 18 2017 13:45
@celfInfinite It looks like it is jsonp without a callback function name - try removing callback=? from your URL
@celfInfinite origin=* means you don't need jsonp (unique to wiki api)
May Kittens Devour Your Soul
@diomed
Aug 18 2017 14:39
Not trying to be that advertising guy, but CodeSchool has open free weekend courses: https://www.codeschool.com
that are usually paid, so check it out. they're also downloadable, it seems, so yeah. Make yourself smarter this weekend
439236710
@439236710
Aug 18 2017 15:00
I have a question . Should i copy source code to make my project?
Darren
@DarrenfJ
Aug 18 2017 15:02
morning fCC
thanks for the info @diomed
CamperBot
@camperbot
Aug 18 2017 15:02
darrenfj sends brownie points to @diomed :sparkles: :thumbsup: :sparkles:
:star2: 5207 | @diomed |http://www.freecodecamp.com/diomed
Darren
@DarrenfJ
Aug 18 2017 15:03
I really like their git and regex course, so I recommend that if you want brush up on it
@439236710 you can, but you should a) understand what it does.. b) customize it as needed and c) attribute it if you can...
@439236710 i mean, when you node modules you are essentially 'copying' someone else's source code...
attribute it in a comment or something
439236710
@439236710
Aug 18 2017 15:06
When you make a project . Would you copy some source code to finish your project?
@439236710
@DarrenfJ
Darren
@DarrenfJ
Aug 18 2017 15:07
@439236710 I've used stack overflow to get an idea how to do something.. rarely will I just cut and paste hap-hazzard..
@439236710 but think about when you are using the documentation for jQuery... am I 'copying' code when I write :
$(document).ready(function() {
          //insert js here
});
I am in a way.. or when I'm using the syntax of a getJSON... i mean there's only so many ways to do the syntax of a line of code...
but then when you build a process or algo, and every line matches word for word and you don't really know why some section do what they do... and you couldn't explain in pseudo code what it actually does...' that's want you want to avoid...
439236710
@439236710
Aug 18 2017 15:12
It hard to write a new code.
Darren
@DarrenfJ
Aug 18 2017 15:13
start by trying to write out what you want it to do in words (and as 'comments' )and then build each part based on the things you know... while, if, for statements,, conditionals etc etc..
439236710
@439236710
Aug 18 2017 15:15
This is my mission .
Darren
@DarrenfJ
Aug 18 2017 15:16
@439236710 here's a good starting point: https://www.udacity.com/course/intro-to-html-and-css--ud304
"In this course you will learn how to convert digital design mockups into static web pages. We will teach you how to approach page layout, how to break down a design mockup into page elements, and how to implement that in HTML and CSS."
you also learn how you build your own grid....
I highly recommend that course if you are starting out, and it doesn't really take 3 weeks...
439236710
@439236710
Aug 18 2017 15:19
Thank you very much.
Darren
@DarrenfJ
Aug 18 2017 15:20
:D
439236710
@439236710
Aug 18 2017 15:23
I realy want to copy all the source code to finish my misson . But it will not wrok .I will never know how to create my own code.
Thayyeb salim
@Thayyebsalim
Aug 18 2017 15:30
I thought so too at first
Take it a bit by bit
slowly but surely @439236710
You'll notice the progress
If you get stuck there are a lot of people willing to help out
439236710
@439236710
Aug 18 2017 15:32
That's right !
I think i shuold learn more .And then get back to finish my mission.
Rich
@richard-ball
Aug 18 2017 15:58
Can someone advise me why the html is not the same as the console output?
https://codepen.io/anon/pen/vJdgRL?editors=1011
Afiur Rahman Fahim
@faahim
Aug 18 2017 16:05
@richard-ball let me take a look
:)
Christopher McCormack
@cmccormack
Aug 18 2017 16:06
@richard-ball $("tr").append("<td>" + data[n][e] + "</td>"); you're appending the col to every tr, not just the last, is that your intention?
Rich
@richard-ball
Aug 18 2017 16:07
I am just trying to display the two entries per array in a new row.
I am not sure why it is display 6,4,2 instead of 2,2,2
Christopher McCormack
@cmccormack
Aug 18 2017 16:09
try this - https://codepen.io/cmccormack/pen/QMQOOO
Rich
@richard-ball
Aug 18 2017 16:10
that is working, what was the issue? Thank you.
Christopher McCormack
@cmccormack
Aug 18 2017 16:10
Store your new row in a variable then use that variable when you're attaching the new columns, instead of using the $('tr') selector that will select ALL rows and attach the column
Rich
@richard-ball
Aug 18 2017 16:11
Ah right.
Thanks.
Christopher McCormack
@cmccormack
Aug 18 2017 16:11
np
Vuyani M Ngcana
@celfInfinite
Aug 18 2017 16:50
@khaduch I still get the same output.
Ken Haduch
@khaduch
Aug 18 2017 16:52

@celfInfinite - well, the data that comes back is in an array structure - in my "sandbox" wikipedia project, I'm doing things like this:

      data[1].forEach( (item, i) => {
        let divStr = `
          <div class="dataItem">
            <p class="dataTitle">${item}</p>
            <p>${data[2][i]}</p>
            <a href="${data[3][i]}" target="_blank">Read More...</a>
          </div>
`;

To access the data - so that might give you some idea of the structure and how I'm accessing it?

Vuyani M Ngcana
@celfInfinite
Aug 18 2017 17:07
@khaduch i have tried accessing the structure that way, i think the structure is of string format. Because when running this code data[0] i get this output "/"
Ken Haduch
@khaduch
Aug 18 2017 17:11
@celfInfinite - do you have a URL for your project? I'm just directly access the data as it comes back from the AJAX request. If I could see your code maybe I could help a little more directly?
Vuyani M Ngcana
@celfInfinite
Aug 18 2017 17:20
@khaduch $(document).ready(function() { $('#icon').click(function() { var searchText = document.getElementById('search').value;//.replace(/\s/g,"%20"); var url = "https://en.wikipedia.org/w/api.php?action=opensearch&search="+searchText+"&format=json&origin=*&callback=?"; //console.log(url); //$.getJSON(url, function(json) { //console.log(json); //}); $.ajax({ type:"GET", url:url, async:false, datatype:"json", success:function(data) { console.table(data[0]); }, error:function(errorMessage) { console.log(errorMessage); } }); }); });
@khaduch
here is my code
here is my code
$(document).ready(function() {
  $('#icon').click(function() {
    var searchText = document.getElementById('search').value;//.replace(/\s/g,"%20");
    var url = "https://en.wikipedia.org/w/api.php?action=opensearch&search="+searchText+"&format=json&origin=*&callback=?";
   //console.log(url);
    //$.getJSON(url, function(json) {
      //console.log(json);
    //});
    $.ajax({
      type:"GET",
      url:url,
      async:false,
      datatype:"json",
      success:function(data) {
        console.table(data[0]);
      },
      error:function(errorMessage) {
        console.log(errorMessage);
      }
    });
  });
});
Ken Haduch
@khaduch
Aug 18 2017 17:33
@celfInfinite - I have to run, but instead of datatype:"json" try dataType:"json" in your ajax parameters... I think that might do the trick?
Vuyani M Ngcana
@celfInfinite
Aug 18 2017 17:39
yes it does, thank you.
Alexander Køpke
@alexanderkopke
Aug 18 2017 19:40
I concur
Rishabh Kashyap
@iamrkcheers
Aug 18 2017 21:06
why is my code displaying an error ? (I am currently on the FCC Data Visualisation -> React projects -> Markdown Previewer project )
https://codepen.io/iamrkcheers/pen/oeEyvo?editors=1010
Thank You.
AY17
@AY17
Aug 18 2017 21:27
can anyone tell me what is sass
Sass is the most mature, stable, and powerful professional grade CSS extension language in the world.
AY17
@AY17
Aug 18 2017 21:48
sky is it better than bootstrap
Daniel Ahn
@danii956
Aug 18 2017 21:49
Can anybody tell me how I can put semicolon in this twitter html link?
__mifflin__
@cdrainxv
Aug 18 2017 21:50
You can’t really compare them. BS is just a library of predefined styling and JS functions, whereas sass is a scripting language.
AY17
@AY17
Aug 18 2017 21:51
@cdrainxv can you elaborate it a little im still a bit confused😌
__mifflin__
@cdrainxv
Aug 18 2017 21:58
@AY17: Please read the documentation linked above. You’ll see the difference immediately. Most often you just add BS classes to your html elements and the styles are immediately added, but with sass- as it’s an enhanced level of css - you can write css using such things as functions, variables, loops, etc that was only possible using a scripting language like javascript.
AY17
@AY17
Aug 18 2017 21:59
ok
cowCrazy
@cowCrazy
Aug 18 2017 22:01
@danii956 try to change the semicolon to '%3B'
Daniel Ahn
@danii956
Aug 18 2017 22:20
Yup! Thanks @cowCrazy
CamperBot
@camperbot
Aug 18 2017 22:20
danii956 sends brownie points to @cowcrazy :sparkles: :thumbsup: :sparkles:
:cookie: 340 | @cowcrazy |http://www.freecodecamp.com/cowcrazy
cowCrazy
@cowCrazy
Aug 18 2017 22:20
:+1:
Razvan
@razvanlikespizza
Aug 18 2017 22:24
Can I get some non-FCC help?
aRtoo
@artoodeeto
Aug 18 2017 22:46

guys. what is this shift doing here??

function dropElements(arr, func) {
  // drop them elements.
  var times = arr.length;
  for (var i = 0; i < times; i++) {
    if (func(arr[0])) {
      //console.log(arr);
      break;
    } else {
      arr.shift();
    }
  }
  return arr;
}
dropElements([0, 1, 0, 1], function(n) {return n === 1;}); //should return [1, 0, 1].

if the loop takes the zero index which is 0 its goes to shift then goes back to the loop then what is the shift doing when arr.shift will be the same?

Gersho
@Gersho
Aug 18 2017 23:07
i'm not sure if this is what you're asking but on loop 0 it will remove (shift) the first value (arr[0] = 0 ) however, i'm unsure the following loops will work properly since arr changed in composition
Gulsvi
@gulsvi
Aug 18 2017 23:13
That's why they set the length equal to the times variable before the loop
Gersho
@Gersho
Aug 18 2017 23:15
yeah but on second loop i = 1 so it would look for arr[1], but isn't arr [1] what used to be arr[2] because of the shift ?
from my understanding it would skip half the values
Stephen James
@sjames1958gm
Aug 18 2017 23:25
That's why they don't use I inside the loop
Just looking at the first value which changes with each shift
Gulsvi
@gulsvi
Aug 18 2017 23:28
yeah, arr[0] is hard-coded in that loop
keeps getting the first element and shift()ing it off
@artoodeeto Tito, you going to ignore my awesome code example I gave you in the other room? :p
var arr = ["a", "r", "t", "o", "o", "d", "e", "e", "t", "o"];
var iterations = arr.length;
var answer = "";

for(var i = 0; i < iterations; i++) {
  answer += arr[0];
  arr.shift();
}

console.log(answer); // "artoodeeto"
aRtoo
@artoodeeto
Aug 18 2017 23:30
@SkyC0der nope dodong. hahaha. im having trouble with heroku. im about to throw this laptop :(
Gulsvi
@gulsvi
Aug 18 2017 23:30
I haven't used heroku :/
Uriel Guzmán
@Burinson
Aug 18 2017 23:49
@korzo Thanks :)
CamperBot
@camperbot
Aug 18 2017 23:49
burinson sends brownie points to @korzo :sparkles: :thumbsup: :sparkles:
:cookie: 390 | @korzo |http://www.freecodecamp.com/korzo