is is odd and so is this isOdd
# Rick Waldron (13 years ago)
On Thu, Mar 8, 2012 at 5:23 PM, Andreas Rossberg <rossberg at google.com>wrote:
Today, I came up with this odd way to implement an isOdd predicate in tentative ES6, and thought I share it:
function isOdd(n) { let is = n isnt n; return eval(Array(2 * n).join("is ") + "is") }
That looks fun - I like seeing all of the new parts in real world code examples -
# David Herman (13 years ago)
Today, I came up with this odd way to implement an isOdd predicate in tentative ES6, and thought I share it:
function isOdd(n) { let is = n isnt n; return eval(Array(2 * n).join("is ") + "is") }
:)