Clases externas en Javascript

"use strict"; const print = console.log class A{ constructor(){ console.log('Estoy en A') } } class B extends A{ constructor(){ super() console.log('Estoy en B') } } let main = ()=>{ print('Node JS') try{ let a = new A() let b = new B() } catch(e){ console.error(`Ha ocurrido una excepcion:\n${e}`) } } main()
Ejemplo de clases externas

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.