Advertisement
Guest User

Untitled

a guest
Aug 26th, 2016
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.22 KB | None | 0 0
  1. /*
  2. Determines if current second is an odd or even number. Useful for boolean 'random' for A/B testing.
  3. */
  4.  
  5. if (Math.floor(new Date().getTime() / 1000) % 2 == 0) {
  6. console.log('even')
  7. } else {
  8. console.log('odd')
  9. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement