nzakas / understandinges6

Content for the ebook "Understanding ECMAScript 6"
5.45k stars 796 forks source link

Missing colon in Chapter 3 Functions #399

Closed sudarsangp closed 7 years ago

sudarsangp commented 7 years ago

Example under special cases of the name property

Missing colon for the get function:

Actual:

var person = {
    get firstName() {
         return "Nicholas"
    },
    sayName: function() {
        console.log(this.name);
    }
}

Suggestion:

var person = {
    get: firstName() {
         return "Nicholas"
    },
    sayName: function() {
        console.log(this.name);
    }
}
sudarsangp commented 7 years ago

Sorry misunderstood the example given. Please close this issue.