What is strict typing in TypeScript - Writing your first TypeScript program

preview_player
Показать описание
What does strict Typing actually mean in TypeScript? How does it improve the quality of your code? We look at answers to all these questions in this video. This helps us understand why using TypeScript can prove to be a boon for your javaScript projects.

📖 Video Chapters
00:00 Video Intro
00:38 Writing a simple JavaScript Function
03:30 How TypeScript helps to prevent errors
04:42 Convert JavaScript code to TypeScript
07:10 Compiling TypeScript Files

🔥🔥 FREE JavaScript Cheat Sheet 🔥🔥

👾 Subscribe For More Tutorials 👾

📓 TypeScript Complete Course 📓

🌟 Exciting And Insightful Content About JavaScript 🌟
Рекомендации по теме
Комментарии
Автор

Not a big deal, but around 3:30 you've got "a simple function we have written in JavaScript", but, as I think you imply, the function call isn't valid JavaScript. Your IDE isn't just "suggesting" you use named parameters (what extension is that?) it's also forcing that code to become TypeScript code *which is no longer valid JavaScript*. If you try console.log(sum(a: 2, b: 3)), you'll get "Uncaught SyntaxError: missing ) after argument list" or similar.

Again, not a big deal, but even though you said, "Don't be confused by this", I was! I think it's worth making the distinction: Even though it's a *.js file and we're showing how TS differs from JS, this is *not* valid JavaScript syntax. It only works because you're working with TypeScript.

2¢ etc. Otherwise the '2' + '3' is an excellent simplest case example of why TypeScript is useful. Appreciate the video.

ruffin