These are chat archives for FreeCodeCamp/HelpFrontEnd

25th
Jan 2018
Ian
@Naiguy1
Jan 25 2018 00:00
this is what i did and it is still being weird function factorialize(num) {
var factorialize = 1 2 3 4 5 == num;
var factorialize(5);
return num;
}
Kaz Baig
@kbaig
Jan 25 2018 00:00
@Naiguy1 can you explain the logic you're trying to follow
var factorialize(5) is invalid code
you use the var keyword to define variables with the name that comes right after them
Ian
@Naiguy1
Jan 25 2018 00:01
it said it wasn't defined so I put "var"
function factorialize(num) {
var factorialize = 1 2 3 4 5 == num;
return num;
}
factorialize(5);
but it still is wrong
Kaz Baig
@kbaig
Jan 25 2018 00:02
var factorialize = 1 * 2 * 3 * 4 * 5 == num;
what are you trying to do here
the above code means "does 120 equal num"?
Ian
@Naiguy1
Jan 25 2018 00:03
Multiply it by every positive integer less than or equal to it
Kaz Baig
@kbaig
Jan 25 2018 00:04
You need to go through the logic of how to calculate a factorial for any number, and try to implement that
Ian
@Naiguy1
Jan 25 2018 00:05
ok, how do I make sure it it is positive
Kaz Baig
@kbaig
Jan 25 2018 00:05
Well, what logical steps do you have in mind right now?
Ian
@Naiguy1
Jan 25 2018 00:07
Using < ,>,and <= to make it a less than or equal to it but positive.
Kaz Baig
@kbaig
Jan 25 2018 00:08
No I mean in plain english, what steps do you take to go from a number to the factorial of that number
Ian
@Naiguy1
Jan 25 2018 00:15
I have to multiply it by every positive integer that is less than or equal to it. So I will use <= to find all integers less than or equal to it then, I will use > to narrow it down to all that are above 0.
Then some how i will multiply it by them in order.
How would I get them in order?
Kaz Baig
@kbaig
Jan 25 2018 00:17
@Naiguy1 You don't need to manually find all the 0 <= integers <= num. If you do your for loop right, you can get it to do that part for you
Ian
@Naiguy1
Jan 25 2018 00:18
like
Kaz Baig
@kbaig
Jan 25 2018 00:18
I encourage you to review for loops at this stage
Ian
@Naiguy1
Jan 25 2018 00:19
for (if <= num)= true then*(num)
some thing like that?
Ian
@Naiguy1
Jan 25 2018 00:21
got it! :)
Kaz Baig
@kbaig
Jan 25 2018 00:21
@Naiguy1 good luck!
Stephan Lamoureux
@slamoureux
Jan 25 2018 01:59
on chrome dev tools, no matter the screen size my page shows the background image fine. But, when I use it on any browser on a small screen phone, a note 8, or a tablet my background image doesn't show! any ideas?
Dan Lafferty
@DanLaff
Jan 25 2018 03:10
@slamoureux Lots of ideas, but too many list without more details - can you share the code?
bv
@binduverma1
Jan 25 2018 03:29
I made a template for Random quote generator and I change the text in the html with jquery but I am clueless how to do it with json. Excercise at FCC did not explain. I checked W3 school but do not see how to do it with a Google API.
bv
@binduverma1
Jan 25 2018 04:13
Can some one suggest an API for random quote project?
.... how do I know what is format of data on that API
so that I can access it
Marc
@MWBauer
Jan 25 2018 04:34
morning, ya'll!
Tom
@moT01
Jan 25 2018 04:38
good night man
Marc
@MWBauer
Jan 25 2018 04:41
Dont' leave me, man!
Alexx Martínez
@AlexxMart
Jan 25 2018 04:54
@Binduverma1 which browser are you using? Firefox has a json viewer so it's easy to see the name of the keys in the json file
pragya1248
@pragya1248
Jan 25 2018 05:24
Hey! I m very new to CSS and bootstrap. I am doing a project on profolio making and I m struck with how-to add buttons over background ima
Images*.
Here is my code link.
Please help me out
Dan Lafferty
@DanLaff
Jan 25 2018 05:31
@pragya1248 you need to make your images background images - https://www.w3schools.com/cssref/pr_background-image.asp
bv
@binduverma1
Jan 25 2018 06:51
@AlexxMart i am using google chrome
Nitin bisht
@ntnbst
Jan 25 2018 08:04
hey
pragya1248
@pragya1248
Jan 25 2018 08:42
hey!
how to avoid overlapping of a paragraph and a box element
i used clear: both; but its
it's not working
please help me out
Fernando
@lestairon
Jan 25 2018 08:45
Have you tried using "z-index"?
pragya1248
@pragya1248
Jan 25 2018 08:45
thank you very much @DanLaff
no
Fernando
@lestairon
Jan 25 2018 08:46
Oh, wait
Let me try something
pragya1248
@pragya1248
Jan 25 2018 08:46
ok
Fernando
@lestairon
Jan 25 2018 08:47
You want it like this?
image.png
pragya1248
@pragya1248
Jan 25 2018 08:47
no
i want my paragraph to be visible
and doesn't want it to overlap with my signup box in code
Fernando
@lestairon
Jan 25 2018 08:51
image.png
?
pragya1248
@pragya1248
Jan 25 2018 08:52
no i want this signup box in the left only
it should be within About
not*
Fernando
@lestairon
Jan 25 2018 09:05
image.png
pragya1248
@pragya1248
Jan 25 2018 09:05
yes like this
thanku so much
how you did it?
Fernando
@lestairon
Jan 25 2018 09:07
I changed something on the html and css, but i think it can be done better
Let me paste it
Pastebin since i don't want to spam the chat
pragya1248
@pragya1248
Jan 25 2018 09:18
ok thank you a lot :)
Fernando
@lestairon
Jan 25 2018 09:20
What i did was, i put the paragraphs on a div
The sign box make it position: absolute, change its position and with the paragraphs position: relative and change its position too
If you make it fixed it will stick to a position even if you scroll
pragya1248
@pragya1248
Jan 25 2018 09:22
yeah actually i m designing a home page for crypto celebreties.
Fernando
@lestairon
Jan 25 2018 09:22
Oh, that's cool
pragya1248
@pragya1248
Jan 25 2018 09:23
so if i use fixed then also it will be fine right?
Fernando
@lestairon
Jan 25 2018 09:23
do you still have your code?
pragya1248
@pragya1248
Jan 25 2018 09:23
actually this is my first home page project.
Fernando
@lestairon
Jan 25 2018 09:23
If you do, try to run your pen in the chat, look what happens
pragya1248
@pragya1248
Jan 25 2018 09:24
yes i have
Fernando
@lestairon
Jan 25 2018 09:24
When you try to scroll, the box is fixed to a position
pragya1248
@pragya1248
Jan 25 2018 09:24
yes it is
Fernando
@lestairon
Jan 25 2018 09:25
see?
pragya1248
@pragya1248
Jan 25 2018 09:26
yeah
Is it good for a home page?? I am making it first time.So don't have much idea.
Fernando
@lestairon
Jan 25 2018 09:29
Making it fixed?
If you make it fixed it wil overlap some text
Why is not working the toggle method? :worried:
Aditya
@ezioda004
Jan 25 2018 10:07
@lestairon Which toggle method?
#cof event listener?
Fernando
@lestairon
Jan 25 2018 10:14
?
Makarenkov Aleksandr
@trustedperson
Jan 25 2018 10:20
Hi all!
Maybe someone can help me with my problem.
I need a mapped image, like this http://www.nevscom.ru/projects/ladozhsky-bereg/plan/?b=2&f=13 (see, plan with highlighted rooms).
First part i have done already - i created mapped image, and it works perfectly, and on hover user sees popup, all fine.
But i cant understand, how make highlighted areas? I tried canvas over my image, but in this case 'mouse hover' dosn`t work.
Can someone share solution?
Aditya
@ezioda004
Jan 25 2018 10:21
@lestairon Nevemind I missed it, toggle() method has been removed from 1.9 and above
steve84
@raynor84
Jan 25 2018 11:31
hi all, I'm stuck with the exercise diff two arrays
Fernando
@lestairon
Jan 25 2018 11:32
Oh
So, what can i use instead?
Stephen James
@sjames1958gm
Jan 25 2018 11:33
@raynor84 What code do you have?
steve84
@raynor84
Jan 25 2018 11:34
don't have any I'm stuck on how to approach the algorithm
Fernando
@lestairon
Jan 25 2018 11:37
I guess the best option now is make 2 if statements that check if the temperature is being displayed in ºC or ºF, right?
Stephen James
@sjames1958gm
Jan 25 2018 11:38
@raynor84
Maybe start with trying to find all the values in arr1 not in arr2, using the suggested links.
@lestairon You would have to do that anyway so that you calculated the correct temperature.
Stephen James
@sjames1958gm
Jan 25 2018 11:44
@lestairon I would create a variable
var isCelsius = true;
Then use that in your click handler
if (isCelsius) {
   // Change the display to F
   isCelsius = false;
}
else 
{
  // Change the display to C
  isCelsius = true;
}
steve84
@raynor84
Jan 25 2018 11:45
still testing it though....

function diffArray(arr1, arr2) {
var newArr = [];
arr1.forEach(function(array, index) {
if(array[index]==arr2[index]) {
newArr = arr1.slice(index-1,index);
console.log(arr1.slice(index-1, index));
}
});

// Same, same; but different.
return newArr;
}

diffArray([1, 2, 3, 5], [1, 2, 3, 4, 5]);

Stephen James
@sjames1958gm
Jan 25 2018 11:46
@raynor84 The function called by forEach is not called with an array it is called with a value from the array
arr1.forEach(function(value, index) {})
So you should be testing if value is in arr2 (irrespective of index) (consider indexOf function
steve84
@raynor84
Jan 25 2018 11:51
'''
CamperBot
@camperbot
Jan 25 2018 11:51
:bulb: to format code use backticks! ``` more info
steve84
@raynor84
Jan 25 2018 11:51

'''

function diffArray(arr1, arr2) {
var newArr = [];
arr1.forEach(function(value, index) {
if(value==arr2[index]) {
newArr = arr1.slice(arr1.indexOf(value),arr1.indexOf(value) - 1);
}
});

// Same, same; but different.
return newArr;
}

diffArray([1, 2, 3, 5], [1, 2, 3, 4, 5]);
'''

CamperBot
@camperbot
Jan 25 2018 11:51
:bulb: to format code use backticks! ``` more info
steve84
@raynor84
Jan 25 2018 11:52

function diffArray(arr1, arr2) {
  var newArr = [];
 arr1.forEach(function(value, index) {
   if(value==arr2[index]) {
     newArr = arr1.slice(arr1.indexOf(value),arr1.indexOf(value) - 1);
   }
 });


  // Same, same; but different.
  return newArr;
}

diffArray([1, 2, 3, 5], [1, 2, 3, 4, 5]);
Stephen James
@sjames1958gm
Jan 25 2018 11:55
@raynor84 Doesn't that just compare value to one value in arr2? You are resetting newArr with each iteration.
Consider arr2.indexOf(value) and how the value from this might be useful
steve84
@raynor84
Jan 25 2018 11:56
the index should be index++ next iteration
Juli Cheng
@julicheng
Jan 25 2018 11:56
hi guys would really appreciate if someone could help with my question. so im looking at a js file and this is at the top
import $ from 'jquery' import TweenMax from 'gsap'
what does it mean and is it vanilla js? i know it says its importing jquery and tweenmax but ive never seen this syntax before. thanks!
Fernando
@lestairon
Jan 25 2018 11:57
That looks like python lol, but yeah, i've never seen that syntax in js
Stephen James
@sjames1958gm
Jan 25 2018 11:57
@julicheng
It is the new module syntax
@julicheng It doesn't have a lot of browser support yet, so you will see that code converted by tools like babel on the server before being
sent to the browser
@raynor84 I am going to say you don't really need the index at all, if a value from arr1 is not in arr2, simply add the value to newArr
Fernando
@lestairon
Jan 25 2018 12:01
@sjames1958gm Why arent we using Ecmascript 6 instead of Js?
steve84
@raynor84
Jan 25 2018 12:01
'''
CamperBot
@camperbot
Jan 25 2018 12:01
:bulb: to format code use backticks! ``` more info
Stephen James
@sjames1958gm
Jan 25 2018 12:01
@lestairon ecmascript is the specification, javascript is the implementation of ecmascript
Andrew Marushko
@andrewmarushko
Jan 25 2018 12:01

Hi all.
i had a question.
I have array of objects for example

var someArray = [{name: ‘one'}, {name: ’two'}, {name: ’three’}]

how i can add for example field id: 1 for each of objects in array
output must be something like this

var someArray = [{name: ‘one’, id: 1}, {name: ’two’, id: 2}, {name: ’three’, id: 3}]

steve84
@raynor84
Jan 25 2018 12:01

function diffArray(arr1, arr2) {
  var newArr = [];
 arr1.forEach(function(value, index) {
   if(value!=arr2[index]) {
     newArr.push(arr2[index]);
   }
 });


  // Same, same; but different.
  return newArr;
}

diffArray([1, 2, 3, 5], [1, 2, 3, 4, 5]);
Fernando
@lestairon
Jan 25 2018 12:01
Yeah, but i mean the newer vesion
Stephen James
@sjames1958gm
Jan 25 2018 12:02
@lestairon If your browser supports it you can. Most modern ones support a lot of ES6
Fernando
@lestairon
Jan 25 2018 12:02
Oh
I was curious, because most sites teach ES5.1 instead ES6
Stephen James
@sjames1958gm
Jan 25 2018 12:03
@raynor84 That is closer, but you are still only comparing value to one element of arr2 and not searching all of arr2,
Then you would push value not arr2[index]
@lestairon I am seeing most of the newer courses on sites like Udemy using more of ES6
@andrewmarushko I would use array.map for that
@andrewmarushko
someArray.map((element, index) => {
   element.id = index + 1;
   return element;
}
Juli Cheng
@julicheng
Jan 25 2018 12:06
hi @sjames1958gm thank you for your reply! what is a module ? is it an external file ? thanks
CamperBot
@camperbot
Jan 25 2018 12:06
julicheng sends brownie points to @sjames1958gm :sparkles: :thumbsup: :sparkles:
:star2: 8894 | @sjames1958gm |http://www.freecodecamp.org/sjames1958gm
Fernando
@lestairon
Jan 25 2018 12:06
I guess ES6 doesn't have that many libraries tho
Stephen James
@sjames1958gm
Jan 25 2018 12:06
@julicheng Yes, a module is another file.
steve84
@raynor84
Jan 25 2018 12:09
this works:
´´´

function diffArray(arr1, arr2) {
  var newArr = [];
 arr1.forEach(function(value, index) {
     if(arr2.indexOf(value)==-1) {
       newArr.push(value);
     }
 });
  arr2.forEach(function(value, index) {
    if(arr1.indexOf(value)==-1) {
    newArr.push(value);
  }           
 });


  // Same, same; but different.
  return newArr;
}

diffArray(["diorite", "andesite", "grass", "dirt", "pink wool", "dead shrub"], ["diorite", "andesite", "grass", "dirt", "dead shrub"]);
Stephen James
@sjames1958gm
Jan 25 2018 12:10
@andrewmarushko You could even use the spread syntax
someArray.map((element, index) => ({...element, id: index+1})
@raynor84 :+1:
steve84
@raynor84
Jan 25 2018 12:10
thx
Markus Kiili
@Masd925
Jan 25 2018 12:11
@raynor84 You have essentially the same code there twice, so you could refactor that functionality into a function that you use twice.
Stephen James
@sjames1958gm
Jan 25 2018 12:12
@raynor84 Your code in forEach is basically what filter does for you
this is the same using filter
newArr = arr1.filter(function(value) { return arr2.indexOf(value)==-1})
newArr.concat(arr2.filter(function(value) return arr1.indexOf(value) == -1})
steve84
@raynor84
Jan 25 2018 12:19
@james need to check it again... it didn't work
Fernando
@lestairon
Jan 25 2018 12:19
Does someone know why when i try to type "}" in Codepen it replaces it with a /* */?
Juli Cheng
@julicheng
Jan 25 2018 12:24
thanks @sjames1958gm import $ from 'jquery' import TweenMax from 'gsap' is 'jquery' the file location ?
CamperBot
@camperbot
Jan 25 2018 12:24
julicheng sends brownie points to @sjames1958gm :sparkles: :thumbsup: :sparkles:
api offline
steve84
@raynor84
Jan 25 2018 12:29
for some reason arr2 is not filtering the values out... eventhough it is almost the same code
catalin560
@catalin560
Jan 25 2018 12:46
hello can someone help me with some loops? so I have a number of elements with id's like "video-id-###" how do I loop and store each id in an array? (preferably using jquery)
Markus Kiili
@Masd925
Jan 25 2018 12:48
@catalin560 Sounds like String manipulation, so take a look at JS String methods.
Fernando
@lestairon
Jan 25 2018 12:53
Oh no
FCC's weather api icon has like the opposite aesthetic that i'm using for my weather app
It's actually kinda funny hahah
Andrew Marushko
@andrewmarushko
Jan 25 2018 13:37
@sjames1958gm Thanks dude, it’s works :)
CamperBot
@camperbot
Jan 25 2018 13:37
andrewmarushko sends brownie points to @sjames1958gm :sparkles: :thumbsup: :sparkles:
:star2: 8895 | @sjames1958gm |http://www.freecodecamp.org/sjames1958gm
catalin560
@catalin560
Jan 25 2018 13:44
@Masd925 seems to have worked with splice()
catalin560
@catalin560
Jan 25 2018 13:57
is there a way to use arrays as selectors in jquery?
Sweet Coding :)
@SweetCodingInc
Jan 25 2018 13:58
@catalin560 array of what?
catalin560
@catalin560
Jan 25 2018 14:00
never mind just found out how to do it
array of ids
Stephen James
@sjames1958gm
Jan 25 2018 14:17
@lestairon Just a note. Since you add your click handler for F/C inside your click handler for location.
If you click the location button again, you add a second click handler, and again if you click again.
If you put a console.log() inside there you will see it called an additional time for each location click.
it doesn't affect this app much, but for other apps, it might. Just something I wanted to point out.
Fernando
@lestairon
Jan 25 2018 14:19
Oh, so it can cause performance issues?
Stephen James
@sjames1958gm
Jan 25 2018 14:23
@lestairon Yes
Fernando
@lestairon
Jan 25 2018 14:41
So, it can be fixed just making the variable global, right?
Stephen James
@sjames1958gm
Jan 25 2018 14:59
@lestairon Making the temperature and the celsius boolean global
Fernando
@lestairon
Jan 25 2018 15:14
Now it should be fixed
Ali Bulut
@ali27001
Jan 25 2018 15:14
https://codepen.io/alibulut/pen/oproLq?editors=1100 <li> why the icons do not show ?
Fernando
@lestairon
Jan 25 2018 15:16
I think now i'm able to see the source code of the original weather app by FCC since i finished my pen, kind of
Just wanted to see which api were they using for their icons, since it matches with mine too
Ian
@toianw
Jan 25 2018 15:23
@ali27001 your font awesome link is not valid. The request for <link rel="stylesheet" href="path/to/font-awesome/css/font-awesome.min.css"> is giving a 404 error. I think you need to register for font Awesome now and they will send you a valid CDN link by email.
Ali Bulut
@ali27001
Jan 25 2018 15:25
@toianw <link rel="stylesheet" href="path/to/font-awesome/css/font-awesome.min.css">
is not this cdn
Ian
@toianw
Jan 25 2018 15:30
@ali27001 no, the CDN would be something like href="https://use.fontawesome.com/...
that just looks like an example link for if you had the fonts installed locally on your server
go to their website to get the link:
http://fontawesome.io/
Kaz Baig
@kbaig
Jan 25 2018 15:32
PSA: If, for whatever reason, you're running jQuery version < 3.0.0, upgrade to >= 3.0.0! There's an XSS vulnerability in your current version
Ali Bulut
@ali27001
Jan 25 2018 15:34
@toianw ı did dude
navbar hamburger why the menu does not work
Fernando
@lestairon
Jan 25 2018 15:36
If i want to make a rain effect using JS how can i do it?
Idk if it's too advanced for me, i'll check it out anyways
Ian
@toianw
Jan 25 2018 15:37
@ali27001 I think bootstrap nav requires jQuery as a dependency.
Ali Bulut
@ali27001
Jan 25 2018 15:44
@toianw true !
Ali Bulut
@ali27001
Jan 25 2018 15:57
Is there a problem with the eye?
Scott Lieber
@lieberscott
Jan 25 2018 16:10
Building the Camp Leaderboard App with React. Going well, but trying to link each camper to their fcc profile, and the links are acting funny. I pass the url as a prop from my Toprow component to my User component. For some reason when you click the user, it's opening a new tab on some weird Codepen error page, can't figure out why. Any ideas?
Scott Lieber
@lieberscott
Jan 25 2018 16:25
Nevermind, figured it out. I needed to add the "https://" to the beginning of the url, instead of just having "www.freecodecamp.org/"
Stephen James
@sjames1958gm
Jan 25 2018 16:25
@lieberscott :+1:
Darren
@DarrenfJ
Jan 25 2018 16:33
@lieberscott looks good man... also i just love looking at all the people who help out regularly...
man those 404 error pages they got going over at CodePen are schwanky! :D
Kaz Baig
@kbaig
Jan 25 2018 16:56
@DarrenfJ I may sometimes go to my own leaderboard project to see how people are doing ;)
The one time I actually used html tables
Tom
@moT01
Jan 25 2018 17:07
my only table too
Kaz Baig
@kbaig
Jan 25 2018 17:08
tbh life would be easier if I used CSS grid with divs
But we gotta have semantic markup :clap:
dinesh
@1532j0004kg
Jan 25 2018 17:08
hi can any one help me to host the webapp ?
Tom
@moT01
Jan 25 2018 17:10
sure
dinesh
@1532j0004kg
Jan 25 2018 17:11
can u pls tell those steps i need to follow ?
Tom
@moT01
Jan 25 2018 17:12
you have a repo?
dinesh
@1532j0004kg
Jan 25 2018 17:12
yup
Tom
@moT01
Jan 25 2018 17:12
what one
dinesh
@1532j0004kg
Jan 25 2018 17:12
for my proj .
I am just learning how to host :smile:
Tom
@moT01
Jan 25 2018 17:14
you dont need to upload your node_modules folder
dinesh
@1532j0004kg
Jan 25 2018 17:14
@moT01
goodgoof
@goodgoof
Jan 25 2018 17:14
hi guys need some help with css art. I want to create a taco and i am trying to give my taco a face. here is my codepen link. I need to add a mouth and the pupil for the eye which i have coded but it is not appearing....wondering why https://codepen.io/anjalis/pen/vpwbdd?editors=0100
Tom
@moT01
Jan 25 2018 17:14
glitch should make that one real easy
make/link account + login
dinesh
@1532j0004kg
Jan 25 2018 17:15
i 'll try !
Tom
@moT01
Jan 25 2018 17:15
start new project -> node app
dinesh
@1532j0004kg
Jan 25 2018 17:17
started new proj then ?
Tom
@moT01
Jan 25 2018 17:17
yes
top left
little drop down
click advanced options
import from github
1532j0004kg/meetup
put that in there
wait
you should go to the repo and delete that node modules folder first
dinesh
@1532j0004kg
Jan 25 2018 17:19
y ?
is it not important?
Kaz Baig
@kbaig
Jan 25 2018 17:20
@goodgoof your pupils don't have any size/background colors and your mouth doesn't have a background color so you can't see them but they're there
Tom
@moT01
Jan 25 2018 17:20
no
they will have that for you
they will install the modules you need that are in your package.json file
goodgoof
@goodgoof
Jan 25 2018 17:20
@kbaig pupil does have size and background-color?
dinesh
@1532j0004kg
Jan 25 2018 17:21
ok
deleting
goodgoof
@goodgoof
Jan 25 2018 17:21
i meant inner-eye-left
Kaz Baig
@kbaig
Jan 25 2018 17:22
@goodgoof ah I was looking at the right pupil
goodgoof
@goodgoof
Jan 25 2018 17:22
here is my inner-eye-left code .inner-eye-left { position: absolute; background-color: white; color: white; top: 20%; left: 25%; width: 6%; height: 4%; border-radius: 50%; z-index:3; }
Kaz Baig
@kbaig
Jan 25 2018 17:23
@goodgoof you'll see it if you increase the size
goodgoof
@goodgoof
Jan 25 2018 17:23
@kbaig increase size of what?
have tried all that
Kaz Baig
@kbaig
Jan 25 2018 17:23
of the left pupil
goodgoof
@goodgoof
Jan 25 2018 17:24
ok, let me see again
Kaz Baig
@kbaig
Jan 25 2018 17:24
it's hanging out in the overflow area
goodgoof
@goodgoof
Jan 25 2018 17:24
how do u know that? overflow property?
dinesh
@1532j0004kg
Jan 25 2018 17:24
there is no option for deleting folder in github ?
Matej Bošnjak
@mbosnjak01
Jan 25 2018 17:25
there is
dinesh
@1532j0004kg
Jan 25 2018 17:25
i didn't see anything where it is locating ?
Matej Bošnjak
@mbosnjak01
Jan 25 2018 17:26
I think when you delete all files from a folder on github
Matej Bošnjak
@mbosnjak01
Jan 25 2018 17:26
that folder gets deleted as well
All I changed was the position of the pupil
dinesh
@1532j0004kg
Jan 25 2018 17:26
is it possible to delete older directly ?
Kaz Baig
@kbaig
Jan 25 2018 17:26
I'm using the element inspector tool to see where the html elements are
Matej Bošnjak
@mbosnjak01
Jan 25 2018 17:26
I don't think so. Try my way :D
dinesh
@1532j0004kg
Jan 25 2018 17:27
i want to delete nodemodule folder :worried:
it has lot of files :worried:
Kaz Baig
@kbaig
Jan 25 2018 17:27
@1532j0004kg you should have a .gitignore file to handle that
Matej Bošnjak
@mbosnjak01
Jan 25 2018 17:28
@1532j0004kg Maybe there's a tool for that, I don't know, I don't use github tools ... Also check if there's a console command for that. If not, well ... file by file it is.
goodgoof
@goodgoof
Jan 25 2018 17:28
@kbaig i dont see the code. can u paste that also
Matej Bošnjak
@mbosnjak01
Jan 25 2018 17:28
or what @kbaig is saying.
Tom
@moT01
Jan 25 2018 17:28
your probly better off making a new repo and uploading without that folder
Matej Bošnjak
@mbosnjak01
Jan 25 2018 17:29
options everywhere XD
dinesh
@1532j0004kg
Jan 25 2018 17:29
Am i want to include all the unwanted folder inside that .gitignore
Kaz Baig
@kbaig
Jan 25 2018 17:29
@goodgoof I just changed top to 75% and left to 70% for the left pupil
Tom
@moT01
Jan 25 2018 17:29
and yes - add node_modules to the .gitignore file so it wont upload
dinesh
@1532j0004kg
Jan 25 2018 17:31
@moT01 check my repo now !
is it okay ?
Matej Bošnjak
@mbosnjak01
Jan 25 2018 17:31
um...can anyone give me personal oppinion on working with MERN stack and MEAN stack? What would be "better"? Any examples of Apps from both sides to best show the difference? - I worked a little with angular 1.6
goodgoof
@goodgoof
Jan 25 2018 17:33
@kbaig ok thanks
CamperBot
@camperbot
Jan 25 2018 17:33
goodgoof sends brownie points to @kbaig :sparkles: :thumbsup: :sparkles:
:cookie: 553 | @kbaig |http://www.freecodecamp.org/kbaig
Kaz Baig
@kbaig
Jan 25 2018 17:33
@mbosnjak01 AFAIK Angular 1.x has nothing to do with Angular. It's really up to personal preference if you're doing it for your own projects. If you have career motives for learning one or the other, those might drive your decision
Tom
@moT01
Jan 25 2018 17:33
im not sure on this - but i think react is becoming more popular - so maybe go that route
Kaz Baig
@kbaig
Jan 25 2018 17:35
@mbosnjak01 If it's just for personal projects, I guess it would be helpful for you to know that React is a view library so you're likely going to have to incorporate other packages to get the full functionality you want, whereas Angular is a full framework and you will rarely have to venture out of it to get what you need
Matej Bošnjak
@mbosnjak01
Jan 25 2018 17:35
@kbaig Both personal stuff and carrer :)
Kaz Baig
@kbaig
Jan 25 2018 17:35
This also means that React can be easier to pick up than Angular since there's less to learn. But it's kind of apples to oranges in that you still would have to pick up some other stuff if you learn React
Additionally, some people take issue with the use of JSX in React (I love it) and also appreciate the control TypeScript gives you
Matej Bošnjak
@mbosnjak01
Jan 25 2018 17:37
Can Those stacks be implemented on mobile apps as well?
Stephen James
@sjames1958gm
Jan 25 2018 17:37
@mbosnjak01 I'll second what @kbaig is saying. I would go with MERN and then maybe learn Angular later.
Kaz Baig
@kbaig
Jan 25 2018 17:37
TLDR: If you want to work in enterprise, probably Angular. In most other cases, I'd say React. Obviously Vue is a thing too
Both Angular and React have native mobile frameworks, though I think the React one is quite a bit more popular
Stephen James
@sjames1958gm
Jan 25 2018 17:38
@mbosnjak01 There is React Native that can be used for mobile, which uses most of the same concepts as web React
Kaz Baig
@kbaig
Jan 25 2018 17:38
React Native and NativeScript
Matej Bošnjak
@mbosnjak01
Jan 25 2018 17:40
Vue looks like a combination of angular and react to me XD
Kaz Baig
@kbaig
Jan 25 2018 17:40
That's not particularly wrong
Tom
@moT01
Jan 25 2018 17:40
@1532j0004kg if you're still working on the new repo - you will want to change your package.json to use index.js instead of server.js
dinesh
@1532j0004kg
Jan 25 2018 17:41
oh ok
Marco Galizzi
@Tezenn
Jan 25 2018 17:41
hello everyone, is it possible to have a onclikc function to comment/uncomment part of my code?
Kaz Baig
@kbaig
Jan 25 2018 17:42
The creator is a former Google employee who took issue with Angular's learning curve and mundanity, so he took a little of both in consideration when making Vue
@mbosnjak01
@Tezenn not sure what you mean
Tom
@moT01
Jan 25 2018 17:42
not to uncomment that i know of
proka89
@proka89
Jan 25 2018 17:42
How can i add data from JSON (something like data[i].name) in to <input> field value attribute, something like value="data[i].name". Is it even possible?
Kaz Baig
@kbaig
Jan 25 2018 17:44
@proka89 sure you can. You can select it using document.getElementById or some other similar method and set that DOM node's value property to whatever you want
Tom
@moT01
Jan 25 2018 17:44
just put the code you want to execute in the click event @Tezenn would be the way to do it i would think
Marco Galizzi
@Tezenn
Jan 25 2018 17:45
@kbaig ok i'm trying to merge the human vs human and the human vs ai tic tac toe that are two projects.. an easy way would be comment the part i dont need when click hum vs hum
maybe is too easy like this
Matej Bošnjak
@mbosnjak01
Jan 25 2018 17:45
Looks like I'll go for React first, then Angular ... Vue looks nice but that might come latter, but I doubt it. Thanks for the info @kbaig @sjames1958gm @moT01
CamperBot
@camperbot
Jan 25 2018 17:45
mbosnjak01 sends brownie points to @kbaig and @sjames1958gm and @mot01 :sparkles: :thumbsup: :sparkles:
:cookie: 554 | @kbaig |http://www.freecodecamp.org/kbaig
:star2: 8898 | @sjames1958gm |http://www.freecodecamp.org/sjames1958gm
:cookie: 966 | @mot01 |http://www.freecodecamp.org/mot01
Kaz Baig
@kbaig
Jan 25 2018 17:45
@Tezenn the right way to do it would be to just have an if/else statement based on which mode the user chooses
Tom
@moT01
Jan 25 2018 17:46
@mbosnjak01 freecodecamp beta has some react exercises
it's not working :worried:
Matej Bošnjak
@mbosnjak01
Jan 25 2018 17:46
@moT01 Yes, I might try them out, although I am completely fine with raw documentation as well :D
Marco Galizzi
@Tezenn
Jan 25 2018 17:48
@kbaig yes i will follow the proper way ;)
Tom
@moT01
Jan 25 2018 17:53
not quite sure what the problem is - the database for sure wont work yet - im looking
@1532j0004kg
dinesh
@1532j0004kg
Jan 25 2018 17:54
ok tnx !
Tom
@moT01
Jan 25 2018 17:55
there's a way to invite me to edit - click my little logo there and try and find it
dinesh
@1532j0004kg
Jan 25 2018 17:55
:+1:
Stephen James
@sjames1958gm
Jan 25 2018 17:56
@camperbot :+1:
maayoko
@maayoko
Jan 25 2018 18:32
Hi, is anybody here doing server side rendering? How do you guys render css on server? How to extract wanted styles from css and inject them in html's style tag (I'm asking this because I'm using semantic-ui-css and there is a lot of css files)
VaseJS
@VaseJS
Jan 25 2018 19:10
@maayoko you can’t render css on the server side. its a browser thing. you may produce code that is delieverd with css in place, but it thats not the same thing as rendering css on the server. to the server, css is just more code that it doesn’t know what to do with other than send it somewhere…the browser.
Aryan J
@AryanJ-NYC
Jan 25 2018 19:39
@maayoko What are you using? I've done SSR.
iceveda06
@iceveda06
Jan 25 2018 19:42
Its been awhile since i got brownie points
@maayoko for ex: if you have ruby on rails.. you would put your css and html into a specific folder so when user requests your files it will get served
Depending on the page
Hope that makes sense
baywatchbabe
@baywatchbabe
Jan 25 2018 19:48
Hi guys :)
Matej Bošnjak
@mbosnjak01
Jan 25 2018 19:49
not from denmark :P
supp
baywatchbabe
@baywatchbabe
Jan 25 2018 19:50
Supp mate ;)
Anders Nicolai Magnussen
@andersnicolaimagnussen
Jan 25 2018 21:37
var brukerTall = 0;
var numberArray = [];
var operator;
var temp = 0;
var resultString = "";
var evalString = 0;

// A $( document ).ready() block.


    $(function tall (tall) {
        brukerTall = tall;
        addToResult(brukerTall);
        updateViewResult(brukerTall);
    });

    $("#one").click(function() {

        alert("hello"
        );

        $(function addToResult(temp) {
            numberArray.push(temp);
        });

        $(function sjekkTall(tall) {

            addToResult(tall);
            var temp = 0;
            temp = tall;
            updateViewResult(tall)
        });

        $(function updateViewResult(temp) {

            $("#display").append(temp);
        });

        $(function operators(operator) {
            addToResult(operator);
            updateViewResult(operator);
        });

        $(function clearAll() {

            $("#display").text("");
        });

        $(function removeDigit() {

        });

        $(function fixString() {
            resultString = numberArray.toString();

            var valueFixed = resultString.replace(/,/g, '');

            calculate(valueFixed);
            //alert(valueFixed);

        });


        $(function fixString() {

            var resultaValue = parseFloat(eval(valueFixed));
            clearAll();
            updateViewResult(resultaValue);


        });

Can anyone see what is missing here?
Starting with jquery

```

its companing about missing a bracket somewhere. Can you spot it?
Dan Lafferty
@DanLaff
Jan 25 2018 21:39
@nicolaimagnussen Add }) to the end. Your click function isn't closed.
Anders Nicolai Magnussen
@andersnicolaimagnussen
Jan 25 2018 21:40
oh, so what I am doing know is having everyfunction inside the click function, that would be messy
var brukerTall = 0;
var numberArray = [];
var operator;
var temp = 0;
var resultString = "";
var evalString = 0;

// A $( document ).ready() block.


    $(function tall (tall) {
        brukerTall = tall;
        addToResult(brukerTall);
        updateViewResult(brukerTall);
    });

    $("#one").click(function() {

        alert("hello"
        );
    })

        $(function addToResult(temp) {
            numberArray.push(temp);
        });

        $(function sjekkTall(tall) {

            addToResult(tall);
            var temp = 0;
            temp = tall;
            updateViewResult(tall)
        });

        $(function updateViewResult(temp) {

            $("#display").append(temp);
        });

        $(function operators(operator) {
            addToResult(operator);
            updateViewResult(operator);
        });

        $(function clearAll() {

            $("#display").text("");
        });

        $(function removeDigit() {

        });

        $(function fixString() {
            resultString = numberArray.toString();

            var valueFixed = resultString.replace(/,/g, '');

            calculate(valueFixed);
            //alert(valueFixed);

        });


        $(function fixString() {

            var resultaValue = parseFloat(eval(valueFixed));
            clearAll();
            updateViewResult(resultaValue);


        });
is this the better way to do it, inside of onclick on the html button like this?
            <button onclick="tall(7)" value="7" class="btn btn-primary" id="seven">7</button>
I tried clicking on the button 1, but nothing is happening...
Dan Lafferty
@DanLaff
Jan 25 2018 21:42
onclick attributes are usually not the better way to do it - keep javascript all together not a hybrid between your HTML/JS
Bjorn van de Peut
@bjorno43
Jan 25 2018 21:43
@nicolaimagnussen Please use Codepen or Pastebin when posting large walls of code. It could be considdered spamming ;)
Mark Kubik
@KUBIX90
Jan 25 2018 21:43

Hi

Can anyone help work out why the online/offline text method will not loop through like the rest of the code? Seems to only do the first channel

Thanks
Plus its not actually showing the text correctly either
Anders Nicolai Magnussen
@andersnicolaimagnussen
Jan 25 2018 21:46

Okey, thanks. I will do that next time.
I know why the alert did not work, it was becuase the onclick was applied kind of after, so therefore the click event function did not have effect, okey thanks @DanLaff .

Do you always need document.ready function when using jquery?

Because everything was working fine without the functions looking like this

  $(function addToResult(temp) {
            numberArray.push(temp);
        });

but this did the job before,

function addToResult(temp) {
            numberArray.push(temp);
        }

So what is the difference, thanks in advance :)

CamperBot
@camperbot
Jan 25 2018 21:46
nicolaimagnussen sends brownie points to @danlaff :sparkles: :thumbsup: :sparkles:
api offline
Dan Lafferty
@DanLaff
Jan 25 2018 21:48
@nicolaimagnussen document.ready is deprecated in jQuery 3, but no, you don't always need it. If you have code that needs to wait for scripts to download first, for example, it can be necessary.
Rarely necessary though
I think if you're trying to alert the value of the button clicked, you can just give each button a class name like "digit" and do:
$('.digit').on('click', function() {
  alert($(this).val())
});
Dan Lafferty
@DanLaff
Jan 25 2018 21:55
@KUBIX90 In HTML, the value of your ID attribute needs to be unique. Change id='status' in your JS to class='status' and modify your JS to use .status instead of #status
That will get the text showing up, but you'll still need to work out why it says "offline" for everyone
Anders Nicolai Magnussen
@andersnicolaimagnussen
Jan 25 2018 21:56

so this would actually be considered better practice than having the btn on click on the HTML elements itself, that is intereseting.
And you are saying one of the reasons is because you want to have organised code, and keep the javascript /jquery seperated from the html.. .

Do you know why I cant access the function called tall from the click function here.

If you want an have time, I can share the code I had before with jquery and onclick, so maybe you can look over it and tell me the best way to implement what I want with Jquery?

Everything was working fine before, but the teacher has a test in python that checks for jquery and not just javascript as I have understood it.

Dan Lafferty
@DanLaff
Jan 25 2018 21:58
@nicolaimagnussen Maybe you're trying to do this?
function functionOne() {

  function functionA() {
    // do something
  }

  function functionB() {
    // do something else
  }

  functionA(); // this will work fine
}

functionA(); // doesn't run because you can't call a function inside another function out here
From a quick look at your code - you may want to review Immediately Invoked Function Expressions (IIFE) and Function Scope in JavaScript. It's the same concept in jQuery, just slightly different syntax.
Mark Kubik
@KUBIX90
Jan 25 2018 22:02
@DanLaff Thanks, got that bit working at least, my border shadow seems to work fine in showing the channels as offline/online, will have a look as to why its showing the same text throughout
CamperBot
@camperbot
Jan 25 2018 22:02
kubix90 sends brownie points to @danlaff :sparkles: :thumbsup: :sparkles:
api offline
Alan M.
@Am3ra
Jan 25 2018 22:04
Hey all,
can anyone help me?
cant figure out why the regex maybe isnt working, or the filter function
Anders Nicolai Magnussen
@andersnicolaimagnussen
Jan 25 2018 22:05

@DanLaff here you can see how I have done it until now.

https://codepen.io/nicolaimagnussen/pen/aEgrrB

I can see the calculator is not perfect, but I am just wondering how I can start changing the stuff to jquery, and change up the click events on the buttons

the code pen you sent me makes sense, using a for loop to iterate trough the buttons. That was smart.

But what if you would like to send in a value, for example if the user click on 7, like the way I have done it here.

        <button onclick="tall(7)" value="7" class="btn btn-primary" id="seven">7</button>

```

Dan Lafferty
@DanLaff
Jan 25 2018 22:07
@nicolaimagnussen It's a good start. You are using jQuery. You don't need to use jQuery function syntax too, I would guess, but I haven't seen what your teacher is asking.
If you can alert the value "7", you can use .html() or .text() to update an element's content with that value
You may want to keep things in english if you can - brukerTall = userButton :)
Anders Nicolai Magnussen
@andersnicolaimagnussen
Jan 25 2018 22:09
Okey, I am really new to the javascript world and the Jquery world. I don'r really know if he is directly testing if we are using jquery instead of javascript, but I would think so.
Yes, you can try the calculator, that works, but I am wondering how I would do it with a click function instead.
I would then need a lot of click functions, and that would look messy in my opinion. But it would look nice with a for loop as in your example though.
But how could I then pass in the values like, 5, 6, 7 and so on depending on which button the user clicks on. Thanks for your time @DanLaff :)
CamperBot
@camperbot
Jan 25 2018 22:09
nicolaimagnussen sends brownie points to @danlaff :sparkles: :thumbsup: :sparkles:
api offline
Dan Lafferty
@DanLaff
Jan 25 2018 22:10
It will make it easier to get help here when your code gets more complicated
Anders Nicolai Magnussen
@andersnicolaimagnussen
Jan 25 2018 22:10
Yes, good tip. I will change that right away
Aditya
@ezioda004
Jan 25 2018 22:10
@KUBIX90 This should work
if(val.stream === null){
                    $("#" + username).css("box-shadow", "5px 0px 10px red");
                    $("#" + username + ">p").text("Offline")
                                .css("color","red");
                } else {$("#" + username).css("box-shadow", "5px 0px 10px green");
                        $("#" + username + ">p").text("Online")
                                    .css("color","green");
                        }
Easier to select this way without modifying any other parts.
Mark Kubik
@KUBIX90
Jan 25 2018 22:18
@ezioda004 Thanks that works perfectly, but I'm not 100% understanding why?
CamperBot
@camperbot
Jan 25 2018 22:18
kubix90 sends brownie points to @ezioda004 :sparkles: :thumbsup: :sparkles:
:cookie: 415 | @ezioda004 |http://www.freecodecamp.org/ezioda004
Mark Kubik
@KUBIX90
Jan 25 2018 22:19
@ezioda004 Why the ">p"?
Dan Lafferty
@DanLaff
Jan 25 2018 22:21
@KUBIX90 It selects all the <p> elements in the #username div https://www.w3schools.com/cssref/css_selectors.asp
Could be troublesome if you add more <p> elements - but goes to show, there are lots of ways to select an element :)
Aditya
@ezioda004
Jan 25 2018 22:22
@KUBIX90 With your previous code, you were overwriting the #status since it only selects one. The >p selects child of $("#" + username).
Mark Kubik
@KUBIX90
Jan 25 2018 22:23
@DanLaff @ezioda004 Ahh I see thanks for the help both, the fact it was being used in a jQuery context threw me off, I've only ever used it in my CSS file.
CamperBot
@camperbot
Jan 25 2018 22:23
kubix90 sends brownie points to @danlaff and @ezioda004 :sparkles: :thumbsup: :sparkles:
api offline
api offline
Kaleb.sh
@porowns
Jan 25 2018 22:24

Hi, got a somewhat weird question.

I have a button with and onclick effect, and I'm trying to build up the url of the onclick based on previous button presses, but not really sure how.

Example

<button class=onclick="location.href='https://test.com/{{VARIABLE}}'">
</button>

I'd like to set {{VARIABLE}} using javascript (from a previous onclick()), but not exactly sure how I'd do that. I was thinking about putting like a div and then replacing the value using javascript, but I feel that the '' will negate the div.

Anders Nicolai Magnussen
@andersnicolaimagnussen
Jan 25 2018 22:26

Okey, I have fixed a little bit more here now.

https://codepen.io/nicolaimagnussen/pen/aEgrrB

So how can I change all this code to click functions instead?

Daniel Feldman
@Feldbot
Jan 25 2018 22:31
I'm having some troubles with this algorithm challenge. I'm getting 3/5 test cases to evaluate okay, but the ones that say, for example, addTogether(2)(3) should return 5. aren't passing. I'm guessing that they mean the 3 is the function factory argument that is passed in in the code, but I'm not sure. You can't call a function with two arguments like they are suggesting that I know of. I'm just not quite getting why these don't pass. Any thoughts?

function addTogether(num1, num2) {

  var add3 = makeAdder([3]);
  var sum;
  var number = true;

  // Function to test if arguments are numbers
  function numTest(args) {
    for (var prop in args) {
      console.log(args[prop]);
      if (typeof args[prop] !== 'number' || Array.isArray(args)) {
        number = false;
      }
    }    
  }

  // 1 argument case
  if (arguments.length === 1) {
    numTest(arguments);
    if (number === false) {
      return undefined;
    } 
    return (add3(2));
  }

  // 2 arguments case
  if (arguments.length > 1) {
    numTest(arguments);
    if (number === false) {
      return undefined;
    } 
    sum = num1 + num2;
    return sum;  
  }

  // makeAdder function
  function makeAdder(x) {
    return function(y) {
      numTest(x);
      if (number === false) {
        return undefined;
      }

      return x + y;
    };
  }
}

addTogether(2);
Kaz Baig
@kbaig
Jan 25 2018 22:37
@Feldbot You just need to simplify it so that you have a case for arguments.length being either 1 or 2
if 1, return a function. Your makeAdder looks right to me without the if statement
If 2, return sum of the two args
You have all the components here already
Darren
@DarrenfJ
Jan 25 2018 22:39

@kbaig hey buddy thanks for the larfs ;)

But we gotta have semantic markup :clap:

CamperBot
@camperbot
Jan 25 2018 22:39
darrenfj sends brownie points to @kbaig :sparkles: :thumbsup: :sparkles:
:cookie: 557 | @kbaig |http://www.freecodecamp.org/kbaig
pragya1248
@pragya1248
Jan 25 2018 22:39
hey! finally i completed my homepage .Here is my url:https://codepen.io/pragyapriya/pen/mpZZEz?editors=1100
Kaz Baig
@kbaig
Jan 25 2018 22:40
@Feldbot but also add a check in the beginning to make sure your args are numbers, otherwise throw an error
pragya1248
@pragya1248
Jan 25 2018 22:40
Any suggestion to make it more attractive
Kaz Baig
@kbaig
Jan 25 2018 22:40
@DarrenfJ ;)
Aditya
@ezioda004
Jan 25 2018 22:44
@pragya1248 Maybe have the "newsletter" div fixed to the bottom right of the page? It blocks some of the text while scrolling
pragya1248
@pragya1248
Jan 25 2018 22:46
ok thanks +1:
Anders Nicolai Magnussen
@andersnicolaimagnussen
Jan 25 2018 22:47

@DanLaff

Thanks Dan, Now I understood what you mean with your code example.

You mean something like this

https://codepen.io/nicolaimagnussen/pen/aEgrrB

I agree with you, this is much better and much cleaner in my opinion as well, thanks for showing me that!! ;)

CamperBot
@camperbot
Jan 25 2018 22:47
api offline
nicolaimagnussen sends brownie points to @danlaff :sparkles: :thumbsup: :sparkles:
pragya1248
@pragya1248
Jan 25 2018 22:47
:)
Daniel Feldman
@Feldbot
Jan 25 2018 22:47
@kbaig The hints suggested to make a function to check for argument numbers. I started out more simply like what you suggested, but it got more complex due to needing to check the argument on the makeAdder function. What you suggested is pretty much what is already there in terms of checking for argument length. I just am not sure why it isn't passing and why the test cases say addTogether(2)(3)... it is choking on both those where there is a function call with multiple arguments. I don't even know why they are suggesting that syntax.
Anders Nicolai Magnussen
@andersnicolaimagnussen
Jan 25 2018 22:48
@pragya1248 Cool that you have build your first website, it can need some visual approves, but great achievement.
Try checking out bootstrap or CSS grid and flex box
Aditya
@ezioda004
Jan 25 2018 22:50
@pragya1248 Its giving early 2000 vibe, css can be improved.
Daniel Feldman
@Feldbot
Jan 25 2018 22:57
@pragya1248 Nice work! Some design suggestions that could make it more user-friendly:
  • It is hard to scan the content since the type is virtually all the same size. Try just using the browser defaults for heading levels (h1, h2, h3, etc.) to get an idea of how those create a flow on their own. You may have to look at your content to see how to arrange it by title, subtitle, etc. This will really help things pop and make it easy to scan to see what the page is about.
    • Perhaps look at some templates to get an idea of how to arrange content. Right now everything is 100% wide, which makes it hard to read and scan. If you divide these content areas into smaller width blocks it will be easier to read, and perhaps have a more interesting design.
    • Some of the type is hard to read since the background competes with the text. Maybe use some opacity on the images, or change text colors to be more legible.
Stephen James
@sjames1958gm
Jan 25 2018 22:59
@Feldbot your makeAdder function does need to have the argument check.
But you need to call makeAdder with arguments[0] or with num1 as you have that as your first parameter
@Feldbot addTogether(2)(3) should result is addTogether returning a function closed over the value 2 ( basically, makeAdder(2)) then it will call that function with (3)
Daniel Feldman
@Feldbot
Jan 25 2018 23:07
@sjames1958gm The makeAdder(x) function does run the numTest function with x passed in, which is the equivalent to the 3 in the makeAdder(3) function. So it does check over that. I wonder why they didn't have their test case say addTogether(2) since the rest of the function tests for (3). It is really confusing to say addTogether(2)(3).
Stephen James
@sjames1958gm
Jan 25 2018 23:09
You need to call makeAdder with num1 not [3] or 3 - and that function shouild test for the value y not x in the case of
addTogether(2)(3) x is 2 and y is 3
Bjorn van de Peut
@bjorno43
Jan 25 2018 23:12
@Feldbot Also, please use Codepen or Pastebin when posting large walls of code like that. It could be considdered spamming :)
Daniel Feldman
@Feldbot
Jan 25 2018 23:13
@bjorno43 Thanks for the tip.
CamperBot
@camperbot
Jan 25 2018 23:13
feldbot sends brownie points to @bjorno43 :sparkles: :thumbsup: :sparkles:
:cookie: 217 | @bjorno43 |http://www.freecodecamp.org/bjorno43
Daniel Feldman
@Feldbot
Jan 25 2018 23:23
@sjames1958gm Not sure I understand your suggestion. The challenge mentioned checking all the arguments. I thought this meant not only the num1, num2 arguments, but also the argument passed in to make adder (this would be the third argument, x, equal to three 3). So the function I have set up to test checks for num1, and num2, and then lastly checks x as the third argument in the make adder function. So that one checks for what you are calling y or 3.
nsonhouse
@nsonhouse
Jan 25 2018 23:24
Can any one help with filtering a background image?
Stephen James
@sjames1958gm
Jan 25 2018 23:24
@Feldbot No the value passed to the function returned from makeAdder is not passed to addTogether.
addTogether(2)(3) is a call to addTogether with only (2)
the (3) is passed to the function returned from addTogether and that function would be in your case makeAdder(num1)

The result of addTogether(2) should be

function (y) {
   numTest(y);
   // if statement
   y + 2
}

The 2 coming from makeAdder(num1);

nsonhouse
@nsonhouse
Jan 25 2018 23:29
Need help with filtering . Any takers?
Stephen James
@sjames1958gm
Jan 25 2018 23:32
Not sure what you mean by filtering a background image?
@sjames1958gm I am trying to filter the background image with a blur or an opacity. But when I apply the filter to the body in the css file, the image does not change.
@sjames1958gm The div with the text and buttons change, but not the background image.
Stephen James
@sjames1958gm
Jan 25 2018 23:37
I think you can filter only foreground elements.
Kaz Baig
@kbaig
Jan 25 2018 23:54
I just discovered that Wix uses React. For example: http://www.mayhemracemanagement.com/cactusclassic
Stephen James
@sjames1958gm
Jan 25 2018 23:55
@kbaig interesting
Daniel Feldman
@Feldbot
Jan 25 2018 23:57
@sjames1958gm Thanks for the help. Something is getting lost in translation on my part unfortunately. At this point I think it may be better to just look at the answers and see what is going on. I'm about 100 hours into the intermediate algorithms, so I'm not feeling tooooo bad about that ;-)
CamperBot
@camperbot
Jan 25 2018 23:57
feldbot sends brownie points to @sjames1958gm :sparkles: :thumbsup: :sparkles:
:star2: 8899 | @sjames1958gm |http://www.freecodecamp.org/sjames1958gm