@4824sk7/fizzbuzz 中文文档教程
fizzbuzz
FizzBuzz 的 JavaScript 实现。
Installation
$ npm install @4824sk7/fizzbuzz
Usage
In JavaScript code
const fizzbuzz = require('@4824sk7/fizzbuzz')
fizzbuzz(1) // '1'
fizzbuzz(2) // '2'
fizzbuzz(3) // 'Fizz'
fizzbuzz(5) // 'Buzz'
fizzbuzz(15) // 'FizzBuzz'
From the command line
$ npx fizzbuzz 1
1
$ npx fizzbuzz 2
2
$ npx fizzbuzz 3
Fizz
$ npx fizzbuzz 5
Buzz
$ npx fizzbuzz 15
FizzBuzz
fizzbuzz
A JavaScript implementation of FizzBuzz.
Installation
$ npm install @4824sk7/fizzbuzz
Usage
In JavaScript code
const fizzbuzz = require('@4824sk7/fizzbuzz')
fizzbuzz(1) // '1'
fizzbuzz(2) // '2'
fizzbuzz(3) // 'Fizz'
fizzbuzz(5) // 'Buzz'
fizzbuzz(15) // 'FizzBuzz'
From the command line
$ npx fizzbuzz 1
1
$ npx fizzbuzz 2
2
$ npx fizzbuzz 3
Fizz
$ npx fizzbuzz 5
Buzz
$ npx fizzbuzz 15
FizzBuzz