Ad
  • Custom User Avatar

    sorry. JavaScript.

  • Custom User Avatar

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

  • Custom User Avatar

    I can not use Object.fromEntries.
    「TypeError: Object.fromEntries is not a function」

  • Custom User Avatar

    what error mean 「Unhandled rejection TestError: Value is not what was expected」

  • Custom User Avatar

    my solution is here.

    function Lock() {
      this.key = null
      this.createKey = function(){
        this.key = Number(new Date())
        return this.key
      }
      this.check = function(key){
        return this.key === key
      }
       this.expire = function(key){
          this.key = null
      }
    }
    

    this code can passed test. but attempt is not. above error occur.
    why? should I need..

    Test Results:
    Lock
    .createKey()
    should return an object
    Completed in 2ms
    .check()
    Unspecified AssertionError
    .expire()
    other keys should fail check
    Completed in 5ms