Skip to content

Latest commit

 

History

History
24 lines (17 loc) · 381 Bytes

File metadata and controls

24 lines (17 loc) · 381 Bytes

Simple multiplication Code Wars Problem Solution.

/*
    *
    * Prosen Ghosh
    * American International University - Bangladesh (AIUB)
    *
*/

Problem:

This kata is about multiplying a given number by eight if it is an even number and by nine otherwise.

Solution:

function simpleMultiplication(n){
    return n % 2 ? n * 9 : n * 8;
}