Skip to content

Commit ce7bcb2

Browse files
committed
Return actual boolean value instead of 1
This is particularly helpful when doing === comparisons. Now isOdd is consistent with isEven, which returns actual boolean values as well.
1 parent c823037 commit ce7bcb2

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/math/Math.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -581,7 +581,7 @@ Phaser.Math = {
581581
*/
582582
isOdd: function (n) {
583583
// Does not work with extremely large values
584-
return (n & 1);
584+
return !!(n & 1);
585585
},
586586

587587
/**

0 commit comments

Comments
 (0)