Co.Create Club
Join Co.Create Club
f

fajariawan

Foo = Faktorial

Param = input value faktorial

Expected = Output value faktorial

 

Const param = 0;

Const expected = 1;

ToEqual => " 1= 1 "

 

Const param = 1;

Const expected = 1;

ToEqual => " 1×1 = 1 "

 

Const param = 2;

Const expected = 2;

ToEqual => " 1×2 = 2 "

 

Const param = 3;

Const expected = 6;

ToEqual => " 1x2x3 = 6 "

 

Const param = 5;

Const expected = 120;

ToEqual => " 1x2x3x4x5 = 120 "

 

const bar = {num} =>

{

if (num<2)

{

return 1;

}

return________;

}

artinya =

" input value kurang dari atau sama dengan 2,

value output = value input “

30 August, 2019 Like ( 0 )
Share

Join the community, Be a Co.Creator!

Dapatkan informasi, solusi, dan berbagi cerita menarik dengan Co.Creator lainnya.