Ad
  • Custom User Avatar

    added example tests for js.

  • Custom User Avatar
    1. I guess not (pretty sure of that)

    2. if you post an issue, please provide:

    • the language used
    • the failure message

    Those are the strict minimum.

  • Custom User Avatar

    The same happened to me today!

  • Custom User Avatar

    Veriable should belongs to function in this webside

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    I don't know if the tests for this are broken or if I made a mistake, but something is wrong. The code I wrote inside a different text editor works great and gives me the expected years when I checked it against the test cases. However, when I run it through the codewars editor, the tests come back undefined. Can anyone help? Here's my code:

    var years = 0;
    function calculateYears(principal, interest, tax, desired) {
    if(principal < desired){
    var interestEarned = principal * interest;
    var taxAmount = interestEarned * tax;
    var net = interestEarned - taxAmount
    principal += net;
    years ++;
    calculateYears(principal, interest, tax, desired)
    }else{
    return years
    }
    }