Skip to content

Commit e1d8a80

Browse files
committed
Avoid isNaN
1 parent 19d02b3 commit e1d8a80

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

codepointat.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ if (!String.prototype.codePointAt) {
99
var size = string.length;
1010
// `ToInteger`
1111
var index = position ? Number(position) : 0;
12-
if (isNaN(index)) {
12+
if (index != index) { // better `isNaN`
1313
index = 0;
1414
}
1515
// Account for out-of-bounds indices:

0 commit comments

Comments
 (0)