freeCodeCamp/guide/english/certifications/javascript-algorithms-and-d.../object-oriented-programming/create-a-basic-javascript-o.../index.md

21 lines
377 B
Markdown
Raw Normal View History

2018-10-12 19:37:13 +00:00
---
title: Create a Basic JavaScript Object
---
## Create a Basic JavaScript Object
### Method:
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.
### Solution:
```javascript
let dog = {
name: "George",
numLegs: 4
};
```