DevTips Daily: The Typescript constructor function
HTML-код
- Опубликовано: 23 авг 2024
- ⭐️ Check out more DevTips Daily ⭐️
↳ • DevTips Daily: The Hid...
Got a suggestion for a DevTip? Let me know in the comments or find me on Twitter @codebubb ( / codebubb )
#devtipsdaily Channel Handle @codebubb
Very good! Thanks
Cheers!
Thank you very much!
I didn't know this existed until some generated code mysteriously didn't work with babel. Yay.
in my linux it was shfit+cntrl+(up/down)key
Explained it very well. At 4:30 isProDev value is undefined. How to set a default value "false".
I think assigning a default value as a parameter in the constructor instead of making it optional with the ? operator will by default assign the isProDev property without having to pass it in when the instance of Sarah is created
@@137dylan Thank You :) Like this `public isProDev: boolean = false` ?
@@neontuts5637 Yes. I can’t try it as I’m on the road. Passing in true when creating the instance of Sarah will then overrule it
@@137dylan Yes, I tried it's working Thanks again :)
Thanks @137dylan!