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
fizzandbuzz.
<fizz-buzz></fizz-buzz>
<script type="module" src="fizz-buzz/fizz-buzz.js"></script><fizz-buzz fizz="2" buzz="3"></fizz-buzz>
<script type="module" src="fizz-buzz/fizz-buzz.js"></script>npm inpm run startsrc/FizzBuzz.jsnpm run test- nodejs version 8 and up
- npm version 6 and up
This webcomponent follows the open-wc recommendation.