2018-10-12 15:37:13 -04:00
|
|
|
---
|
|
|
|
title: Create a Basic JavaScript Object
|
|
|
|
---
|
2019-07-24 00:59:27 -07:00
|
|
|
# Create a Basic JavaScript Object
|
2018-10-12 15:37:13 -04:00
|
|
|
|
2019-07-24 00:59:27 -07:00
|
|
|
---
|
|
|
|
## Problem Explanation
|
2018-10-12 15:37:13 -04:00
|
|
|
|
|
|
|
The soultion to this problem is more or less identical to the example given.
|
|
|
|
Give the `dog` object two new properties - `name` and `numLegs` - and set them to a string and a number, respectively.
|
|
|
|
|
|
|
|
|
2019-07-24 00:59:27 -07:00
|
|
|
---
|
|
|
|
## Solutions
|
2018-10-12 15:37:13 -04:00
|
|
|
|
2019-07-24 00:59:27 -07:00
|
|
|
<details><summary>Solution 1 (Click to Show/Hide)</summary>
|
|
|
|
|
|
|
|
```javascript
|
2018-10-12 15:37:13 -04:00
|
|
|
let dog = {
|
|
|
|
name: "George",
|
|
|
|
numLegs: 4
|
|
|
|
};
|
|
|
|
```
|
2019-07-24 00:59:27 -07:00
|
|
|
|
|
|
|
</details>
|