function f1() { //function 命令
return 'Hello world!';
}
let f2 = function() { //函数表达式
return 'Hello world!';
};
let f3 = new Function('return "Hello world!"'); //Function 构造函数
let f4 = Function('return "Hello world!"'); //Function 构造函数,可省略new
console.log(f1()); //Hello world!
console.log(f2()); //Hello world!
console.log(f3()); //Hello world!
console.log(f4()); //Hello world!