# 2022 JS直播班-第三週小組作業 ###### tags: `JavaScript` ### 以建構式製作物件樣板 [參考卡斯柏老師的blog](https://www.casper.tw/javascript/2017/12/18/javascript-constructor/) * 只能透過function建立,且不能用箭頭函式 * this代表此物件,可以透過參數傳入值 以建立商品樣板為例: 分別建立名稱,分類,照片連結,價格,是否打折的屬性  建立後以new套用,會產生套用相同樣板但各自獨立的物件  goods1及good2輸出為  樣板建立後也可用prototype新增新的屬性  輸出結果 
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up