JSchallenger

Check if one date is earlier than another

Viewed: 188
Attempted: 81
Solved: 22
// Write a function that takes as argument an object with the properties a and b, each containing a date instance
// It should return true if date a is earlier than date b
// It should return false otherwise
//

function myFunction() {

return
}
Test Cases:
myFunction({a: new Date('2000/01/01 08:00:00'), b: new Date('2000/01/01 08:45:00')})
Expected
true
myFunction({a: new Date('2000/01/01 08:45:00'), b: new Date('2000/01/01 08:00:00')})
Expected
false
myFunction({a: new Date('2000/01/01 08:00:00'), b: new Date('2000/01/01 08:00:00')})
Expected
false