Skip to content

QuiWorks/fizz-buzz

Repository files navigation

<fizz-buzz>

Fizz Buzz is a simple programming exercise.

  • Write a web component that increments a counter when a button is clicked and displays that number.
  • For multiples of three display Fizz.
  • For multiples of five display Buzz.
  • For multiple of both three and five display FizzBuzz.
  • For extra credit use different dynamic values for Fizz and Buzz that are set using html attributes named fizz and buzz.

Basic Usage

<fizz-buzz></fizz-buzz>
<script type="module" src="fizz-buzz/fizz-buzz.js"></script>

Extra credit Usage

<fizz-buzz fizz="2" buzz="3"></fizz-buzz>
<script type="module" src="fizz-buzz/fizz-buzz.js"></script>

Steps to complete the exercise:

Install dependencies

npm i

Start the development server

npm run start

Write the code

src/FizzBuzz.js

test the code

npm run test

Requirements

  • nodejs version 8 and up
  • npm version 6 and up

This webcomponent follows the open-wc recommendation.

About

Web component fizz buzz

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published