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
Andrew Hickman
@ahickman3
how would i access one of the quotes? cant seem to figure that out
should be a simple solution i assume
Roxroy
@roxroy

@nikkilr88 , in your RecipeBox, pass the recipe as a prop , then loop over the li to print the ingredients. Eg {props.recipe.ingredients.map(ingredient =>

<li key={id++}>{ingredient}</li>
)}

Paul
@candlefish
@Geek-Killer I'm not exactly sure what you want, but here's some suggestions for your FreeCodeCamp codepen project. You should take out all the <br> tags in your paragraphs. If you use good CSS, everything will wrap nicely. Try using text-align: justify in your CSS for the p tag. Immediately after your jumbotron closing div, add a <div class="container"> and put the closing </div> at the very end of your html. In your CSS, give the container class a max-width of something like 800px. This will be nice for readability. Also, by default, the Bootstrap container class will put a small margin on the left and right of everything so your text and images don't go all the way to the edges of the screen. Hope this helps a little.
Moisés Man
@moigithub
quotes is an array...of objects
using the object name + the key property.. u access the values... @fullmetal7777
Roxroy
@roxroy
@Riley1435 , you should use just 1 $(document).ready for the page. Remove the one from $("#weatherGrab")
Andrew Hickman
@ahickman3
@moigithub havnt done much with objects, so if something doesnt look right, its probably because im only slightly sure of what im doing lol
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