These are chat archives for FreeCodeCamp/HelpFrontEnd

23rd
Jan 2018
Jeff Lung YK
@jefflung
Jan 23 2018 02:46
hi, does anyone know Greensock gsap? If I want to learn it well working with React, any suggestion?
TwistedPerspective
@TwistedPerspective
Jan 23 2018 03:01
Hi, I'm trying to make the first website - portfolio - but got stuck with the menu. It simply won't stretch full screen no matter what I do with it on bigger screen sizes. Can anyone help me with that?
Eric Weiss
@eweiss17
Jan 23 2018 03:05
post it
Ken Haduch
@khaduch
Jan 23 2018 03:06
@TwistedPerspective - please post your project URL
@TwistedPerspective - if you have your menu bar inside of a container class div (if using bootstrap) then it will not stretch across the page because the container class puts margins on each side of the page. (I think that it actually limits the max-width of the center area of the page, but it doesn't stretch across the page.)
Ghost
@ghost~580ed9c0d73408ce4f309ef0
Jan 23 2018 03:16
Hello world
I need help on my first project
Tribute pa
Page
Eric Weiss
@eweiss17
Jan 23 2018 03:17
what is your problem, post it here
Ghost
@ghost~580ed9c0d73408ce4f309ef0
Jan 23 2018 03:17
I want to get started
Hii Eric
I need to understand the base which I need to make
Eric Weiss
@eweiss17
Jan 23 2018 03:18
Okay well, you use html and css, which you should have been doing lessons on
Ghost
@ghost~580ed9c0d73408ce4f309ef0
Jan 23 2018 03:19
Right,
Eric Weiss
@eweiss17
Jan 23 2018 03:19
A lot of people use bootstrap for their projects, you do not have to, but it makes things easier
Ghost
@ghost~580ed9c0d73408ce4f309ef0
Jan 23 2018 03:19
But I want to set page background
For then I goona make pages
If you the refer
Rence
Eric Weiss
@eweiss17
Jan 23 2018 03:21
you want a background image?
Ghost
@ghost~580ed9c0d73408ce4f309ef0
Jan 23 2018 03:21
A background color
with body CSS
With this we goons
Goona make page
Clean from pa
Adding and margin
Or use it as default
I think I need to make responsive as well
To ma
Make tribute looks good
But I am looking whom I am goona make it
Do you have idea on that?
Eric Weiss
@eweiss17
Jan 23 2018 03:26
you can pick anyone, it doesn't matter
choose a leader from your country or something
Ghost
@ghost~580ed9c0d73408ce4f309ef0
Jan 23 2018 03:28
OK let's google it
Eric are you ther
E??
I got it.
I also need to design timeline for my favorite leader
Eric Weiss
@eweiss17
Jan 23 2018 03:42
Thats part of the process, i can help when u get stuck, but I won't do it for you?
Ghost
@ghost~580ed9c0d73408ce4f309ef0
Jan 23 2018 03:44
I don't think of that
I know and I goona do it
I have one question??
Eric Weiss
@eweiss17
Jan 23 2018 03:46
what
Ghost
@ghost~580ed9c0d73408ce4f309ef0
Jan 23 2018 03:47
Does you ever work with open source
??
Eric Weiss
@eweiss17
Jan 23 2018 03:52
no
i'v used open sourced but never contributed to one
Rishabh Gupta
@RishabhGupta22
Jan 23 2018 05:18

Need Help!
the Reset button is not working properly. it does not stop the time counter. i have made it in such a way that when u press the start button it disables the start button until the time session is completed or you press the reset button. but,when you again press the start button after hitting reset, the countdown becomes faster .
Pls Help. thanks in advance!

https://codepen.io/rishabhgupta/full/YYgJaR

Tom
@moT01
Jan 23 2018 05:23
clear the interval you created when you hit start
Roman Struna
@RomchyFCC
Jan 23 2018 05:43
greetings, i've started learning sass and it has severely slowed down my workflow due to not being properly implemented in my text editor: sublime text 3, does anyone know any good packages, the one i'm currently using is....well, it's shit tbh, any help is appreciated
HappyMeerkat
@HappyMeerkat
Jan 23 2018 05:44
hey i have a question i'm working my way through FCC and i'm doing Java, i got to the challenges and decided i would try to codecademy to help my learning, and i think it is helping, but i have a question. in FCC when using variables ive just used var but on codecademy they use const and let. obviously when using codecademy i have to use let and const to pass their criteria but what is best practice?
Rishabh Gupta
@RishabhGupta22
Jan 23 2018 05:45
@moT01 actually it is fully working now. : )
had to make two variables global and then had to use them to clear the intervals in the reset function
Roman Struna
@RomchyFCC
Jan 23 2018 05:45

@HappyMeerkat let = var, const = var only that const can't be changed, also free codecademy isn't really that good,
The difference is scoping. var is scoped to the nearest function block and let is scoped to the nearest enclosing block, which can be smaller than a function block. Both are global if outside any block.

Also, variables declared with let are not accessible before they are declared in their enclosing block. As seen in the demo, this will throw a ReferenceError exception.

HappyMeerkat
@HappyMeerkat
Jan 23 2018 05:47
@RomchyFCC what would you suggest? i've done the FCC waypoints multiple times and i'm looking for something to help me progress my learning to help with the challenges etc
Naris R
@KittenHero
Jan 23 2018 05:47
let and const exists only in the scope they were declared, available from ES6 forward
var is scoped at the function level and are hoisted
Roman Struna
@RomchyFCC
Jan 23 2018 05:49
@HappyMeerkat depends what you have trouble with
HappyMeerkat
@HappyMeerkat
Jan 23 2018 05:49
on codecademy i have to say i'm finding iterators very hard to get my head round some of the code
and tbh i have trouble with most things javascript/coding in general haha
Roman Struna
@RomchyFCC
Jan 23 2018 05:50
then you need a solid foundation first
have you heard about p1xt guides
HappyMeerkat
@HappyMeerkat
Jan 23 2018 05:50
nope
Roman Struna
@RomchyFCC
Jan 23 2018 05:50
ok so, p1xt created a guide that as fast as possible explains the gists of programing
a good start would be a cs50 course
it would be off track from what you are currently doing but would enhance your understanding with a good foundation
the class is built for complete beginners
it helped me
but it also took 3 months to do
HappyMeerkat
@HappyMeerkat
Jan 23 2018 05:52
let words = ['chair', 'music', 'pillow', 'brick', 'pen', 'door']; 

let shortWords = words.filter(function(word) {
  return word.length < 6;
});

let numbers = [1, 2, 3, 4, 5]; 

let bigNumbers = numbers.map(function(number) {
  return number * 10;
});

let groceries = ['whole wheat flour', 'brown sugar', 'salt', 'cranberries', 'walnuts']; 

groceries.forEach(function(groceryItem) {
  console.log(' - ' + groceryItem);
});
on these example of iterators what i don't quite understand is the function bit it has "word, groceryItem and number and i don't know where that comes from
Roman Struna
@RomchyFCC
Jan 23 2018 05:52
i could provide you with a link but do not wish to overwhelm you
HappyMeerkat
@HappyMeerkat
Jan 23 2018 05:52
sorry was writing that as you were writign
i'm about to read now
i would like the link please
if it really helps and is aimed at beginners i think
thats probably what i need
if it has more explanation in it
but be warn this is not javascript, not at the start
and you work in an IDE
also more helpful guides here
HappyMeerkat
@HappyMeerkat
Jan 23 2018 05:55
so just to be clear p1xt is something different as well?
Roman Struna
@RomchyFCC
Jan 23 2018 05:55
oh and the function
groceryItem is the variable the function uses for it's input
p1xt just realeased guides, the cs50 course i linked you is built for C language
you most likely will not use it in your career
but it will make you understand programing on basic level
if you don't have the time to do the whole course you don't have to, but watch the lectures, they are very high quality
HappyMeerkat
@HappyMeerkat
Jan 23 2018 05:58
i think i will do that, you said it took you 3 months? how much time per week would you say you put into it?
i'm registering now actually
as i need a good foundation
Roman Struna
@RomchyFCC
Jan 23 2018 05:59
around 6-10 hours a week but sometimes 16 hours per weekend
i had a full time job at the time and 2 hours commute so it was hard to do more
HappyMeerkat
@HappyMeerkat
Jan 23 2018 05:59
i have to say having the github page i don't know where to start with the p1xt guides
ah i've just scrolled down
Roman Struna
@RomchyFCC
Jan 23 2018 06:00
go through it slowly, it's all well writen so you can't get lost
HappyMeerkat
@HappyMeerkat
Jan 23 2018 06:00
and theres more info than just the files
Roman Struna
@RomchyFCC
Jan 23 2018 06:00
exactly
HappyMeerkat
@HappyMeerkat
Jan 23 2018 06:01
thank you i'm registerign to the cs50 and i'll also give the p1xt stuff a look. thank you so much @RomchyFCC this could be exactly what i've been searching for
CamperBot
@camperbot
Jan 23 2018 06:01
happymeerkat sends brownie points to @romchyfcc :sparkles: :thumbsup: :sparkles:
:cookie: 265 | @romchyfcc |http://www.freecodecamp.org/romchyfcc
Roman Struna
@RomchyFCC
Jan 23 2018 06:02
np, good luck
ahmed-issa-mohd
@ahmed-issa-mohd
Jan 23 2018 07:56
What is the param element , can anyone help me please ?
Markus Kiili
@Masd925
Jan 23 2018 07:56
@ahmed-issa-mohd You need to explain it more. Maybe post some code also.
ahmed-issa-mohd
@ahmed-issa-mohd
Jan 23 2018 08:06
image.png
Markus Kiili
@Masd925
Jan 23 2018 08:08
ahmed-issa-mohd
@ahmed-issa-mohd
Jan 23 2018 08:10
I saw them, but I did not know yet
ogwel5
@ogwel5
Jan 23 2018 08:59
i have a proble in jquery. need help
m
linkin-park
@linkin-park
Jan 23 2018 09:23
hi
Fernando
@lestairon
Jan 23 2018 09:24
Hi
linkin-park
@linkin-park
Jan 23 2018 09:26
bye
Fernando
@lestairon
Jan 23 2018 09:27
kk
Simon Cordova
@gbsimon87
Jan 23 2018 09:32

Good morning!
Was wondering if anybody had any idea how to implement a snap scroll effect on a banner?
ex: https://bet.coral.co.uk/#/ (in mobile view)

As you can see, the banner images are scrollable and 'snap' to the div

linkin-park
@linkin-park
Jan 23 2018 09:45
how would it work @gbsimon87
its a magic :0
its similar to pagination but its not i feel it.
Simon Cordova
@gbsimon87
Jan 23 2018 09:53
No idea how it works, thats what I'm trying to figure out!
haha
Fernando
@lestairon
Jan 23 2018 10:13
Hm
linkin-park
@linkin-park
Jan 23 2018 10:35
tbh
its just variaion in x
S7eve
@S7eve
Jan 23 2018 11:04
<div class="messageContent">
    <article>
        <blockquote class="messageText SelectQuoteContainer ugc baseHtml">        
            <div class="bbCodeBlock bbCodeQuote" data-author="rostrum1">
                <aside>                
                    <div class="attribution type">rostrum1 said:                        
                        <a href="goto/post?id=8599083#post-8599083" class="AttributionLink">↑</a>                        
                    </div>                
                    <blockquote class="quoteContainer">
                        <div class="quote">
                            This is the text inside quote and I dont want this
                        </div>
                    </blockquote>
                </aside>
            </div>
                I want to get this text but its inside the blockquote :(
                <div class="messageTextEndMarker">&nbsp;</div>
        </blockquote>
    </article>
</div>
does anyone know how to select the "I want to get this text but its inside the blockquote" text from the html above using the selector?
I tried to use :not() selector jquery but its not working
S7eve
@S7eve
Jan 23 2018 11:19
any help will be appreciated
Stephen James
@sjames1958gm
Jan 23 2018 11:20
@S7eve Assuming you cannot reformat this html?
S7eve
@S7eve
Jan 23 2018 11:21
yes
have been debuggin this for hour...if the "I want to get this text..." text are encapsulated with any tags (div, p or whatever) it will not be a problem since we can directly target it using css selector
the problem is its not :(
Fernando
@lestairon
Jan 23 2018 11:27
I'm curretly working on the Random quote machine
But when i try to share a quote that has a ";" it gets cut like this
Stephen James
@sjames1958gm
Jan 23 2018 11:29
@S7eve Well mixing text and HTML inside the blockquote makes it difficult.
This is ugly because of the "2" which was trial and error
let e = document.querySelector(".messageText");
console.log(e.childNodes[2].textContent);
Fernando
@lestairon
Jan 23 2018 11:30
image.png
That's the tweet screenshot when i try to share this quote "The beginning of wisdom is found in doubting; by doubting we come to the question, and by seeking we may come upon the truth."
Stephen James
@sjames1958gm
Jan 23 2018 11:32
@lestairon How are you sharing it?
Fernando
@lestairon
Jan 23 2018 11:33
@sjames1958gm https://codepen.io/Lestairon/pen/ayraQg look at it
Also i should make it responsive...
Stephen James
@sjames1958gm
Jan 23 2018 11:39
@lestairon Because you are putting the quote into a URI you should call encodeURIComponent
$(this).attr("href", "https://twitter.com/intent/tweet?text=" + encodeURIComponent(quote));
Markus Kiili
@Masd925
Jan 23 2018 11:41
@S7eve WIth JS, you could do:
var bq = document.querySelector("article>blockquote");
var childNodes = bq.childNodes;
childNodes.forEach(function(node){
    if (node.nodeType===document.TEXT_NODE && node.nodeValue.trim()!=="") console.log(node.nodeValue);
});
Stephen James
@sjames1958gm
Jan 23 2018 11:42
@Masd925 :+1:
Markus Kiili
@Masd925
Jan 23 2018 11:44
@sjames1958gm How the mind rests when fiddling with automatically generated empty text nodes...
Fernando
@lestairon
Jan 23 2018 11:47
@sjames1958gm Thanks, i was thinking about making an if statement that replaces the ";" into "%3B"
CamperBot
@camperbot
Jan 23 2018 11:47
lestairon sends brownie points to @sjames1958gm :sparkles: :thumbsup: :sparkles:
:star2: 8882 | @sjames1958gm |http://www.freecodecamp.org/sjames1958gm
Stephen James
@sjames1958gm
Jan 23 2018 11:48
@Masd925 lol
I didn't know that textContent included all the children until I started playing with it.
@lestairon :+1:
S7eve
@S7eve
Jan 23 2018 11:59
@sjames1958gm yes Im aware of it but its not my web...I only trying to get the data from the web which has those structures... is it possible to do it using css selector?
@Masd925 how bout CSS ? is it possible?
Stephen James
@sjames1958gm
Jan 23 2018 12:00
@S7eve I don't believe that you can get to that specific text with just a selector, but I could be wrong.
S7eve
@S7eve
Jan 23 2018 12:01
@sjames1958gm I tried to do it for hours alrd now...no result :( was hoping someone here could help :(
Markus Kiili
@Masd925
Jan 23 2018 12:03
@S7eve I think that the way is something like what I posted above.
S7eve
@S7eve
Jan 23 2018 12:33
is it possible that we add REGEX into css selector?
S7eve
@S7eve
Jan 23 2018 12:47
@linkin-park thx
CamperBot
@camperbot
Jan 23 2018 12:47
s7eve sends brownie points to @linkin-park :sparkles: :thumbsup: :sparkles:
:cookie: 45 | @linkin-park |http://www.freecodecamp.org/linkin-park
ivanprosicq
@ivanprosicq
Jan 23 2018 12:51
Hello all :)
I have a little array problem which I could use some help for
Markus Kiili
@Masd925
Jan 23 2018 12:54
@ivanprosicq Just post the question and relevant code here.
ivanprosicq
@ivanprosicq
Jan 23 2018 12:58

This is what I need:

    var table = [
      [0, 1,  2,  3,  4,  5],
      [1, 1,  2,  3,  4,  5],
      [2, 2,  4,  6,  8, 10],
      [3, 3,  6,  9, 12, 15],
      [4, 4,  8, 12, 16, 20],
      [5, 5, 10, 15, 20, 25]
    ];

This is my current result (in console):

0 1 2 3 4 5 
1 1 2 3 4 5 
2 2 4 6 8 10 
3 3 6 9 12 15 
4 4 8 12 16 20 
5 5 10 15 20 25

You can see it here if you want:
https://imgur.com/a/ExLil

This is my current code:

var MultiplicationTable = function () {
  'use strict';

  function generate5() {
    var array = [];

    var result = '0 ';
    for (var i = 0; i < 6; i++) {

        for (var j = 0; j < 6; j++) {

            if(i == 0 && j > 0){
              result += j + ' ';
            } 
            else if(j == 0 && i>0){
              result += i + ' ';
            } 
            else if(i>0 && j>0){
            result += (i*j) + ' ';
            }
        }
        result += '\n'
    }

    console.log(result);
    return result;


  }

The main problem is how do I implement the numbers in the array

I tried switching the result with array and I removed the ' ' and the \n. Unfortunately it didn't work still. The current version let's me see how it looks.
Pieter Stokkink
@forkerino
Jan 23 2018 13:02
@ivanprosicq you can use a single for loop and push a subarray onto the result-array
at least from the second row onwards
the header row might need to be hardcoded
Markus Kiili
@Masd925
Jan 23 2018 13:03
@forkerino Yo.
Pieter Stokkink
@forkerino
Jan 23 2018 13:04
@Masd925 Hey! How's the knee?
Markus Kiili
@Masd925
Jan 23 2018 13:06
@forkerino Not too bad. Maybe it was just a warning noise to not do all the things that 20 year old's do.
ivanprosicq
@ivanprosicq
Jan 23 2018 13:06
@forkerino That didn't work, I get the entire result like this: ["0123451123452246810336912154481216205510152025"]
You can check it here:
https://imgur.com/a/9uy1u
This is the updated code with your suggestion:
    var array = [];

    var result = '0';
    for (var i = 0; i < 6; i++) {

        for (var j = 0; j < 6; j++) {

            if(i == 0 && j > 0){
              result += j;
            } 
            else if(j == 0 && i>0){
              result += i;
            } 
            else if(i>0 && j>0){
            result += (i*j);
            }
        }
    }
    array.push(result);

    console.log(array);
    return array;
Pieter Stokkink
@forkerino
Jan 23 2018 13:08
@ivanprosicq I meant something like array.push([i, 1 * i, 2* i, ....]) inside the outer for. No need to create a string.
when you initialize array like var array = [[0,1,2,3,4,5]]
@Masd925 Good to hear!
Markus Kiili
@Masd925
Jan 23 2018 13:12
@forkerino Bad thing if I used all those hours fine-tuning the Panda guard, and never get to use it in competition (I will only use it in competitions so nobody can prepare for it!).
Markus Kiili
@Masd925
Jan 23 2018 13:18
@forkerino The main goal from it is a submission that is a combined strangle, neck crank, elbow lock, and it also pulls the shoulder from the socket. The opponent is also forced to sniff your toes. I will post a video when I nail it the first time.
Pieter Stokkink
@forkerino
Jan 23 2018 13:22
hahahaha
sounds complex
alpox
@alpox
Jan 23 2018 13:28
@Masd925 I read only your last message. Without context. That sounds pretty much like a case for psychiatria
Markus Kiili
@Masd925
Jan 23 2018 13:33
@alpox It sure does.
pocahontas123
@pocahontas123
Jan 23 2018 14:52
Hi, can some one help me with flex ?
Tom
@moT01
Jan 23 2018 14:54
@pocahontas123
whats the problem
Mihai Ionuț Verniceanu
@ferdyonline
Jan 23 2018 14:58

Hello. I am currently trying to fetch data from this last.fm link - http://ws.audioscrobbler.com/2.0/?method=album.getinfo&api_key=c1e5c413b051cf15f1275da237f4a399&artist=Cher&album=Believe&format=json - and I cannot render it properly in my React component.

For example, I cannot access the image array in the object, as it returns undefined. Can someone help me?

the other object properties work when called in render, but the arrays don't.
Tom
@moT01
Jan 23 2018 15:00
are you properly targeting the stuff
Mihai Ionuț Verniceanu
@ferdyonline
Jan 23 2018 15:01
Yes, but it returns undefined. I can access album.name for instance.
Tom
@moT01
Jan 23 2018 15:02
well, thats what it sounds like
pocahontas123
@pocahontas123
Jan 23 2018 15:02
@moT01 Are you still there?
Tom
@moT01
Jan 23 2018 15:02
album.image[0]['#text']
maybe it's that #
album.image[0].size
pocahontas123
@pocahontas123
Jan 23 2018 15:03
@moT01 i'm using grid for the general container and flexbox for inside containers. But my flex text cause me issue. Everything is on the same line :/
Mihai Ionuț Verniceanu
@ferdyonline
Jan 23 2018 15:03
TypeError: Cannot read property '0' of undefined
Stephen James
@sjames1958gm
Jan 23 2018 15:04
@ferdyonline Can you show the code that selects the image from the json?
json.album.image[0]["#text"]
Tom
@moT01
Jan 23 2018 15:04
got a pen? @pocahontas123
pocahontas123
@pocahontas123
Jan 23 2018 15:05
@moT01 Yes
Mihai Ionuț Verniceanu
@ferdyonline
Jan 23 2018 15:05

`
class Album extends Component {

state = {
album: {}
}

getAlbumInfo() {
return ${LastFM.base}method=${LastFM.getAlbumInfo}&api_key=${LastFM.key}&artist=${artist}&album=${album}&format=json;
};

componentDidMount() {
fetch(this.getAlbumInfo())
.then(resp => resp.json())
.then(resp => {
this.setState({
album: resp.album
});
});
}

render() {
return (
<div>
<h1>{this.state.album.name}</h1> // works
<h2>{this.state.album.url}</h2> // works
<h3>{this.state.album.image[0].size}</h3> // does not work
</div>
);

}
};

export default Album;
`

Mihai Ionuț Verniceanu
@ferdyonline
Jan 23 2018 15:05
Woops, sorry, I messed up the formatting.
Tom
@moT01
Jan 23 2018 15:06
@pocahontas123 what parts
pocahontas123
@pocahontas123
Jan 23 2018 15:06
@moT01 Everywhere (exemple "title"+"paragraph") it's inline
@moT01 i can do 1000 <p></p> and it stay on the same line
Stephen James
@sjames1958gm
Jan 23 2018 15:07
@ferdyonline You have to handle the case before the fetch returns.
On initial render there is no image array yet.
Mihai Ionuț Verniceanu
@ferdyonline
Jan 23 2018 15:08
And how can I do that, if you don't mind me asking?
Tom
@moT01
Jan 23 2018 15:09
@pocahontas123 perhaps wrapping the content within a div... so that div would have the flex stuff - and the rest would be normal...
.about = flex
  div
    h1
    p
pocahontas123
@pocahontas123
Jan 23 2018 15:09
@moT01 maybe :(
Tom
@moT01
Jan 23 2018 15:11
@pocahontas123 there's also the flex wrap property
so if you set something to 100% width and wrap to true - the next stuff would be on the next line
pocahontas123
@pocahontas123
Jan 23 2018 15:11
@moT01 Ok, but here i just want the rest to play like normal display
i will try out things, wil lsee
Tom
@moT01
Jan 23 2018 15:12
could scratch the flex - and just put a margin or padding on top
Stephen James
@sjames1958gm
Jan 23 2018 15:15
@ferdyonline Probably a state variable: perhaps, loaded initially false
when false don't try to render the album
upon loading set to true
@ferdyonline - you could add a renderAlbum function that renders the album (h1, h2, h3)
{ this.state.loaded ? this.renderAlbum() : "" }
Tom
@moT01
Jan 23 2018 15:21
strange that they all work but the array
Mihai Ionuț Verniceanu
@ferdyonline
Jan 23 2018 15:21
Yes, this is what I don't get
Tom
@moT01
Jan 23 2018 15:22
wonder if you did something like this..
this.setState({
album: JSON.parse(JSON.stringify(resp.album))
});
Stephen James
@sjames1958gm
Jan 23 2018 15:24
class Album extends Component {

  state = {
    album: {},
    loaded: false
  }

  getAlbumInfo() {
    return `${LastFM.base}method=${LastFM.getAlbumInfo}&api_key=${LastFM.key}&artist=${artist}&album=${album}&format=json`;
  };

  componentDidMount() {
    fetch(this.getAlbumInfo())
    .then(resp => resp.json())
    .then(resp => {
      this.setState({
        album: resp.album,
        loaded: true
      });
    });
  }

  renderAlbum() {
    return (
       <div>
          <h1>{this.state.album.name}</h1> // works
          <h2>{this.state.album.url}</h2> // works
          <h3>{this.state.album.image[0].size}</h3> // does not work
       </div>
   )}

  render() {
    return (
        <div>
           { this.state.loaded ? this.renderAlbum() : "" }
        </div>
   );
  }
};

export default Album;
`
@ferdyonline The reason the array gives an error is you are trying to index [0] on undefined. The others are simply undefined and ignored
Mihai Ionuț Verniceanu
@ferdyonline
Jan 23 2018 15:27
@sjames1958gm thank you so much!
CamperBot
@camperbot
Jan 23 2018 15:27
ferdyonline sends brownie points to @sjames1958gm :sparkles: :thumbsup: :sparkles:
:star2: 8883 | @sjames1958gm |http://www.freecodecamp.org/sjames1958gm
Stephen James
@sjames1958gm
Jan 23 2018 15:27
@ferdyonline :+1:
Mihai Ionuț Verniceanu
@ferdyonline
Jan 23 2018 15:28
it was driving me crazy already
Aryan J
@AryanJ-NYC
Jan 23 2018 15:28
Nice code @sjames1958gm. Here's another brownie point! thanks
CamperBot
@camperbot
Jan 23 2018 15:28
aryanj-nyc sends brownie points to @sjames1958gm :sparkles: :thumbsup: :sparkles:
:star2: 8884 | @sjames1958gm |http://www.freecodecamp.org/sjames1958gm
Stephen James
@sjames1958gm
Jan 23 2018 15:29
@ferdyonline Yeah, been there with the same problem
@AryanJ-NYC :) :+1:
Dimitris Nik.
@dimitrissnk
Jan 23 2018 15:39
Hello there, can anybody tell me why both of my website projects wont load properly on my mobile device? The sites are the following https://codepen.io/dimitris51/full/wpNNyK/ and https://codepen.io/dimitris51/full/xpMJvw/, in both the images wont load and the safe fonts aren't as they should be
Marianissimus
@Marianissimus
Jan 23 2018 15:40
@Dimitrios51 your fonts are declared only in vw, which make them unreadable at smaller viewpoints.
Dimitris Nik.
@dimitrissnk
Jan 23 2018 15:42
@Marianissimus what does that mean?
Marianissimus
@Marianissimus
Jan 23 2018 15:42
1vw of a small display is too little, that's what it means
its 1% of the viewpoint width; if the viewpoint is little, so is the font
use pixels, ems, or read a newer solution here: https://css-tricks.com/font-size-viewport-units/
Dimitris Nik.
@dimitrissnk
Jan 23 2018 15:45
@Marianissimus But if I use pixels how is it going to be the same on all screens on different resolutions?
And what about the images?
Marianissimus
@Marianissimus
Jan 23 2018 15:46
well, the font-size will be the same in pixels only....
Dimitris Nik.
@dimitrissnk
Jan 23 2018 15:47
I will build the website according to my screen, which is 29' with 4k resolution, how is going to be displayed on a normal person with a smaller screen at 1080p?
Marianissimus
@Marianissimus
Jan 23 2018 15:48
your problem is with the mobile design, which, of course, is smaller than 6 inches at 300dpi
can you copy paste a link to one of your images here?
Marianissimus
@Marianissimus
Jan 23 2018 15:50
@Dimitrios51 you can use the developer tools in google to test a site for different devices and sizes
Dimitris Nik.
@dimitrissnk
Jan 23 2018 15:50
@Marianissimus Yeah I have done that, I used an online tool and all good, but on other devices that I tried myself it didnt work
Marianissimus
@Marianissimus
Jan 23 2018 15:50
well, that image works. your other project doesnt have valid image links
you have some facebook links there, but not to the images themselves; i also dont know if you can link to facebook images via codepen
Dimitris Nik.
@dimitrissnk
Jan 23 2018 15:53
@Marianissimus but then how everything works perfectly on my desktop pc? O.o
1rjun
@1rjun
Jan 23 2018 15:53
<!DOCTYPE html>
<head>
    <title></title>
<script>
        var a,b;
    function sum(){
         a=parseInt(document.f1.n1.value);
         b=parseInt(document.f1.n2.value);
        var c=a+b;
        document.getElementById('add').value = c;
    }
    function sub(){
        a=parseInt(document.f1.n1.value);
        b=parseInt(document.f1.n2.value);
        var c=a-b;
        document.getElementById('sub').value = c;

    }
    function mul(){
        a=parseInt(document.f1.n1.value);
        b=parseInt(document.f1.n2.value);
        var c=a*b;
        document.getElementById('mul').value = c;
    }
    function div(){
        a=parseInt(document.f1.n1.value);
        b=parseInt(document.f1.n2.value);
        var c=a/b;
        document.getElementById('div').value = c;
    }
    </script>
</head>
    <body>
        <form name="f1">
        Enter no: <input type="text" name="n1"><br><br>
        Enter no: <input type="text" name="n2"><br><br>
        <table>
            <tr>
                <td> Result: </td>
                <td><input type="text" id="add"></td>
                <td><input type="text" id="sub"></td>
                <td><input type="text" id="mul"></td>
                <td><input type="text" id="div"></td>
            </tr>
            <tr align="center">
                <td></td>
                <td><input type="button" value="add" onclick="sum()"></td>
                <td><input type="button" value="sub" onclick="sub()"></td>
                <td><input type="button" value="mul" onclick="mul()"></td>
                <td><input type="button" value="div" onclick="div()"></td>
            </tr>
        </table>
    </form>
    </body>
    </html>
only add function is working here
help
Marianissimus
@Marianissimus
Jan 23 2018 15:54
@Dimitrios51 and regarding your fonts: use pixels, say, 16px. then learn about media queries and you'll solve the problem in a few lines of code
1rjun
@1rjun
Jan 23 2018 15:54
please help to identify my code
in which only sum function is working
pocahontas123
@pocahontas123
Jan 23 2018 16:06

Hi, some here here to give me a little help ?
My codepen:
https://codepen.io/pocahontas123/pen/ LevQje

And would like two things:
-make my text from my link don't break outside where it is supposed to be
-have it look like this:
https://www.noelshack.com/2018-04-2-1516723748-uploade.png
But i don't know how to make the text from my link in two lines...

Kaz Baig
@kbaig
Jan 23 2018 16:07
@1rjun they worked if I changed their names. My guess is that those function names are protected. If you look at the console, it says that function sub is not defined
Please have it in a pen next time!
Muna Mohamed
@mooneyd12
Jan 23 2018 16:16
Hi everyone, hope you are all doing well!
I'm currently doing the freecodecamp beta curriculum and I'm stuck on one of the challenges. I'm hoping someone can help
This is the question: We have defined a function, copyMachine which takes arr (an array) and num (a number) as arguments. The function is supposed to return a new array made up of num copies of arr. We have done most of the work for you, but it doesn't work quite right yet. Modify the function using spread syntax so that it works correctly (hint: another method we have already covered might come in handy here!).
And here's the code:

function copyMachine(arr, num) {
let newArr = [];
while (num >= 1) {
// change code below this line

newArr = [...arr]; // I added this part
// change code above this line
num--;

}
return newArr;
}

// change code here to test different cases:
console.log(copyMachine([true, false, true], 2));

I'm not sure how to return a new array made up of the number of copies of arr .
Thank you in advance!
Tom
@moT01
Jan 23 2018 16:22
use a for loop
Kaz Baig
@kbaig
Jan 23 2018 16:22
I think while is part of the execise
Tom
@moT01
Jan 23 2018 16:22
oh - didnt see that part
Kaz Baig
@kbaig
Jan 23 2018 16:23
I would guess they are looking for newArr = [...newArr, arr];
@moT01 exercise is looking for a spread syntax solution
Tom
@moT01
Jan 23 2018 16:24
havent used it much - cant do .push(...arr)?
Kaz Baig
@kbaig
Jan 23 2018 16:25
That would mean doing something like [].push(1, 2, 3)
Sweet Coding :)
@SweetCodingInc
Jan 23 2018 16:25
.push(...arr) sounds about right
Kaz Baig
@kbaig
Jan 23 2018 16:25
Which is not what they want
They want create an array with n subarrays arr
Sweet Coding :)
@SweetCodingInc
Jan 23 2018 16:26
then .push(arr)
Kaz Baig
@kbaig
Jan 23 2018 16:27
sure but they're looking for spread rather than push
pretty sure it's newArr = [...newArr, arr];
Sweet Coding :)
@SweetCodingInc
Jan 23 2018 16:27
well.. then .push([...arr])
function copyMachine(arr, num) {
  let newArr = [];
  while (num >= 1) {
    newArr.push([...arr]);
    num--;
  }
  return newArr;
}

console.log(copyMachine([true, false, true], 2));

or

function copyMachine(arr, num) {
  let newArr = [];
  while (num >= 1) {
    newArr.push(arr);
    num--;
  }
  return newArr;
}

console.log(copyMachine([true, false, true], 2));

or

function copyMachine(arr, num) {
  let newArr = [];
  while (num-- >= 1) {
    newArr.push(arr);
  }
  return newArr;
}

console.log(copyMachine([true, false, true], 2));
Roman Struna
@RomchyFCC
Jan 23 2018 17:57
greetings, i've started learning sass and it has severely slowed down my workflow due to not being properly implemented in my text editor: sublime text 3, does anyone know any good packages, the one i'm currently using is....well, it's shit tbh, any help is appreciated
Aryan J
@AryanJ-NYC
Jan 23 2018 18:12
Can I recommend VScode or are you married to Sublime?
Ken Haduch
@khaduch
Jan 23 2018 19:02
@RomchyFCC - this looks like an interesting article about sass in Sublime text 3 - http://sublimetexttips.com/how-to-add-sass-support-in-sublime-text/
Brad
@bradtaniguchi
Jan 23 2018 19:13
I gave up with using sublime for anything heavy, it was too difficult to setup any plugins or get any workflow going. It's still faster than the other stuff, but I just use it as a replacement for notepad++ on non-windows machines
Roman Struna
@RomchyFCC
Jan 23 2018 19:43
@khaduch much appreciated, i couldn't find that with googling for some reason, looks promising so thanks
CamperBot
@camperbot
Jan 23 2018 19:43
romchyfcc sends brownie points to @khaduch :sparkles: :thumbsup: :sparkles:
:star2: 3690 | @khaduch |http://www.freecodecamp.org/khaduch
pocahontas123
@pocahontas123
Jan 23 2018 20:49
Hi, does some one is free to help me out on my css ?
Tiago Correia
@tiagocorreiaalmeida
Jan 23 2018 21:03
@pocahontas123 sure
pocahontas123
@pocahontas123
Jan 23 2018 21:14
@tiagocorreiaalmeida hi i created a post on the fcc forum
Tiago Correia
@tiagocorreiaalmeida
Jan 23 2018 21:21
can you send me the link?
DarthRevan1488
@DarthRevan1488
Jan 23 2018 21:37
I know you get this question a lot but Is it better for me right now in 2018 to learn reactjs or vuejs
Thanks upfront for the answer
Brad
@bradtaniguchi
Jan 23 2018 21:40
@DarthRevan1488 depends if your looking for a job, or just for fun. React is the most popular front-end framework for the near future, then Google's Angular, then Vuejs. Vuejs is also community supported which is something to consider, as support could degrade over time slowly.
Hendrik W.
@sol-idsnake
Jan 23 2018 21:41
Aditya
@ezioda004
Jan 23 2018 21:42
Yeah, it depends on your location too, where I live theres more jobs for React > Angular > Vue.js
DarthRevan1488
@DarthRevan1488
Jan 23 2018 21:43
Thx @bradtaniguchi I am doing this for fun but I am planning in the long term to find a job
Brad
@bradtaniguchi
Jan 23 2018 21:43
I'd go with React, it's the safest bet out of the three due to its popularity
DarthRevan1488
@DarthRevan1488
Jan 23 2018 21:43
And if React is more popular it will have more resources
Yea thanks
Brad
@bradtaniguchi
Jan 23 2018 21:43
np :)
Ken Haduch
@khaduch
Jan 23 2018 22:17
@pocahontas123 - here is the link for your forum post https://forum.freecodecamp.org/t/fcc-challenge-portfolio-need-help/170522 - it looks like you have a lot of problems to work through.
One thing that you have is your font-size set to 4vw, so that scales the font according to the viewport width, the wider the viewport, the larger the font-size rendering will be. That is sometimes a good choice for responsive behavior, but it is not always that easy to get the results that you want.
Your code is not properly posted for CodePen, the way that the CodePen site is supposed to be used - but besides that, any relative links to things like the images that you have as img/miniature1.png will not show up on CodePen because those links are invalid. You need to have absolute URL references for the images so that they can be loaded on CodePen.
That's just a start at looking at it. but maybe it will give you a couple ideas - you should set it up so that it will display in the best way possible to get help from the community.
@pocahontas123 - I just re-read some of your post, if you put the full image link in there as you have posted it on the forum, it will show the images instead of showing nothing in your project section.
Ken Haduch
@khaduch
Jan 23 2018 22:31
@pocahontas123 - ah, but I see your posted image for your portfolio section - I'm not familiar with the grid and I would have to study your project to see if I could understand what you are doing and how the grid works.
Randy
@RandyGoldsmith
Jan 23 2018 23:25
is flexbox used as a standard now for laying out webpages?
Muna Mohamed
@mooneyd12
Jan 23 2018 23:29
@SweetCodingInc Apologies for the late response, I was away from my laptop for a while but thank yooou!!! Your solution worked and I get why that's the answer. Again, many thanks for helping me solve the challenge!
CamperBot
@camperbot
Jan 23 2018 23:29
mooneyd12 sends brownie points to @sweetcodinginc :sparkles: :thumbsup: :sparkles:
:cookie: 206 | @sweetcodinginc |http://www.freecodecamp.org/sweetcodinginc