Skip to content

valyadvorzhak/ES6-homework

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ES6 Homework

You have to modify file index.js and create the methods for Shop Cart:

  • add(item, count) – method should add the item to the cart;
  • remove(item) – method should remove the item from the cart;
  • clear() – method should clear the cart (remove all items);
  • setCount(item, count) – method should change quantity for item. If the method receive count below or equal zero, then it should throw Exception;

Important! You should change only index.js file.

To check your work we created a file with Jest tests. You can run tests with npm command: npm run test.

Your work will be successful if all tests are green.

About

homework-2_Dvorzhak

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%