📌  相关文章
📜  函数和执行上下文 makePlans - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:04:29.228000             🧑  作者: Mango

代码示例1
So I managed to put 


    let friendsAvailable = true;

function makePlans(name) {
  // INSERT CODE HERE

  return callFriend(friendsAvailable, name);
            
}

function callFriend(bool, name) {
  // INSERT CODE HERE  
  if (bool) {
    return (`Plans made with ${name} this weekend`);
  } else  {
    return "Everyone is busy this weekend";
  }
}

// Uncomment these to check your work!
console.log(makePlans("Mary")) // should return: "Plans made with Mary this 
weekend'
friendsAvailable = false;
console.log(makePlans("James")) //should return: "Everyone is busy this weekend."