LeetCode Records - Question 2704 To Be Or Not To Be
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%)