Counter

Report a typo

Create a counter object that has the following properties:

  • current with a value of 0;
  • the inc function, which adds 1 to the current.

The function should return the value, not print it.

Write a program in JavaScript
// write your object here
___

Create a free account to access the full topic