1 00:00:00,000 --> 00:00:04,954 [MUSIC] 2 00:00:04,954 --> 00:00:07,830 In the last stage, I talked about strings. 3 00:00:07,830 --> 00:00:09,970 A string is a series of letters, numbers and 4 00:00:09,970 --> 00:00:12,930 other characters enclosed in quote marks. 5 00:00:12,930 --> 00:00:16,490 Strings are one type of data you'll work with in JavaScript. 6 00:00:16,490 --> 00:00:20,140 Another type of information you'll encounter frequently is a number. 7 00:00:20,140 --> 00:00:22,220 You use numbers to perform calculations, 8 00:00:22,220 --> 00:00:26,200 like determining the total cost of items in a shopping cart. 9 00:00:26,200 --> 00:00:29,140 Or adding points to a player's score in a game. 10 00:00:29,140 --> 00:00:32,260 Or keeping track of the number of seconds passed since the visitor 11 00:00:32,260 --> 00:00:34,160 performed a certain action. 12 00:00:34,160 --> 00:00:39,398 In JavaScript, numbers can be whole numbers called integers, 13 00:00:39,398 --> 00:00:44,157 like [SOUND] five, zero, negative 100, 9,999. 14 00:00:44,157 --> 00:00:50,086 Or numbers with decimal points to represent fractions of a whole number, 15 00:00:50,086 --> 00:00:55,650 like 3.14 or negative 9.88888 or 0.0000009. 16 00:00:55,650 --> 00:01:00,960 Numbers like these with decimal points are also called floating point numbers. 17 00:01:00,960 --> 00:01:06,100 JavaScript even lets you use scientific notation to represent really large or 18 00:01:06,100 --> 00:01:07,321 really small numbers. 19 00:01:07,321 --> 00:01:11,651 Just [SOUND] as with string values, you can put a number in a variable or 20 00:01:11,651 --> 00:01:14,878 assign a number to a variable using the equal sign. 21 00:01:14,878 --> 00:01:21,584 [SOUND] Unlike strings, however, you don't put quote marks around a number. 22 00:01:21,584 --> 00:01:24,730 If you do, then you have a string, not a number. 23 00:01:24,730 --> 00:01:27,690 This is a confusing part of working with strings and numbers. 24 00:01:27,690 --> 00:01:29,390 So in this line of code, 25 00:01:29,390 --> 00:01:33,730 the value stored in the variable aString isn't the number 10. 26 00:01:33,730 --> 00:01:38,192 It's a string made up of the character 1 followed by 0. 27 00:01:38,192 --> 00:01:40,314 This [SOUND] can lead to some weird and 28 00:01:40,314 --> 00:01:44,995 confusing behavior, like making some math operations not work as expected. 29 00:01:44,995 --> 00:01:48,017 We'll look at how to convert a string containing a number into 30 00:01:48,017 --> 00:01:51,080 an actual number in a later video in this stage. 31 00:01:51,080 --> 00:01:55,210 But just keep this in mind, a number inside quotes isn't really a number.