No BS TS #2 - Typescript Functions

  Рет қаралды 49,661

Jack Herrington

Jack Herrington

Күн бұрын

Пікірлер: 100
@andrebotha5270
@andrebotha5270 3 жыл бұрын
How the hell do you only have 14K subs? Should be waaaayyyyy more. Great content. Thank you Jack.
@thehaptiK
@thehaptiK 3 жыл бұрын
he's at 17.3K now. I think he's starting to gain some traction.
@WCanyon
@WCanyon 2 жыл бұрын
52k a year later -- also wow it bugs me that youtube puts that as 52K -- does no one there know what k stands for? His subs are at 52 Kelvin according to youtube lol
@rojka-_-
@rojka-_- Жыл бұрын
hes 147k now
@jherr
@jherr Жыл бұрын
@@rojka-_- Not bad, right?
@rojka-_-
@rojka-_- Жыл бұрын
@@jherr indeed
@damianpetroff
@damianpetroff 12 күн бұрын
I love that at 11:45 you're basically proving your point by making a genuine mistake that was not noticable up until runtime
@jherr
@jherr 12 күн бұрын
Except that it's caught at compile time by the TypeScript compiler. The problem that I'm demonstrating is that JavaScript consuming TypeScript modules removes the benefits of TypeScript. To maintain the type checking all of your code needs to be TypeScript.
@damianpetroff
@damianpetroff 11 күн бұрын
@@jherr What I meant is that you don't seem to have done that " 'second' instead of 'last' " typo on purpose (maybe you did and I did not catch that), which was not visible until you actually ran the script (runtime) and it printed undefined. Which proves that TS would have showed you the typo and you'd have fixed it before shipping the product, which proves your point. Love it
@vnoommuy
@vnoommuy 3 жыл бұрын
Hey Jack. I just wanted to thank you for your work and effort doing these videos. The quality of your content is top notch, I just started learning Typescript a week ago and you're helping me so much! Can't wait to see your channel grow to thousands of subscribers. Oh and nice shirt too haha Best regards from Uruguay 🇺🇾
@agatamaria5569
@agatamaria5569 2 жыл бұрын
If my family & friends were interested I would 10/10 recommend your videos. This is fantastic and really, really no-bs, I can actually follow along and I have an attention span of an excitable goldfish - thank you so much!
@jherr
@jherr 2 жыл бұрын
😂 “excitable goldfish”. That’s a keeper! 😂
@ozzyfromspace
@ozzyfromspace 3 жыл бұрын
I'm brand-spanking new to Typescript (been at it for about 3 days now) coming from a Javascript background. What I appreciate most about this video series is how I'm learning about YOUR best practices, or basically, how you like to structure things. It helps to see someone that clearly knows what they're doing write clean code and present it to us in a "no bs" way. You're awesome, Jack! Thank you so much for making this series available to us, noobs. You're educating an army of TS coders 🏆☮️🎊🙌🏽
@peeckle1657
@peeckle1657 11 ай бұрын
Your way of explaining and your expertise around ts is so cool, i love watching your videos as I work on a ts+react project, it helps me a great deal to understand the concepts! Thanks ❤
@jrhager84
@jrhager84 3 жыл бұрын
TS gives me SUCH C# vibes, and I really miss coding in C#. Good to see! This channel rocks!
@thehaptiK
@thehaptiK 3 жыл бұрын
Jack for president! Great videos man. Finally getting time to sit down and get stuck into this series. So excited!
@lookingforbino
@lookingforbino 2 жыл бұрын
HI, Jack At time 11:44, "npx tsc functions.ts" didn't work for me. Always gave me an error: error TS2585: 'Promise' only refers to a type, but is being used as a value here. Do you need to change your target library? Try changing the 'lib' compiler option to es2015 or later. I added "lib": [ "ES5", "ES2016", "DOM"], Still doesn't work. I used "npx tsc functions.ts --target es6" , it worked, generated functions.js then I did "node js-function-tests.js ", error: SyntaxError: Unexpected token 'export' No matter what I did, always same error. Any clue? Thanks
@jherr
@jherr 2 жыл бұрын
You should jump on the Discord server discord.gg/nGxhQ3SY and post a link to your GitHub repo in the #typescript channel.
@lookingforbino
@lookingforbino 2 жыл бұрын
@@jherr Ok, thanks
@vinr
@vinr 2 жыл бұрын
Hit with the same issue, I'm not sure how ​ @Jack Herrington did compile just one file "functions.ts" with "tsconfig.json" options because if you compile one file "tsc" ignores the "tsconfig.json", I had to include "files": ["./functions.ts"] in the "tsconfig.json" and compile, which generates the functions.js
@fleckenfurz77
@fleckenfurz77 2 жыл бұрын
@@jherr What is the answer? could you not tell us here how to solve the compile error?
@jherr
@jherr 2 жыл бұрын
To compile functions.ts as a single file use `tsc --lib ESNext,dom functions.ts` this will bring in library support for promises and console.log
@k303k
@k303k Жыл бұрын
Love your professional way of teaching style sir. Thanks for the video!
@yuriygerasimovich4187
@yuriygerasimovich4187 3 жыл бұрын
This series has to have waaaay more views. Awesome!
@natsdevstudio3812
@natsdevstudio3812 3 жыл бұрын
You're such a great teacher. Try to collaborate with other youtubers to get your name out there. It's a waste that only a few people see your great contents.
@planetmall2
@planetmall2 3 жыл бұрын
Great job. You’re an excellent teacher and your content is amazing!
@message59
@message59 3 жыл бұрын
like a few people before me I wanted to thank you for this series and the effort 👏🏼 it really is the best I found you have a great way of breaking things down and explain it Jack 👌🏼😁 hope you keep on doing videos
@thefonsotube
@thefonsotube Жыл бұрын
Note to anyone else who finds this video..."yarn add @types/node" may solve the "TS2585: 'Promise' only refers to a type, but is being used as a value here" error for you....if you run into it.
@lucasseth509
@lucasseth509 Жыл бұрын
Thanks bro it now works ! Really appreciate it
@sinaukode
@sinaukode 3 жыл бұрын
How you explain every details on the concept are amazing, thanks
@ferhatsunaycansev106
@ferhatsunaycansev106 2 жыл бұрын
Perfect Typescript series on Earth
@khavea
@khavea 3 жыл бұрын
clean and crisp content, Jack.
@omarkarim9298
@omarkarim9298 3 жыл бұрын
Content is great for people looking to level up
@AmitK
@AmitK 5 ай бұрын
I knew typescript at beginner level for a long time, but in real projects where it is complex, It made me crazy all the time, I was trying hard for last 4-5 days to be a pro in typescript, I was googling paid/free courses on Udemy, on youtube everywhere you name it , and now seeing episode #18 I came to know , finally I am there. its super pro typescript that I was looking for , its not toying.. I can't thank you in words how excited I am to get this series. one request, would you be able to create a no BS JS , there are many weird things in javascript, even professionals working for years do not know about.
@zerocodercool
@zerocodercool 3 жыл бұрын
Great explanation. Concise and simple. Awesome content!!!
@niklas8581
@niklas8581 2 жыл бұрын
Really loved the intro to react series. Now watching this. Do you have a suggestion on how to go about learning optimally? Watch all videos then start a leaning project; program along the videos - just trying out stuff; Starting a learning project right away and implementing the things I learn through the videos.. Also, do you have suggestions for learning projects?
@jherr
@jherr 2 жыл бұрын
Always be building stuff. Just watching will do nothing for your retention of the material. The only thing that will actually help you learn and retain this stuff, is to build stuff with it. And make it a cool project that is meaningful to you.
@Jordanprime
@Jordanprime 3 жыл бұрын
at 11:10 why use require and not import? I have yet to understand if there is a convention on when to use each, usually I see require on a server app and import on a react app. thanks for the video
@jherr
@jherr 3 жыл бұрын
With node JavaScript we couldn't do imports until ESM, so this is just NodeJS JavaScript. TypeScript is actually compiled into JavaScript. So when you do `import` in TypeScript it's actually compiled into a `require` behind the scenes.
@Jordanprime
@Jordanprime 3 жыл бұрын
@@jherr thanks
@phil4075
@phil4075 2 жыл бұрын
thank you very much for your effort jack! very handsome and well explained tutorials.
@Karan60191
@Karan60191 3 жыл бұрын
I did first saw your channel on react day bangalore, great i was a part of it coz there i found about blue collar coder :) , thanks for the series, would be spreading word about your channel in my network :)
@jherr
@jherr 3 жыл бұрын
Thank you so much 🙂
@PRen2024
@PRen2024 3 ай бұрын
hey thanks for your content!, really helpful, clear, complete. 🙏
@blah495409
@blah495409 3 жыл бұрын
Wow, new shirt! Thanks for tutorial Jack!
@saikun0293
@saikun0293 2 жыл бұрын
Thank you for the content. Love the series
@emdadgar_official
@emdadgar_official 2 жыл бұрын
cool . respect to knowledge from Iran .
@perryzeraa
@perryzeraa 3 жыл бұрын
Awesome content, very straightforward, thanks a lot!
@ВідділенняХірургії
@ВідділенняХірургії 2 жыл бұрын
Hello! Why did you use export/import all the time, and at 10:59 - require?
@wilsonbalderrama7458
@wilsonbalderrama7458 Жыл бұрын
I guess it's because TS supports export/import but node.js only supports require?
@ddikodroid
@ddikodroid 3 жыл бұрын
thank you for making this series
@zykoz6826
@zykoz6826 3 жыл бұрын
This series is awesome!
@dwcls
@dwcls 3 жыл бұрын
Great content. This is all i need
@yaserghananwi
@yaserghananwi 3 жыл бұрын
Hi Jack , nice tutorial i will try to see all videos on this topic , good job continue , can you tell me what is the theme you are using in vscode it's nice
@hhao0011
@hhao0011 2 жыл бұрын
Hi Jack, thank you so much for making all these videos which are of the highest quality across KZbin. If possible, could you please share your thoughts on ChatGPT and front end development ? I am trying to become a front end developer and slightly concerned about this path. Thank you
@shu2k
@shu2k 2 жыл бұрын
Thank you for these amazing videos.
@Sealis04
@Sealis04 Жыл бұрын
Does anyone know what extension he uses for the auto adjust of ' characters to "? And probably a bunch of cleanup stuff I missed but yea, those as wel if therei s.
@cas818028
@cas818028 3 жыл бұрын
Off topic but was looking at your background. What made you make the switch from asp.net c# to node/JS/react/typescript ?
@jherr
@jherr 3 жыл бұрын
Honestly, I'd like to say it was self-directed, as it has been in the past, but over the past decade I think most of the focus of my learning on what I've been using on the job. I do love C# though. Fantastic language.
@kabir5359
@kabir5359 2 жыл бұрын
Hi Jack, Great video! Is there anything wrong with writing the last function using default parameters instead of checking if user exists with user?.first etc function getName(user: {first: string; last: string} = {first: 'first', last: 'last'}) : string { return `${user.first} ${user.last}` }
@jherr
@jherr 2 жыл бұрын
I don't think so. As long as you are completely using TypeScript throughout. JavaScript could send through incomplete user objects which would have undefined first or last (or both) because the default will only be used if the argument is undefined (meaning not provided).
@sreekar_s
@sreekar_s 3 жыл бұрын
Great video as always!!!
@khavea
@khavea 3 жыл бұрын
Is there any shortcut key for autocomplete type inference?
@jherr
@jherr 3 жыл бұрын
Dunno, that would be cool though. Lemme know if you find it.
@cannyaii
@cannyaii 3 жыл бұрын
Keep 'em coming Jack 😍
@jherr
@jherr 3 жыл бұрын
Will do! So much more good stuff coming up! Daily!
@hirisraharjo
@hirisraharjo 3 жыл бұрын
Does TS generate bigger app bundle than native javascript? I thought the compiled code from TS to JS looks pretty bloated
@jherr
@jherr 3 жыл бұрын
Depends on the library target. If you specify a target like `esnext` you'll see very little additional code if any.
@babyboie20
@babyboie20 3 жыл бұрын
How is your VSCode sooooooo fast?!? Mine takes almost a minuet to update
@EvansRutto-kd8fw
@EvansRutto-kd8fw Жыл бұрын
This is an awesome tutorial ...thanks
@greg22autograf63
@greg22autograf63 3 жыл бұрын
Great Stuff. Thanks a lot!
@timontv5037
@timontv5037 8 ай бұрын
What's your vs code extension ?
@Karan60191
@Karan60191 3 жыл бұрын
hey Jack, one question , could you make similar series for writing test cases ?
@Karan60191
@Karan60191 3 жыл бұрын
probably jest or enzyme or whatever you feel like more popular because i was trying to understand the test cases the other day and really couldn't find much interesting videos on the internet for the same.
@jherr
@jherr 3 жыл бұрын
I get this request a lot, so I will definitely do this at some point. I did do one video on Cypress. But, yes, there is a lot more to talk about when it comes to testing.
@mr_ehmed
@mr_ehmed 2 жыл бұрын
Quality Content
@Kondzino
@Kondzino 2 жыл бұрын
What font do you use?
@jackh3242
@jackh3242 3 жыл бұрын
Very useful thank you!
@hhao0011
@hhao0011 2 жыл бұрын
Hi Jack, could you please share your thoughts on ChatGPT and front end development ? I am trying to become a front end developer and slightly concerned about this path. Thank you.
@sparshgarg9700
@sparshgarg9700 3 жыл бұрын
Thank-you so much Sir.
@sagarreddy7461
@sagarreddy7461 3 жыл бұрын
Great one
@vinr
@vinr 2 жыл бұрын
Super good
@hassanbhattiOfi
@hassanbhattiOfi 3 жыл бұрын
You're great, keep it up!
@ToddDunning
@ToddDunning 3 жыл бұрын
Clear and informative but we need to see that bass getting slapped. Next vid is pentatonic scales in minor and major
@jherr
@jherr 3 жыл бұрын
Heh, maybe, I can do old Police tunes. We also have a music project that's been languishing for a bit: jherr.github.io/jmusic/#/
@ToddDunning
@ToddDunning 3 жыл бұрын
@@jherr You have GOT to make a vid of that. I know you want to maintain focus, but you have paid your dues on that already. This would give some more color to the channel and you know all the dev angles you can cover with it. My god, you've even got the inversions in there, and I'm suspecting you're getting the voicings algorithmically. This would go over better than you think and possibly be your viral leader.
@jherr
@jherr 3 жыл бұрын
@@ToddDunning Thanks man. It is algorithmic, which is unique. You should check out the repo. There is a generic "engine" that creates the chords for any instrument in any tuning. Though to get the best possible output it's "trained" on six strings, and the algorithm weights chords against known good shapes. A lot of coders have a "I always write this project in every new platform I work with" and this algorithmic chord generator is that project for me. I've written in Think C with Objects, Objective-C, MFC, Java Swing, Python, Rails, and now Node/React.
@ToddDunning
@ToddDunning 3 жыл бұрын
@@jherr I hate to see it hidden. Don't know if there are other things like it but it has obvious broad utility and my challenge to you is to fit it in your channel curriculum despite that you might feel it's off-topic.
@balajikesavan9933
@balajikesavan9933 3 жыл бұрын
Awesome
@mariaturzynska2712
@mariaturzynska2712 Жыл бұрын
i liked the hair style from the from #1 video much better
@PRen2024
@PRen2024 8 ай бұрын
😅u should make a tutorial on a bassline someday
@count_of_pizza
@count_of_pizza 3 жыл бұрын
Cool cool cool :)
@dudemask4943
@dudemask4943 3 жыл бұрын
hey,you look like David Bowie!
@jherr
@jherr 3 жыл бұрын
Not usually a fan of when folks say I look like someone. But this one I LIKE. Thank you! 😀
@naturegoggle
@naturegoggle 3 жыл бұрын
100th
@j3bb9z
@j3bb9z 3 жыл бұрын
I think default exports should generally be avoided. There are even tslint/eslint rules to check that (`no-default-export`). Some good reasons are listed here: basarat.gitbook.io/typescript/main-1/defaultisbad
@jherr
@jherr 3 жыл бұрын
Thank you so much for this, this is an excellent read, and really good justification.
@satishbhattaraiable
@satishbhattaraiable Ай бұрын
Great video, Thank you !!
No BS TS #3 - Typescript Functions with Functions
7:38
Jack Herrington
Рет қаралды 37 М.
Typescript Functions | Basics Tutorial for Beginners
32:12
Dave Gray
Рет қаралды 21 М.
人是不能做到吗?#火影忍者 #家人  #佐助
00:20
火影忍者一家
Рет қаралды 20 МЛН
Tuna 🍣 ​⁠@patrickzeinali ​⁠@ChefRush
00:48
albert_cancook
Рет қаралды 148 МЛН
FASTER JavaScript In 2025 With Sets
13:13
Jack Herrington
Рет қаралды 26 М.
C++ Super Optimization: 1000X Faster
15:33
Dave's Garage
Рет қаралды 334 М.
The different types of JavaScript functions explained
14:47
Kevin Powell
Рет қаралды 47 М.
Five Essential Design Patterns in Typescript
49:31
Jack Herrington
Рет қаралды 61 М.
Javascript's New Pipeline Operator Is Awesome!
7:26
Jack Herrington
Рет қаралды 7 М.
Mastering async code with Typescript and Javascript
39:01
Jack Herrington
Рет қаралды 79 М.
I Cannot Believe TypeScript Recommends You Do This!
7:45
Web Dev Simplified
Рет қаралды 181 М.
TypeScript in React - COMPLETE Tutorial (Crash Course)
53:21
ByteGrad
Рет қаралды 294 М.