classPerson{constructor(region_,gender_){this.region=region_;this.gender=gender_;}greeting(val='an-nyeong'){console.log(val);}}letkorean=newPerson('Korea','male');console.log(korean);/* Result
Person {
region: 'Korea',
gender: 'male'
}
*/korean.gender='female';console.log(korean);/* Result
Person {
region: 'Korea',
gender: 'female'
}
*/korean.greetings();/* Result
an-nyeong
*/classAmericanextendsPerson{constructor(region_,gender_,language_){super(region_,gender_);this.language=language_;}greetings(val='Hello'){}}letamerican=newAmerican('USA','female','English');console.log(american);/* Result
Person {
region: 'USA',
gender: 'female',
language: 'English'
}
*/console.log(greetings);/* Result
Hello
*/