Jak wywołać te funkcje?
class Example1 {
msg = (message: string): string => { return 'Witaj, funkcjo msg ' + message };
}
var exa = new Example1();
exa.msg('msg');
Jak wywołać te funkcje?
class Example1 {
msg = (message: string): string => { return 'Witaj, funkcjo msg ' + message };
}
var exa = new Example1();
exa.msg('msg');
Przecież sam napisałeś...
Dokladnie tak jak robisz
tu masz wywolanie funkcji
exa.msg('msg');
Może autor nie widzi tego co zwraca funkcja - więc wystarczy to wcisnąć w console.log'a ->
console.log(exa.msg('msg'));
Dziękuję, właśnie zapomniałem dopisać, jak ją wywołać w console.log, ale już nie mogłem edytować postu :)