Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Aug 17 09:32
    User @bjorno43 unbanned @linkin-park
  • Jun 20 21:19
    @bjorno43 banned @shenerd140
  • Apr 25 17:13
    @mstellaluna banned @cmal
  • Jan 08 22:05
    @mstellaluna banned @dertiuss323
  • Nov 07 2018 04:42
    User @texas2010 unbanned @ows-ali
  • Nov 02 2018 16:25
    @texas2010 banned @ows-ali
  • Oct 12 2018 05:50
    @bjorno43 banned @NACH74
  • Oct 05 2018 23:02
    @mstellaluna banned @JomoPipi
  • Sep 16 2018 12:21
    @bjorno43 banned @yash-kedia
  • Sep 16 2018 12:16
    @bjorno43 banned @vnikifirov
  • Sep 05 2018 08:12
    User @bjorno43 unbanned @androuino
  • Sep 05 2018 07:38
    @bjorno43 banned @androuino
  • Aug 23 2018 16:57
    User @bjorno43 unbanned @rahuldkjain
  • Aug 23 2018 16:23
    @bjorno43 banned @rahuldkjain
  • Jul 29 2018 14:13
    User @bjorno43 unbanned @jkyereh
  • Jul 29 2018 01:00
    @bjorno43 banned @jkyereh
  • Jul 10 2018 22:09
    @bjorno43 banned @manafn
  • Jul 06 2018 15:20
    @texas2010 banned @imlegend19
  • Jul 03 2018 12:28
    @bjorno43 banned @vbvmatta
  • Jun 29 2018 13:54
    @bjorno43 banned @OGTechnoBoy
Nikki L.R.
@nikkilr88
@roxroy Yeah, I know how to use map and render li elements. I don't understand how to make this repeat whenever the user adds a new recipe. I don't know if I am explaining myself well enough. Sorry.
Andrew Hickman
@ahickman3
@moigithub bascially, need to access each name individually, and each name will have multiple quotes. So itl be a random number, and thatl determine the name. Then another random number determining qhich quote is picked
Moisés Man
@moigithub
to access arrays elements.. u use brackets and some number/index
arr[0] will access the first element.. on ur quotes case.. this is an object with a single property named "mario"
@fullmetal7777
once u have the object.. using this property u can access its value (which is an array of strings)
teevik
@teevik
The render() method gets run every time state is changed @nikkilr88
Andrew Hickman
@ahickman3
i can get the name + the quotes, its getting a specific quote for the name that i cant do. Ive done quotes[1].1, quoted[1][1], etc and notta
Roxroy
@roxroy
@Riley1435 , also, the document-ready function is not being used correctly, refer to https://learn.jquery.com/using-jquery-core/document-ready/. Use just one for the page and embed the functions within it.
Riley
@Riley1435
@roxroy okay, anything else you notice?
Nikki L.R.
@nikkilr88
@teevik I got that... This project just isn't clicking, though. I really don't know how to explain it.
Andrew Hickman
@ahickman3
@moigithub mind typing out how i would exactly? still not sure what you mean
Nikki L.R.
@nikkilr88
Do I have to set up localStorage first?
Moisés Man
@moigithub
@fullmetal7777 to access ARRAYS u use brackets and some index
to access OBJECTS u use the object name + the key/property using dot or bracket notation
arrays is one thing.. object is another thing
arrays are identified by [] :point_left: squaare brackets
objects are identified by { } :point_left: curly brackets
Andrew Hickman
@ahickman3
@moigithub so, im able to access the object that i want.
teevik
@teevik
@nikkilr88 If you want it to change when the user adds a new recipe, you can just update state with all the recipes as the user inputs them, and the render method will be automatically run if needed
Andrew Hickman
@ahickman3
@moigithub so basically ive created a object that contained an array of objects, which each object containing an array or quotes right?
array of quotes*
Nikki L.R.
@nikkilr88
It's just not clicking... I know it re-renders when the state changes, but I don't get how to have the previously added recipe to remain in the RecipeBox after re-rendering.
Moisés Man
@moigithub
@fullmetal7777 u created this
quotes = [ ... ] <-- see squares there ? thats an array
this quotes contains {}
like this quotes = [ {...}, {...} ] <-- objects inside the array
soo to access objects values.. FIRST u need to get the array element (which is an object)
THEN once u have the object.. u can access its values
Andrew Hickman
@ahickman3
@moigithub im pretty familiar with te basics of programming, i use c a bunch in my major, but objects is the only thing that is somewhat new to me
@moigithub i took a java class, but its been like 2 years lol
teevik
@teevik
@nikkilr88 When you update the props of something, it also re renders
Roxroy
@roxroy
@Riley1435 , $("#weatherGrab").on("click", its not being called. But it should work after addressing the document ready issue.
Riley
@Riley1435
i deleted the $(document).ready() before the function
teevik
@teevik
So could just pass all the recipes as props
Ashutosh Guha
@freecodecampcoderash
help me guys...... look at the full screenshot and where it is wrong please tell me
Moisés Man
@moigithub
@fullmetal7777 quotes[0] return the first element which is an object ---> {mario: [....]}
Andrew Hickman
@ahickman3
@moigithub thats the part i dont get, accessing the specific objects values lol i figured quotes[1][x] would do it since it the fox object has an array of strings
Ashutosh Guha
@freecodecampcoderash
2017-06-18.png
Moisés Man
@moigithub
var theFirstObject = quotes[0]
theFirstObject.mario <--- will give u the array value inside this object ["Oh yea", "...."] @fullmetal7777
or using bracket notation theFirstObject["mario"]
Andrew Hickman
@ahickman3
@moigithub yeah i got that already, it was in the picture lol
Moisés Man
@moigithub
soo its NOT quotes[0][0]
but quotes[0]["mario"] if u combine both things i said above on a single line @fullmetal7777
or quotes[0].mario
Ashutosh Guha
@freecodecampcoderash
@moigithub @fullmetal7777 help
Riley
@Riley1435
@roxroy do i need to use .getJSON when setting JSON data to variables that i use in the function?
Nikki L.R.
@nikkilr88
@teevik I am using a controlled form. It updates with an onChange function. I would't know how to go about that.
Andrew Hickman
@ahickman3
@freecodecampcoderash you can generally google each lesson and find ayoutube video over it. I had to do it a couple time for some weird work arounds that fcc expected. Just do that
Roxroy
@roxroy
@Riley1435 , that part works fine, so leave it as is.
Andrew Hickman
@ahickman3
@moigithub AHHHHHH there it is lol ok that did it. Ok ima look over it and see if i understand. That you very much man, this object oriented thing messes with my head sometimes lol ive always used c and c++
Riley
@Riley1435
@roxroy but between $("#weatherGrab") and my if else statement, should i add $.getJSON ?
James Lindsay
@jm535
Hi all, working on the portfolio challenge. 3 hours now and I can't get the hamburger menu to expand ... Here is the code: https://codepen.io/Jm535/pen/ygZKXN/ If anyone could have a look that would be great :smile:
Andrew Hickman
@ahickman3
@moigithub so basically quoted[1] is that whole part, basically {fox: [...]} considered as one object. Makes perfect sense
Roxroy
@roxroy
@Riley1435 , let me take look.
Andrew Hickman
@ahickman3
@jm535 hamburger menu?
@jm535 i can barely read anything because your font color matches the background lol might wanna consider changing that to white temporarily just so you can see everything
James Lindsay
@jm535
@fullmetal7777 I do believe thats what they call it.
Yeah, I know, but I am just working on the navbar right now
teevik
@teevik

@nikkilr88
So you'll have a main component, and inside have an recipe list component and the form.

In the main component you would have a list of all recipes as state, and then once the form gets changed you would change the state to include the new recipe.

In the recipe list you pass the recipes as props, which changes automatically once you change the state in main component.

You could alternatively start using a state framework like redux or reflux, but they can be pretty advanced and often not needed
luccifer00
@luccifer00
hey there, can someone helpme. i am trying to put a title in the middle of screen.... i just get to center in the top. maybe is becouse i am trying to put a Parallax Scrolling background.... any idea?
Mauricio Salas
@MauriSg99
Try padding-top
teevik
@teevik
If you use flexboxes, you can use justify-content and align-items