All files / src/package2 ifElse.js

36.36% Statements 4/11
62.5% Branches 5/8
33.33% Functions 1/3
40% Lines 4/10

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28          2x 1x   1x   2x                                  
// ifElse.js
 
export function ifElse( param )
{
 
    if( param )
        console.log( param )
    else
        console.log( 'param is missed' )
 
    return ( param ? `param is: ${ param === 1 ? 'one' : toString(param) }` : "param is missing" )
}
 
function toString( p, r )
{
    if( p > 10 )
    {
        return notTested( p )
    }
    return p;
}
 
function notTested(p)
{
    const a = p*10, b = p*20;
    console.log(p,a,b)
    return p;
}