Last active
October 22, 2015 10:07
-
-
Save think2011/85f158bc560e2bdc9653 to your computer and use it in GitHub Desktop.
转换为整数
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 转换为整数 | |
* @returns {this} | |
*/ | |
Number.prototype.toInt = function () { | |
return isNaN(this) ? 0 : parseInt(this); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment