I'll try to explain what TypeScript is briefly. All data has a type when we program something. For example, 5 is a number, "this-is-a-text" is a string, etc.
Javascript figures out the types by itself - so you never mention them in your code. That means if you write:
letx=5;
Javascript figures out it is a number. However, if we wrote:
letx="5"
Javascript will think it's a string, since we put 5 in quotation marks. This can mean in complicated applications, bugs can start to arise because we don't "enforce" types. For example "5" + "5" is 55, but 5 + 5 is 10.
Ideally, we would "enforce" "5" to be a number. TypeScript tries to fix this problem by adding types into Javascript, so they are all defined up front. Instead of the above, we write:
letx:number=5;
Now if "x" is not a number, we'll get an error. That way we can avoid bugs in our code.
native Android, hybrid iOS. will change to native iOS as soon as I get my hands on macOS. I write codes literally the entire day, if not, I'm looking at codes.
I'll try to explain what TypeScript is briefly. All data has a type when we program something. For example, 5 is a number, "this-is-a-text" is a string, etc.
Javascript figures out the types by itself - so you never mention them in your code. That means if you write:
Javascript figures out it is a number. However, if we wrote:
Javascript will think it's a string, since we put 5 in quotation marks. This can mean in complicated applications, bugs can start to arise because we don't "enforce" types. For example "5" + "5" is 55, but 5 + 5 is 10.
Ideally, we would "enforce" "5" to be a number. TypeScript tries to fix this problem by adding types into Javascript, so they are all defined up front. Instead of the above, we write:
Now if "x" is not a number, we'll get an error. That way we can avoid bugs in our code.
thank you so much