1.聲明式 function fn() { //do something } 2.函數表達式 let fn = function () { //do something } 3.構造函數 function Person(name,age){ this.name=name this.age=age } ...
1.聲明式
function fn() { //do something }
2.函數表達式
let fn = function () { //do something }
3.構造函數
function Person(name,age){ this.name=name this.age=age } let fn = new Person('syq','18')