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)
export the function add
that takes two number arguments
and returns the result of the addition of those two.
export the function sub
that takes two number arguments
and returns the result of the substraction of those two.
export the function abs
that takes one number argument
and returns it's absolute value.
export the function max
that returns the bigest of the two
given number arguments.
export the function min
that returns the smallest of the two
given number arguments.
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
export the function sameSign
that takes two number arguments
and returns true if they have the same sign.
export the function multiply
that takes two number arguments
and returns the result of the multiplication of those two.
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.
export the function divide
that takes two number arguments
and returns the result of the quotient of an euclidean division between those two.
export the function ceil
that should work just like
Math.ceil
export the function floor
that should work just like
Math.floor
export the function round
that should work just like
Math.round
export the function trunc
that should work just like
Math.trunc
export the function odd
takes one number argument and return true if it's an odd number
export the function even
that should work just like
Math.even
You didn't made any blocks, only arrow functions.
Use recursion instead of loops