« Return to Thread: is is odd and so is this isOdd

Re: is is odd and so is this isOdd

by David Herman :: Rate this Message:

| View in Thread

http://www.youtube.com/watch?v=Xm_7FLKRS4Y

Dave

On Mar 8, 2012, at 2:23 PM, Andreas Rossberg 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")
> }
>
> :)
>
> /Andreas
> _______________________________________________
> es-discuss mailing list
> es-discuss@...
> https://mail.mozilla.org/listinfo/es-discuss

_______________________________________________
es-discuss mailing list
es-discuss@...
https://mail.mozilla.org/listinfo/es-discuss

 « Return to Thread: is is odd and so is this isOdd