JS Flashcards
What are arrays used for ?
Creating a list
Describe array literal notation.
[]
How are arrays different from “plain” objects?
Arrays have an order
What number represents the first index of an array?
0
What is the length property of an array?
counts how many interms are in array (array.lenght)
How do you calculate the last index of an array?
array.length-1
What is a function in JavaScript?
Functions packs a code for resuse through a program
Describe the parts of a function definition.
function keyword ,then name, then (parameter), then {code block}
Describe the parts of a function call.
writing a function name then ()
When comparing them side-by-side, what are the differences between a function call and a function definition?
function call is asking the function to run, while defining the function is constructing the function it’s self
What is the difference between a parameter and an argument?
The parameter is used to pass an argument
What two effects does a return statement have on the behavior of a function?
causes the function to produce a value and exits the function