How would we polyfill es6 class methods into ES5?

I am reading a book and it says the following:

```
class Ninja {
    constructor(name) {
        this.name = name;
    }

    swingSword() {
        return true;
    }
}

```

is the same as 

```
function Ninja(name) {
    this.name = name;
} 

Ninja.prototype.swingSword = function() {
    return true;
};

```

I am just asking why are we adding the swingSword on the prototype and not inside the constructor function?

Because the function should be on the object and not on the prototype chain.

Am i right or wrong?