Need help understanding a few concepts

Hello, I hope everyone is doing well! I just recently got into learning Javascript about 2 months ago and I’ve learned a ton so far! With that being said I’ve come into a small problem. I’m trying to understand how variables, objects, and functions are used in a project and how they work together with each other in a project you’re working on.

Thank yall in advance.

Hi there, I think you will understand this better when you work on a hands-on project. In my case, I recently followed a tutorial on creating a quote generation web app using JS.

So, I wrote a function to get data from an API. I turned the data to JSON, so each quote was an object. Thereafter, I assigned the object to a variable and updated the div containing the quote using this variable.

Check out this git repo: GitHub - rubenjen/quote_generating_machine

The script.js file is especially useful to show what I just said.
Hope this helps.

NB: This isn’t my original idea, I followed a tutorial, not sure by whom…

1 Like