1
2
3
4
5
6
7
8
9
10
To practice on your own, or to check code you believe shouldn't have been scored as incorrect, go to CodePen.
0,1,2,3,4,5,6,7,8,9
0
0
0
0
A function that's part of an object definition is a _____. | method | method | |
A method is a _______ of an object. | property | property | |
Complete this first line for a method named calc. | ________ function() { | calc: | calc: |
Code the first line for a method named calc. | calc: function() { | calc:function\(\){ | |
Code the first line of a method definition. Make up the name of the method. | capitalize: function() { | [a-z_$][a-zA-Z0-9_$]*:function\(\){ | |
Call a method, assigning the returned value to a variable. Make up all the names. | let result = planet.distance(); | let[a-z_$][a-zA-Z0-9_$]*=[a-z_$][a-zA-Z0-9_$]*\.[a-z_$][a-zA-Z0-9_$]*\(\); | |
Instead of using the object's identifier when referring to a property, a method uses the keyword _____. | this | this | |
Code a method definition. The method displays a property of the object in an alert. Make up everything. | display: function() { alert(this.color); } |
[a-z_$][a-zA-Z0-9_$]*:function\(\){[\r\n]alert\(this\.[a-z_$][a-zA-Z0-9_$]*\);[\r\n]} | |
|
|||
|