Skip to content

nan-ci/beta-01-E02

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Strength by Numbers

RULES

You can't use *.
You can't use /.
You can't use %.
You can't use require.
You can't use Math.
You can't use toString.
You can't use String.
You can't use Number.
You can't use parseInt.
You can't use toFixed.
(However can use +, -, >, <, =, and other stuff)

TESTS

add

export the function add that takes two number arguments and returns the result of the addition of those two.

sub

export the function sub that takes two number arguments and returns the result of the substraction of those two.

abs

export the function abs that takes one number argument and returns it's absolute value.

max

export the function max that returns the bigest of the two given number arguments.

min

export the function min that returns the smallest of the two given number arguments.

sign

export the function sign that takes one number argument and return 1 if the number is positive, -1 if then number is negative and 0 if the number is exactly 0

sameSign

export the function sameSign that takes two number arguments and returns true if they have the same sign.

multiply

export the function multiply that takes two number arguments and returns the result of the multiplication of those two.

modulo

export the function modulo that takes two number arguments and returns the result of the remainder of an euclidean division between those two, just like the remainder operator.

divide

export the function divide that takes two number arguments and returns the result of the quotient of an euclidean division between those two.

ceil

export the function ceil that should work just like Math.ceil

floor

export the function floor that should work just like Math.floor

round

export the function round that should work just like Math.round

trunc

export the function trunc that should work just like Math.trunc

odd

export the function odd takes one number argument and return true if it's an odd number

even

export the function even that should work just like Math.even

BONUS

bonus rule no block statement

You didn't made any blocks, only arrow functions.

bonus rule no loops

Use recursion instead of loops

About

Second day of the first beta

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published