Skip to content

Latest commit

 

History

History
27 lines (25 loc) · 577 Bytes

Question_2704.md

File metadata and controls

27 lines (25 loc) · 577 Bytes

LeetCode Records - Question 2704 To Be Or Not To Be

Attempt 1:

var expect = function(val) {
    return {
        toBe: function(newVal) {
            if (val === newVal) {
                return true;
            } else {
                throw 'Not Equal';
            }
        },
        notToBe: function(newVal) {
            if (val !== newVal) {
                return true;
            } else {
                throw 'Equal';
            }
        }
    }
};
  • Runtime: 42 ms (Beats: 95.41%)
  • Memory: 48.58 MB (Beats: 76.65%)