SomeDer bfa5c26288 fix: use dfn instead of code tag (#36640)
* Use dfn tags

* remove misused <dfn> tags

* Revert "remove misused <dfn> tags"

This reverts commit b24968a96810f618d831410ac90a0bc452ebde50.

* Update curriculum/challenges/english/01-responsive-web-design/basic-html-and-html5/fill-in-the-blank-with-placeholder-text.english.md

Co-Authored-By: Randell Dawson <5313213+RandellDawson@users.noreply.github.com>

* Make "array" lowercase

Co-Authored-By: Randell Dawson <5313213+RandellDawson@users.noreply.github.com>

* Fix dfn usage

* Address last dfn tags
2019-10-27 12:45:37 -04:00

1.9 KiB

id, title, challengeType, forumTopicId
id title challengeType forumTopicId
587d7dac367417b2b2512b73 Create a Basic JavaScript Object 1 301317

Description

Think about things people see everyday, like cars, shops, and birds. These are all objects: tangible things people can observe and interact with. What are some qualities of these objects? A car has wheels. Shops sell items. Birds have wings. These qualities, or properties, define what makes up an object. Note that similar objects share the same properties, but may have different values for those properties. For example, all cars have wheels, but not all cars have the same number of wheels. Objects in JavaScript are used to model real-world objects, giving them properties and behavior just like their real-world counterparts. Here's an example using these concepts to create a duck object:
let duck = {
  name: "Aflac",
  numLegs: 2
};

This duck object has two property/value pairs: a name of "Aflac" and a numLegs of 2.

Instructions

Create a dog object with name and numLegs properties, and set them to a string and a number, respectively.

Tests

tests:
  - text: <code>dog</code> should be an object.
    testString: assert(typeof(dog) === 'object');
  - text: <code>dog</code> should have a <code>name</code> property set to a <code>string</code>.
    testString: assert(typeof(dog.name) === 'string');
  - text: <code>dog</code> should have a <code>numLegs</code> property set to a <code>number</code>.
    testString: assert(typeof(dog.numLegs) === 'number');

Challenge Seed

let dog = {

};

Solution

let dog = {
  name: '',
  numLegs: 4
};