Back to Freecodecamp

Step 3

curriculum/challenges/english/blocks/workshop-library-manager/67116d7584d0b469b14579c0.md

latest1.8 KB
Original Source

--description--

Create another object inside the library array with the following properties and values:

PropertyValue
title"Atomic Habits"
author"James Clear"
about"A practical book about discarding bad habits and building good ones"
pages320

--hints--

You should have an object as the second item of your library array.

js
assert.isObject(library[1]);

Your object should have a title property.

js
assert.property(library[1], "title")

Your title property should have "Atomic Habits" as its value.

js
assert.propertyVal(library[1], "title", "Atomic Habits");

Your object should have an author property.

js
assert.property(library[1], "author")

Your author property should have "James Clear" as its value.

js
assert.propertyVal(library[1], "author", "James Clear");

Your object should have an about property.

js
assert.property(library[1], "about")

Your about property should have the value "A practical book about discarding bad habits and building good ones".

js
assert.propertyVal(library[1], "about", "A practical book about discarding bad habits and building good ones");

Your object should have a pages property.

js
assert.property(library[1], "pages")

The value of your pages property should be a number.

js
assert.isNumber(library[1]?.pages)

Your pages property should be set to 320.

js
assert.propertyVal(library[1], "pages", 320);

--seed--

--seed-contents--

js
const library = [
  {
    title: 'Your Next Five Moves: Master the Art of Business Strategy',
    author: 'Patrick Bet-David and Greg Dinkin',
    about: 'A book on how to plan ahead',
    pages: 320,
  },
--fcc-editable-region--
  
--fcc-editable-region--
];