1
00:00:02,090 --> 00:00:04,400
So to dive into JavaScript,

2
00:00:04,400 --> 00:00:08,370
let's get started by understanding Values.

3
00:00:08,370 --> 00:00:10,440
And what do I mean by that?

4
00:00:10,440 --> 00:00:12,400
When we write code,

5
00:00:12,400 --> 00:00:15,320
especially when we write JavaScript code,

6
00:00:15,320 --> 00:00:18,950
we typically have the intention of manipulating

7
00:00:18,950 --> 00:00:21,550
what the user sees on the screen.

8
00:00:21,550 --> 00:00:23,770
Outputting some texts, updating some texts,

9
00:00:23,770 --> 00:00:27,120
maybe outputting some number, anything like that.

10
00:00:27,120 --> 00:00:31,640
And therefore, we typically work with Values in our code.

11
00:00:31,640 --> 00:00:33,840
We might be working with some text,

12
00:00:33,840 --> 00:00:36,770
maybe some texts the user entered in an input,

13
00:00:36,770 --> 00:00:38,670
like we did it in this little demo,

14
00:00:38,670 --> 00:00:40,550
I showed you a couple of minutes ago,

15
00:00:40,550 --> 00:00:42,950
where we used that user input

16
00:00:42,950 --> 00:00:45,870
to then count the number of characters.

17
00:00:45,870 --> 00:00:49,268
And therefore, working with text or strings

18
00:00:49,268 --> 00:00:52,500
as it's called in programming, is very common.

19
00:00:52,500 --> 00:00:56,900
And that's a typical value we work with in JavaScript.

20
00:00:56,900 --> 00:00:58,280
Now, as a side note,

21
00:00:58,280 --> 00:01:01,940
I will say string from now on when I'm referring to text,

22
00:01:01,940 --> 00:01:04,937
because that's the official name of text values,

23
00:01:04,937 --> 00:01:09,937
it's called String because historically we always considered

24
00:01:10,330 --> 00:01:12,830
text to be a string of characters.

25
00:01:12,830 --> 00:01:16,100
And therefore, we call text Strings.

26
00:01:16,100 --> 00:01:20,130
And String Values are one key value type

27
00:01:20,130 --> 00:01:23,427
we work with all the time in programming.

28
00:01:23,427 --> 00:01:26,910
But another key value type would, for example,

29
00:01:26,910 --> 00:01:28,860
be numbers.

30
00:01:28,860 --> 00:01:32,510
That could be an age of a user or again,

31
00:01:32,510 --> 00:01:35,380
to come back to that example which I showed you,

32
00:01:35,380 --> 00:01:37,480
the length of that text.

33
00:01:37,480 --> 00:01:41,150
So the number of characters off the text the user entered,

34
00:01:41,150 --> 00:01:43,840
that of course would be a number.

35
00:01:43,840 --> 00:01:48,550
And numbers are another key value type we work with

36
00:01:48,550 --> 00:01:50,590
when we write code.

37
00:01:50,590 --> 00:01:53,560
And there other value types as well,

38
00:01:53,560 --> 00:01:55,630
which we are going to see throughout

39
00:01:55,630 --> 00:01:58,000
this course section and this course.

40
00:01:58,000 --> 00:02:02,450
But text, so strings and numbers are the two,

41
00:02:02,450 --> 00:02:05,050
I would say most important value types

42
00:02:05,050 --> 00:02:07,290
you work with all the time.

43
00:02:07,290 --> 00:02:08,449
And thankfully,

44
00:02:08,449 --> 00:02:11,990
they are quite straightforward to understand.

45
00:02:11,990 --> 00:02:14,810
And when we write JavaScript code,

46
00:02:14,810 --> 00:02:18,080
we often will be dealing with these values.

47
00:02:18,080 --> 00:02:21,220
We will be transforming text values,

48
00:02:21,220 --> 00:02:25,352
or we will be deriving number values or making mathematical

49
00:02:25,352 --> 00:02:28,223
calculations, anything like that.

50
00:02:29,070 --> 00:02:31,570
Now, when we work with values,

51
00:02:31,570 --> 00:02:35,820
we typically do that in the context of variables, though.

52
00:02:35,820 --> 00:02:39,690
And that's another key concept, which you by the way,

53
00:02:39,690 --> 00:02:43,330
will encounter in basically every programming language

54
00:02:43,330 --> 00:02:46,860
out there, not just in JavaScript.

55
00:02:46,860 --> 00:02:50,950
A variable is basically a box, a container.

56
00:02:50,950 --> 00:02:55,270
You could say variables are labeled data containers.

57
00:02:55,270 --> 00:02:57,070
And the idea is the following.

58
00:02:57,070 --> 00:02:58,870
If you have a certain value,

59
00:02:58,870 --> 00:03:02,730
let's say the text, the string, a user entered,

60
00:03:02,730 --> 00:03:04,870
or the length of that text.

61
00:03:04,870 --> 00:03:06,580
So a number.

62
00:03:06,580 --> 00:03:09,490
Then you might want to store that value in such

63
00:03:09,490 --> 00:03:13,220
a data container so that you can use it later on

64
00:03:13,220 --> 00:03:16,110
in your code, in a different operation.

65
00:03:16,110 --> 00:03:18,180
And you'll see this in action very soon.

66
00:03:18,180 --> 00:03:20,600
And then this will make more sense.

67
00:03:20,600 --> 00:03:23,720
But the idea is important that you have values,

68
00:03:23,720 --> 00:03:26,050
which you want to store in some data container

69
00:03:26,050 --> 00:03:28,110
so that you can use them later.

70
00:03:28,110 --> 00:03:32,620
Maybe, also multiple times in different calculations.

71
00:03:32,620 --> 00:03:36,130
And you do that with the help of such data containers,

72
00:03:36,130 --> 00:03:39,000
which also have names or labels,

73
00:03:39,000 --> 00:03:40,570
however you want to call it.

74
00:03:40,570 --> 00:03:44,440
Which you can choose as a developer to make sure that you

75
00:03:44,440 --> 00:03:47,760
can later reference the correct data container,

76
00:03:47,760 --> 00:03:48,910
if you needed.

77
00:03:48,910 --> 00:03:52,050
It's a little bit like putting an item into a box,

78
00:03:52,050 --> 00:03:54,070
let's say your tax documents,

79
00:03:54,070 --> 00:03:57,380
you put them into a box and you put a label on to that box

80
00:03:57,380 --> 00:03:59,800
that says tax documents.

81
00:03:59,800 --> 00:04:03,650
And if you then need those documents a year from now,

82
00:04:03,650 --> 00:04:07,110
or in two years, or at any other point of time,

83
00:04:07,110 --> 00:04:11,030
then you can just search for that box, thanks to that label,

84
00:04:11,030 --> 00:04:14,130
it should be easy to find and you can take the items,

85
00:04:14,130 --> 00:04:16,850
the tax documents, out of that box.

86
00:04:16,850 --> 00:04:21,040
And it's the same concept applied here in programming.

87
00:04:21,040 --> 00:04:22,670
But that's the theory.

88
00:04:22,670 --> 00:04:23,800
Let's see it in action.

89
00:04:23,800 --> 00:04:25,393
Let's see some concrete code.

