为什么我在控制台中未定义

-2 javascript

const horn = () => {
  console.log("Toot");
};
console.log(horn());
Run Code Online (Sandbox Code Playgroud)

我得到的输出为

嘟嘟未定义

但我不明白为什么会这样

Dav*_*avy 6

你的号角功能不会返回任何东西......

const horn = () => {
  return 'horn';
};
const horn2 = () => {
  console.log('horn');
};
console.log(horn());
horn2();
Run Code Online (Sandbox Code Playgroud)