I am trying to make a function that will call another function if the parameter doesn't exist.
For example:
function getAllFoo(){
// makes a request to an api and returns an array of all foos
}
function getNumFoo(foosArray = getAllFoo(), num = 5){
// selects num of foos from foosArray or calls getAllFoos then selects num of them
}