class Applications{
constructor(name, type){
this.name = name
this.type = type
}
display(){}
displayMode(){}
}
class FacebookLightMode extends Applications{
constructor(name,type){
super(name,type)
}
display(){
console.log(`Welcome to Facebook for ${this.type}.`)
}
displayMode(){
console.log("You are using facebook in light mode.")
}
}
class FacebookDarkMode extends Applications{
constructor(name,type){
super(name,type)
}
display(){
console.log(`Welcome to Facebook for ${this.type}.`)
}
displayMode(){
console.log("You are using facebook in dark mode.")
}
}
class WhatsAppLightMode extends Applications{
constructor(name,type){
super(name,type)
}
display(){
console.log(`Welcome to Whatsapp for ${this.type}.`)
}
displayMode(){
console.log("You are using whatsapp in light mode.")
}
}
class WhatsAppDarkMode extends Applications{
constructor(name,type){
super(name,type)
}
display(){
console.log(`Welcome to Whatsapp for ${this.type}.`)
}
displayMode(){
console.log("You are using whatsapp in dark mode.")
}
}
const fbLight = new FacebookLightMode("Facebook", "Social Networking")
const whatsappDark = new WhatsAppDarkMode("Whatsapp", "Chatting")
fbLight.display()
fbLight.displayMode()
whatsappDark.display()
whatsappDark.displayMode()