1 00:00:00,180 --> 00:00:02,385 Now that you've added a method to the object literal, 2 00:00:02,385 --> 00:00:05,600 your task was to practice calling this method. 3 00:00:05,600 --> 00:00:08,360 After the object, you were asked to create a variable and 4 00:00:08,360 --> 00:00:11,740 set it to the return value from the countWords method. 5 00:00:11,740 --> 00:00:13,300 Let's declare the variable. 6 00:00:13,300 --> 00:00:16,178 I'll call it numWords, but any variable name would work. 7 00:00:20,151 --> 00:00:24,707 Now, if you recall, to access a property on an object or to call one of its methods 8 00:00:24,707 --> 00:00:29,531 using dot notation, you write the name of the object, which in our case is myString, 9 00:00:29,531 --> 00:00:32,881 because that's the variable that the object is stored in, 10 00:00:32,881 --> 00:00:36,648 followed by a dot, followed by the name of the property or method. 11 00:00:39,915 --> 00:00:43,939 Dot notation isn't the only way to access an object's properties or methods, 12 00:00:43,939 --> 00:00:46,140 you can also use bracket notation. 13 00:00:46,140 --> 00:00:49,669 So I'll edit the code to show you how to do this with bracket notation, too. 14 00:00:56,417 --> 00:01:00,017 Both dot and bracket notation are acceptable to use when working with 15 00:01:00,017 --> 00:01:03,130 objects, but I find dot notation easier to read and write.