Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 0a05516

Browse files
Update README.md
1 parent a4ff943 commit 0a05516

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

‎07 Objects/README.md‎

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,36 @@
1+
# JavaScript Objects
12

3+
- The most important thing about objects is to remember that they're just another variation of variables.
4+
5+
- Here is a quick example of an object:
6+
```
7+
var choosePill = {
8+
pillOne: 'Red',
9+
pillTwo: 'Blue'
10+
}
11+
```
12+
13+
#
14+
15+
- Here's a table displaying the code object we just wrote:
16+
17+
|Property |Stored Value|
18+
|--|---|
19+
|pillOne |Red|
20+
|pillTwo |Blue|
21+
22+
- Even though we only stored strings (you can remember strings based on the quotations), we can also store numbers. Here is our same code, updated:
23+
```
24+
var choosePill = {
25+
pillOne: 'Red',
26+
pillTwo: 'Blue',
27+
numberOfPills: 2
28+
}
29+
var choice = choosePill.pillOne; // This will access the Objects property
30+
```
31+
32+
|Property| Stored Value|
33+
|--|--|
34+
|pillOne |Red|
35+
|pillTwo |Blue|
36+
|numberOfPills| 2|

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /