JS
See the Pen thecodelog.com - ES7 Array Methods 1 by Deano (@deangilewicz) on CodePen.
This method handles NaN better than Array.prototype.indexOf(). If the array contains NaN, then indexOf() does not return a correct index while searching for NaN.
See the Pen thecodelog.com - ES7 Array Methods 2 by Deano (@deangilewicz) on CodePen.