1
00:00:01,190 --> 00:00:02,460
Welcome Ken.

2
00:00:02,500 --> 00:00:03,310
This video.

3
00:00:03,340 --> 00:00:14,700
I will introduce you to some javascript data taps program in general and also in javascript that data

4
00:00:14,720 --> 00:00:26,340
types basically refers to the classification that specifies the type of value that a variable has or

5
00:00:26,430 --> 00:00:27,640
stauss.

6
00:00:27,660 --> 00:00:34,370
There are different types of data types in javascript.

7
00:00:34,710 --> 00:00:40,040
Here's a basic table with some basic javascript data.

8
00:00:40,330 --> 00:00:43,390
Some are going to start with the top one which is this trend.

9
00:00:43,620 --> 00:00:50,880
This trend basically is a sequence of text that must be enclosed in quotes.

10
00:00:50,880 --> 00:00:56,550
You can use either single quotes or double quotes but you cannot mix the quotes.

11
00:00:56,640 --> 00:01:03,390
For example here you can declare variable call my data and set it to this value you can see I've got

12
00:01:03,450 --> 00:01:05,340
quotes around it.

13
00:01:05,850 --> 00:01:11,720
I've got my web console open so all the way to access your WAP web console.

14
00:01:11,730 --> 00:01:20,040
If you want a Windows computer open up just Google homepage and type in control shift and Jay on your

15
00:01:20,040 --> 00:01:21,570
keyboard.

16
00:01:21,720 --> 00:01:23,010
F 12.

17
00:01:23,020 --> 00:01:25,770
And that would give you access to the Web console.

18
00:01:26,010 --> 00:01:34,060
If you own a Mac you do command shift and G that would give you access to the console.

19
00:01:34,110 --> 00:01:40,750
So let's create a simple variable that will store string data type.

20
00:01:40,860 --> 00:01:50,840
So my console I'm going to create a new variable by typing in the key word the word variable.

21
00:01:50,940 --> 00:01:54,340
My colours.

22
00:01:55,800 --> 00:01:59,270
Okay and I'm going to give it value.

23
00:01:59,870 --> 00:02:03,390
Going to give this value or read

24
00:02:06,240 --> 00:02:12,870
so that's a value you can see having closed the value in quotes which means if this string data type

25
00:02:12,900 --> 00:02:16,970
computer will recognize that has a string data type.

26
00:02:17,070 --> 00:02:25,740
So if I want to reference this variable all I need to do is call it by its name an 8 or just return

27
00:02:25,910 --> 00:02:28,400
the value read.

28
00:02:28,470 --> 00:02:37,290
So that's a simple example of how a string data type can be used to not next data type I want to mention

29
00:02:37,430 --> 00:02:47,970
is the number data that basically refers to any numerical value and it does not need to have a quote

30
00:02:48,090 --> 00:02:50,260
around its value.

31
00:02:50,450 --> 00:02:59,580
So let me illustrate my a simple variable that will store in no data type so I'll declare a simple variable

32
00:03:00,420 --> 00:03:07,040
by typing in the key word var and call this variable door

33
00:03:10,540 --> 00:03:17,850
number and I'll give it a value of 7.

34
00:03:18,240 --> 00:03:23,350
So this is known has no data type.

35
00:03:23,340 --> 00:03:26,280
He can see he doesn't need quotes around it.

36
00:03:26,280 --> 00:03:32,660
So if I want to reference the variable i just call it by name number.

37
00:03:32,990 --> 00:03:40,280
It will return the value of 7 to next data type.

38
00:03:40,290 --> 00:03:43,570
I want to mention is called the boolean.

39
00:03:43,630 --> 00:03:47,220
It basically represents two values.

40
00:03:47,250 --> 00:03:48,460
One can be true.

41
00:03:48,590 --> 00:03:52,470
The other can be force and we're using boolean values.

42
00:03:52,470 --> 00:03:58,230
No quotes require required to illustrate boolean value.

43
00:03:58,230 --> 00:04:00,660
I'm just going to compare two values.

44
00:04:00,660 --> 00:04:11,880
I'm going to say four is greater than three that will return true and if I say.

45
00:04:13,010 --> 00:04:20,300
Three is greater than 4 and that will return false.

46
00:04:20,510 --> 00:04:25,190
So that's basically how bullion value data types work.

47
00:04:26,040 --> 00:04:35,810
The next data type I want to mention is called and I read an array is a data structure that stores multiple

48
00:04:35,820 --> 00:04:40,140
values as one single reference.

49
00:04:40,140 --> 00:04:43,740
Basically what that means is variable can store only one value.

50
00:04:44,190 --> 00:04:50,970
But we don't agree you can store multiple values as one single reference.

51
00:04:50,970 --> 00:04:55,530
You can see here and with two values here and two are attack.

52
00:04:55,800 --> 00:05:00,340
But I am referencing it under one variable called my class.

53
00:05:00,420 --> 00:05:04,700
So let me show you a quick illustration inside the cons..

54
00:05:04,860 --> 00:05:16,570
Someone to declare a variable called my class and I'm going to set it to the course too.

55
00:05:16,650 --> 00:05:23,820
This is how you declare an array with square brackets and inside the square brackets is where you place

56
00:05:23,820 --> 00:05:24,840
the values.

57
00:05:24,900 --> 00:05:28,830
So let's say the fair value of C is Ford.

58
00:05:30,490 --> 00:05:36,680
And so on value I see is a way to heal.

59
00:05:38,550 --> 00:05:46,690
When you are using a phrase you separate each of the values with a comma not only where you don't need

60
00:05:46,690 --> 00:05:49,080
a comma it's a very last value.

61
00:05:49,150 --> 00:05:52,990
So this is a key here is.

62
00:05:53,620 --> 00:05:59,650
And the way you access values in an array is via the index.

63
00:05:59,650 --> 00:06:04,250
So the way narey is for reference is by the index.

64
00:06:04,330 --> 00:06:07,540
So this will be known as an index.

65
00:06:07,540 --> 00:06:09,920
This will be one if you have several.

66
00:06:09,940 --> 00:06:14,030
You can have as many as possible inside the square brackets.

67
00:06:14,260 --> 00:06:20,260
You need to separate the values with a comma and then they are obvious trade data type you include it

68
00:06:20,290 --> 00:06:21,190
in quotes.

69
00:06:21,290 --> 00:06:24,980
If they're not then you don't need to enclose it in quotes.

70
00:06:25,130 --> 00:06:33,260
So for example if I wanted to access value number one this is zero and zero which is flawed.

71
00:06:33,490 --> 00:06:38,550
All I need to do is type in my comments.

72
00:06:42,130 --> 00:06:43,560
In my case.

73
00:06:44,050 --> 00:06:47,940
Type in my car's been in square brackets.

74
00:06:48,330 --> 00:06:53,300
I type in value 0 We pool represents the index.

75
00:06:53,320 --> 00:07:01,600
I'm trying to target that return because it has returned forward so that's how you if I had like 20

76
00:07:01,600 --> 00:07:10,520
inside here how referencing fibre index based that number so for the fair value is a zero index to it

77
00:07:10,520 --> 00:07:12,010
I would be index number one.

78
00:07:12,280 --> 00:07:17,410
So that's how you access the values in an array.

79
00:07:17,620 --> 00:07:24,910
So the key difference between an array variable is that an array can store multiple values as one value.

80
00:07:25,280 --> 00:07:33,750
If you see here I just got this variable called my columns and is only one value here.

81
00:07:33,840 --> 00:07:42,040
Quite a record my car's only stores multiple values by reference as a single values for my class and

82
00:07:42,430 --> 00:07:43,180
data type.

83
00:07:43,180 --> 00:07:49,930
I want to quickly mention it's called The Opposite everything in Javascript is physically an object

84
00:07:49,930 --> 00:08:01,780
so all the examples I've shown so far are basically objects can also represent javascript objects with

85
00:08:01,960 --> 00:08:03,900
curly braces as I've done here.

86
00:08:03,920 --> 00:08:09,700
I have declared a variable code person set the value to cause to the first name.

87
00:08:09,850 --> 00:08:16,770
Got John last name doe so you can represent an object like this as well.

88
00:08:16,880 --> 00:08:20,480
But by using curly braces.

89
00:08:21,460 --> 00:08:29,860
So if I wanted to access this object here all I need to do is call the variable by its name and it will

90
00:08:29,860 --> 00:08:35,360
return the His Return the first name as John last name.

91
00:08:35,360 --> 00:08:40,980
As do the data type I want to introduce you to code Norton.

92
00:08:41,080 --> 00:08:46,690
You may come across this in your learning with a script.

93
00:08:46,880 --> 00:08:52,620
Basically no data type is something that does not exist.

94
00:08:52,660 --> 00:08:59,790
You can also use a normal day at a time to empty the value of a variable.

95
00:09:00,230 --> 00:09:09,920
And normal is also an object data type so it can see here I've got a variable here called Door number

96
00:09:10,870 --> 00:09:12,970
with a value of 7 to Y.

97
00:09:13,090 --> 00:09:21,000
Empty that value by just typing in the name of the variable which is no.

98
00:09:21,440 --> 00:09:33,580
Setting the value to not and now empty the Quien data it stored so if I call it variable chord number

99
00:09:33,580 --> 00:09:41,130
now it will come back same long because I emptied out whatever it was storing.

100
00:09:41,200 --> 00:09:45,400
Okay so no data type means basically nothing.

101
00:09:45,400 --> 00:09:49,990
He doesn't stop anything there's nothing in that final data type.

102
00:09:49,990 --> 00:09:56,530
I want to talk about is called On defined and defined is Simmon still not.

103
00:09:56,740 --> 00:10:07,060
The only difference is that the different data type on defined is defined in no data type is also an

104
00:10:07,180 --> 00:10:09,670
object data type.

105
00:10:09,730 --> 00:10:15,010
If you declare a variable and you don't give it a value that will become undefined for example if I

106
00:10:15,050 --> 00:10:20,230
can't see variable suites.

107
00:10:23,350 --> 00:10:25,200
I don't give you any value.

108
00:10:26,550 --> 00:10:31,830
That we become on defined if I tried to call it by its name.

109
00:10:32,060 --> 00:10:33,890
It'll come back on defiant.

110
00:10:33,980 --> 00:10:36,800
So that's a key difference.

111
00:10:36,810 --> 00:10:44,840
Give friend between no and undefined is that undefined is not hard to type while.

112
00:10:46,440 --> 00:10:49,360
Is object to time.

113
00:10:49,620 --> 00:10:55,690
So that's basically it for this video on Javascript datatypes.

114
00:10:55,730 --> 00:10:56,900
Thanks for watching.

115
00:10:56,910 --> 00:10:57,810
Bye for now.
