forked from phaserjs/phaser
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathIsEven.js
More file actions
25 lines (22 loc) · 652 Bytes
/
Copy pathIsEven.js
File metadata and controls
25 lines (22 loc) · 652 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2018 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
/**
* Check if a given value is an even number.
*
* @function Phaser.Math.IsEven
* @since 3.0.0
*
* @param {number} value - The number to perform the check with.
*
* @return {boolean} Whether the number is even or not.
*/
var IsEven = function (value)
{
// Use abstract equality == for "is number" test
// eslint-disable-next-line eqeqeq
return (value == parseFloat(value)) ? !(value % 2) : void 0;
};
module.exports = IsEven;