Exercise 1: Let's Shop

In this exercise, you will be required to define properties in an object.

We'll cover the following

Problem Statement

In this exercise, you are required to create an object for shopping products named product. This object should have the following properties:

  • name: a string denoting the name of the product.

  • price: an integer denoting the price of the product.

  • amount: an integer denoting the amount of that product bought.

  • madeIn: a string denoting the country that made the product.

For the purpose of this exercise, you can set these properties equal to whatever values you like.

Example

Sample values are given below:

  • name: Cheese

  • price: 20

  • amount: 10

  • madeIn: USA

Create a free account to access the full course.

By signing up, you agree to Educative's Terms of Service and Privacy Policy