TypeScript Tutorial #4 - Objects & Arrays

preview_player
Показать описание
Hey gang, in this TypeScript tutorial we'll learn about objects & arrays.

🐱‍👤🐱‍👤 JOIN THE GANG -
----------------------------------------
🐱‍💻 🐱‍💻 My Udemy Courses:

🐱‍💻 🐱‍💻 Course Files:

🐱‍💻 🐱‍💻 Other Related Free Courses:

🐱‍💻 🐱‍💻 TypeScript Docs:

🐱‍💻 🐱‍💻 The Net Ninja Community Boards:
Рекомендации по теме
Комментарии
Автор

I don't speak English fluently. I live in africa specifically in Mozambique.

But I was only able to learn javascript / typescript on this channel once and for all. Congratulations.

Please don't stop making videos.

albrtinoaugusto
Автор

If you really want to...

To initiate an array variable that can take any value types:
let myArray = []
Then you can push values of any type to that array.

Likewise, to initiate an object variable that can any object:
let myObject = {}
Then you can set it to objects that contains different properties.
myObject = {
FirstName: 'James'
}
myObject = {
LastName: 'Sam',
EnrollDate = new Date()
}

conaxlearn
Автор

Wow. I was constantly wating for these tutorials

MaxProgramming
Автор

Consistently well-explained, as always.

garikmelqonyan
Автор

Please go with basic to advanced typescript tutorial 😃😃😃😃😃

hkdelhivlogs
Автор

really sean sometimes i am thinking about to subscribe to your cheannel agian, since i cleaned up my suscriber-list from many youtube-uploaders wich use music and bad content in theire videos. Today i watched the first time a video of you again and remembered why u were my favorite programming-youtuber in my past.

there are about 8 conditions wich i used to focus on when i was sorting out many uploaders out of my subscriber-list.

when it came to you, it became difficult because it was only 1 point wich didnt fit the my conditions.

to be honest these kinds of videos like this Typescript-Tutorial are just nice and professional ... exacly the way i love and exacly a way most of people could not complain about anything.

No Music
no respectless speech or making fun of any groups or nations
no halfnaked women wich always be faded in
no topic from your daylife wich anyways dont got anything todo with the main thing.
no making fun of religion or racism or something like that.

this is a great and professional video likewise many of yours

please keep this format.

thanks and please dont get me wrong.

nanibanani
Автор

Some Egs I tried on my own might be helpful

//No error from type script
let numbers: any = [1, 2, 3, 4]
numbers.push("Five")
console.log(numbers)

//No error from type script
let person: any = {
"name": "mario",
"gender": "M",
"age": 25,
"profession": "coder",
}
person.age = "Twenty-Five year(s)"
person.skills = [ "JS", "TS", "HTML", "CSS", ]
console.log(person)

sistasubramanyam
Автор

The gang here eagerly waiting for awesomeness 💻

fortunatmutunda
Автор

im pretty sure you can add properties onto objects. this video is 3 years old, maybe this is a feature that was added more recently but right now, im like 100% sure you can do it

maxxxmckenzy
Автор

Are concepts like polymorphism, design patterns, Swing/Awt package in Java used the same way in TypeScript?

OnutcOme
Автор

Awesome videos! the best instructor on YT!

JP-vqer
Автор

what theme is that...?
amazing vids btw!

osamaasender
Автор

In the case of empty arrays >>
let emptyArray: any[ ] = [ ];
emptyArray.push(1); // Now the array is a numeric array
emptyArray.push("hello"); // Now it becomes a mixed array with a number and a string
emptyArray.push({ key: "value" }); // Now it becomes a mixed array with an object added too

RodRavenpictures
Автор

But.... typescript is apparently not forcing you to define the type of the numer for the PI function. Meaning it will still allow you to compile breaking code. I think it should force you to always assign a type.

mytzenka
Автор

Ty for this. Would ya do Nuxt after this pls

twootwo
Автор

Hi Shaun, thanks a lot for the tutorials. You mentioned that if there is a type related error, the TypeScript compiler doesn't let you compile. However, my sandbox.js file is always updated whether or not there is an error before/during compilation of the .ts file. E.g. I manage to overwrite the first item of my names array with a number and can see the result logged in my live server, although there was a warning during compilation. Does that make sense?

superpaul
Автор

why tsc is compile even it`s wrong.For example i changed string to number but i can see result string changed to number.its difference was in this aspect?

mustafoyakubov
Автор

Im starting to prefer TS over JS because of its restrictions, it erases many bad practices as well as you have tested in the video, like changing completely values of variables i.e object to array and stuff.

Toulkun
Автор

Anime / Cartoon fan much? Mario bros and Street Fighter characters :D

kjn
Автор

So i have an object :
let game = {
window_size:150,
window_name:"Hello User!",
shldStart:false
}


Now game["version"] = 9.0 //throws no error during compiling
but game[version] = 9.0 or game.version = 9.0 throws an error.
Why?

kewtomrao