DEV Community

Cover image for Passing Values to Functions with Arguments
xenochem
xenochem

Posted on

Passing Values to Functions with Arguments

Day 1/100 of 100 days of code
I'm currently on 48/111 Basic JavaScript of JavaScript Algorithms and Data Structures Cert at FreeCodeCamp.org

Parameters was the highlight for todays lesson. I was stuck with this for a bit. I realize I didn't know enough about the true potential of what a Function can do with it's parameters. I watched a Youtube video that went into more depth on this, since I didn't understand how you can add more information into the Function. The video explain that you can call the Function again with different arguments and the parameters would take on the value of the new arguments.

Alt Text
I told the Function to add parameter a with b in the console.log(). Then when I called the Function I just put the arguments that I wanted 4, 6, and BAM! Once the Function added the arguments together the answer comes out as 10!

Hope you enjoyed my discovery today! Follow me!
https://github.com/xenochem
https://twitter.com/xenochem

Top comments (0)