有人能告诉我为什么我的 js 代码没有使用箭头函数打印日期吗?

can someone tell me why my js code is not printing the date using the arrow function?

const datee = () => document.write(new Date());

datee; //no response, same for console.log

const datei = () => new Date();

console.log(datei); // () => new Date();

如果他们正在打印任何内容,上面的评论显示了他们正在打印的内容

您必须像调用常规内联函数一样调用箭头函数

const datei = () => new Date();
console.log(datei()); // returns Date Object;

// Hovwever, without calling (without "()")
const datei = () => new Date();
console.log(datei); // () => new Date();