You need to sign in or sign up before continuing.×
6 kyu

Typer.js

673 of 887Jim-Y
Description
Loading description...
Fundamentals
  • Please sign in or sign up to leave a comment.
  • farhanaditya Avatar

    Object team anyone? I'm surprised almost everyone follow the pre-written codes and use an IIFE instead of just creating an object.

  • FArekkusu Avatar

    NaN is a number too. If you want isNumber to return false instead, this has to be mentioned somewhere.

  • F-12 Avatar

    This comment has been hidden.

  • MaxPleaner Avatar

    for some reason def self.is_exception?(arg); arg.is_a? Exception; end didn't work for me. What did work was to traverse the whole tree of classes which descend from Exception and then test the arg's class against that whole list.

  • LayZee Avatar

    CoffeeScript initial setup of typer does not match JavaScript version.

  • ethansure Avatar

    NoMethodError is_a? Exception => false , so Many previous solutions is not right. Test cases should be improved.

    I don't think is a good kata..

  • manfeyn Avatar

    Hi, I am using Ruby and I found the following codes would pass the Test Cases.

    def is_number? a; a.is_a? Fixnum; end

    The Numeric type includes Fixnumb, Float, etc so more Test Case shall be added.

    Ex: Test.expect Typer.is_number? 5.0

  • Dvoreth Avatar

    This comment has been hidden.

  • PainKKKiller Avatar

    Something strange with tests in this kata. When I do Run Tests everything green, but when I submit it gives me: failed on number literal arg. failed on Number constructor arg. failed on casted to Number arg.

    What does it mean, can you decifer? I have no idea how looks test cases I've failed.

  • IGRACH Avatar

    Only one fail failed on Number constructor arg. What to do? I can't pass number testing, so frustrated!!!

  • kirilloid Avatar

    What's the point of testing 4 "different" undefined values. They're indistinguishable for test function.

  • schfkt Avatar

    From the tests:

    isNumber
      should fail on not a number argument
        passed on NaN arg.
      
    

    I think this test case is misleading. isNumber should return true for NaN values and this is ok. Since NaN is number (links to the EcmaScript spec: Number type, NaN)

    Anyway, this thing about NaN should be mentioned in the description.

  • VladimirZd Avatar

    HI, i got stuck with this kata. All test i have done are running fine, but when i submit it i get "failed on String constructor arg!" error.. Never used JS before so i am not even sure where to start? Any suggestions would be great.

    Thnx

  • wthit56 Avatar

    Needs a better description of the methods to implement.

  • Azuaron Avatar

    Arrays are Objects in Javascript, so:

    typer.isObject([1])
    

    should return true.