Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function Person(name){
- this.name = name
- }
- Person.prototype = {
- //先將 constructor 設置好
- constructor: Person,
- sayHello: function(){
- console.log(`Hello ${this.name}`)
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement