DEV Community

loading...

Discussion on: Do you know ES6 - Part 1

Collapse
johndavemanuel profile image
John Dave Manuel

Great Article
I think there is a typo error here

//Create class
class Person{
//Default function method
constructor(){
this.name = 'Mohamed';
}

printMyName(){
    console.log(this.name);
}

}

//Create an instance or object
const person = new Person1();
person.printMyName(); //"Mohamed"

1 should be remove