- 1

Access the "color" property of the"hair"object using dot syntax.

what is answer this q pls tell me any body

27th Mar 2017, 4:47 AM
vikas
vikas - avatar
7 Réponses
+ 6
hair.color Or hair['color']
27th Mar 2017, 4:52 AM
Ashwani Kumar
Ashwani Kumar - avatar
0
There are two ways of accessing the object, either through the dot syntax or bracket notation. Dot Syntax refers to using the object then a . afterwards. The previous used the example of document.write Bracket notation requires the object to be on the outside of the bracket for example document['write'] For this question you have been asked to write using dot syntax , therefore the answer is: hair.color hair is the object (like in the example document is the object) color is the property you are trying to access (like write in the example, although that was a method but it essentially wanted to be attached to the object, just like the property color). Hope this makes it a bit clearer. :)
3rd May 2017, 4:23 PM
Olivia Boertje
Olivia Boertje - avatar
0
hair.color Answer
7th Oct 2022, 10:21 AM
MAJEED ABDUL-RAZAQ OLUBODE
MAJEED ABDUL-RAZAQ OLUBODE - avatar
0
hair.color
1st Nov 2022, 11:32 AM
Olamipo Temowo
Olamipo Temowo - avatar
0
hair.color hair['color']
23rd Aug 2023, 2:47 AM
emmy WKD
emmy WKD - avatar
- 1
not correct answer
27th Mar 2017, 12:41 PM
vikas
vikas - avatar
- 1
hair.color
16th Feb 2019, 10:17 AM
اسد اللہ
اسد اللہ - avatar