用户:
BlackTheWorldGod查看:0 回复:0 评论:0 创建时间:2021-03-14T18:55:43
题目:
修改howToDo的代码, 使得console.log(howToDo('cloths')); 输出 wash cloths, 并且其他结果保持不变
function howToDo(name) { if (name == 'apple') { return `eat ${name}`; } else if (name == 'juice') { return `drink ${name}`; } else { return 'do nothing'; } } console.log(howToDo('apple')); // eat apple console.log(howToDo('juice')); // drink juice console.log(howToDo('bug')); // do nothing console.log(howToDo('school')); // do nothing