1 00:00:00,430 --> 00:00:03,310 Let's create an object literal to hold various pieces 2 00:00:03,310 --> 00:00:05,350 of information about a person. 3 00:00:05,350 --> 00:00:08,050 To follow along, launch the workspace with this video or 4 00:00:08,050 --> 00:00:11,290 download the project files and use your preferred text editor. 5 00:00:11,290 --> 00:00:13,770 Open the file object.js. 6 00:00:13,770 --> 00:00:16,125 This file is already linked to index.html. 7 00:00:17,300 --> 00:00:22,320 First, declare a variable named person, and assign it a set of curly braces. 8 00:00:23,870 --> 00:00:27,010 These two curly braces represent the object. 9 00:00:27,010 --> 00:00:30,280 Now we'll add several property value pairs to the object. 10 00:00:30,280 --> 00:00:32,260 Let's start with the person's name. 11 00:00:32,260 --> 00:00:39,084 I'll indent this line, type the property name, a colon, and the value. 12 00:00:39,084 --> 00:00:46,853 Now this person object has a name property that's assigned the string value, Edward. 13 00:00:46,853 --> 00:00:51,551 I'll add another property by typing a comma, and on a new line, 14 00:00:51,551 --> 00:00:57,480 write another property name, city, and set its value to the string, New York. 15 00:00:59,980 --> 00:01:03,750 I've used two string values but you can use any type of value, like a number or 16 00:01:03,750 --> 00:01:04,770 a Boolean. 17 00:01:04,770 --> 00:01:10,090 For example, I'll define an age property and assign it the number 37. 18 00:01:10,090 --> 00:01:16,080 Then define a property named isStudent and assign it the value true. 19 00:01:16,080 --> 00:01:19,180 You can also set the value of an object's property to an array. 20 00:01:19,180 --> 00:01:24,978 For instance, I'll define a new property named skills, 21 00:01:24,978 --> 00:01:27,935 and set its value to an array, 22 00:01:27,935 --> 00:01:33,034 holding the strings, JavaScript, HTML and CSS. 23 00:01:36,024 --> 00:01:39,540 You can even set the value of an object's property to a function. 24 00:01:39,540 --> 00:01:41,130 You won't be doing that in this course, but 25 00:01:41,130 --> 00:01:43,510 you'll learn about it in a later course. 26 00:01:43,510 --> 00:01:47,780 Great, you've created a JavaScript object, but how do you start using it? 27 00:01:47,780 --> 00:01:49,430 I'll teach you how in the next video.